I seem to need to do this every year or so, and I always forget that it is not very hard. These are my steps and settings: YMMV.
1 |
cd ~/Downloads |
1 |
sudo mv apache-tomcat-7.0.41 /Library |
1 |
cd /Library |
1 |
sudo ln -s apache-tomcat-7.0.41/ tomcat |
I live in a Bash world, so I will edit my ~/.bashrc file and add in some of the goodness:
1 2 3 4 5 6 |
# tomcat export JAVA_HOME=/Library/Java/Home export CATALINA_HOME=/Library/tomcat/ export CLASSPATH=/Library/Tomcat/common/lib; alias start_tomcat='/Library/tomcat/bin/startup.sh' alias stop_tomcat='/Library/tomcat/bin/shutdown.sh' |
It’s reasonable to note that my .bash_profile file looks like the following, so that the .bashrc file is executed every time:
1 2 3 |
if [ -f ~/.bashrc ]; then source ~/.bashrc fi |
Now for the security bit. I’m sure this is more aggressive than it needs to be but I 777 the /bin directory in my new “tomcat” install.
1 2 |
cd /Library/tomcat/bin chmod -R 777 * |
That’s all. It’s not simple, but it’s pretty easy. Now you can start your tomcat (see alias above — and open a new terminal window to pick up the alias). Then head over to:
Deploying Web Apps (html):
So I have a lot of HTML / JS projects and I like running them quickly through my new shiny web server. To do this I simply create