cd Downloads/apache-tomcat-6.0.18/binA useful tip is that you can press 'tab' to auto-complete file paths in most Unix shells so this will probably get you there:
cd Dow[tab]apa[tab]/bin(depending on what other files you have on your system). Now we'll make the various shell scripts executable:
chmod +x *.shIf you use ls -l you'll see most files have permissions -rw-r--r--@ for owner-read/write and group/world readable. The shell scripts (*.sh) are now -rwxr-xr-x@ so they are executable (by owner, group and world). Now we can start Tomcat (as with the 'Express' version of Railo, we're just trying to get it up and running right now - we'll move it somewhere more appropriate in a later blog post). Starting Tomcat If you're still in the bin folder, you can start Tomcat by typing:
./startup.shYou should just get four lines of output saying which paths it is using. That's it, Tomcat is running! You may also notice a new application running, called org.apache.catalina.startup.Bootstrap. As with the 'Express' experiments, leave it running - it's the core Tomcat process. FWIW, I prefer using the ./startup.sh form because I can type ./st[tab] and save myself a few key strokes. If it complains it cannot find ./catalina.sh, you didn't get the 'chmod' command right (see above). Testing Tomcat Browse to http://localhost:8080/. You should see the Tomcat welcome page (you can't access the manager or admin consoles without doing some initial configuration - see the next post in this series). Now we need to get Railo installed and running... Download Railo Go to the download page and under "Railo Custom", pick the "war" (web archive) file: railo-3.0.2.001.war I had to right-click > Download Linked File (otherwise I got a browser full of data!). In the Finder rename the file to railo.war (it'll make life easier when we test things below). Now drag railo.war and drop it into the webapps folder inside the expanded Tomcat folder. After a couple of seconds, you'll see a new railo folder appear next to the existing manager, ROOT and other folders. Tomcat has automatically deployed the web archive for you! You can now remove railo.war or at least move it somewhere else in case you need it again. Testing Railo Now browse to http://localhost:8080/railo/ and you should see the familiar Railo test page. You can now do all the usual stuff with Railo at this point - see previous posts. Stopping Tomcat/Railo Go back to your Terminal window and make sure you're still in the bin folder (the pwd command will print your current 'working' directory), then type:
./shutdown.shAfter four lines of output, Tomcat will shutdown. As with startup, you can use ./sh[tab] to save yourself some key strokes. If you want to be able to just double-click the startup script from the Finder, rename it so it has no extension. The Finder will confirm you really want to remove the extension - click Remove. You can stop Tomcat by switching to the org.apache.catalina.startup.Bootstrap application (using Cmd-Tab) and quitting it like any regular application - or right-click > Quit on its dock icon. In the next part of this series, we'll get Railo running on Tomcat without needing the /railo prefix on URLs (the 'context root' in Servlet-speak) and look at ways to configure Tomcat with Apache so you can use this setup for 'real' websites.