PhillipBlanton.com

"Save me, oh God, from people who have no sense of humor."
— Ludlow Porch

Installing Apache Tomcat on Fedora.

I recently posted this on the Fedora forum, but thought it might be good to post it here too...

https://ask.fedoraproject.org/en/question/72710/how-to-install-start-apache-tomcat-on-fedora-22and-also-how-to-run-jsp-program/#95415

to expand upon luqman's answer...

Install Tomcat by issuing the terminal command ...

sudo dnf install tomcat

Enter your password to allow sudo to give dnf admin permissions.

In case you wanted more information on setting up and using Tomcat once it's installed, here you go... These notes are for Fedora 24, but may work on older versions that have support for dnf. Otherwise try replacing "dnf" with "yum" in these instructions.

To install the webapps, run ...

 sudo dnf install tomcat-webapps

Then issue the command...

service tomcat restart

and enter your password in the challenge screen. Now you should be able to bring up a browser and navigate to http://localhost:8080 and see Tomcat running.

FYI:

  • on Fedora 24, dnf installs Tomcat to /usr/share/tomcat

  • If you want to install the Tomcat management tools run sudo dnf install tomcat-admin-webapps

  • To set the tomcat admin password, edit /usr/share/tomcat/conf/tomcat-users.xml like this... sudo vi /usr/share/tomcat/conf/tomcat-users.xml Un-comment these lines near the bottom...

    <role rolename="admin"/>
    <role rolename="admin-gui"/> <role rolename="admin-script"/> <role rolename="manager"/> <role rolename="manager-gui"/> <role rolename="manager-script"/> <role rolename="manager-jmx"/> <role rolename="manager-status"/> <user name="admin" password="<must-be-changed>" roles="admin,manager,admin-gui,admin-script,manager-gui,manager-script,manager-jmx,manager-status" />

Change the <must-be-changed> to whatever password you want. You can also change the username to something other than "admin" if you like. Save the file :wq and then run...

    service tomcat restart

To restart tomcat and load the new values. Every time you make a change to Tomcat, you need to re-run "service tomcat restart" to cause it to reload.

Browse to http://localhost:8080 and click on the [Manager App] button. Enter the username "admin" or whater you changed it to, and the password you put in the tomcat-users.xml file and you are logged in to the Tomcat Application Manager.

Have a lot of fun! O_o