Tomcat and Apache Stack

This article explains how to setup Tomcat and Apache web server to route traffic over port 80 on our VPS or Dedicated server using Webuzo control panel.

First Install The OS

First install the latest version CentOS 7 on your Dedicated or VPS server.

Second Install webuzo

There are 2 ways to install Webuzo depending on your skill level. This installation installs Webuzo with the basic LAMP stack (Linux, Apache, MySQL and PHP). You can choose to ssh in and run bash commands or install via your webui. (The web gui is only available for VPS solution.

Install Via SSH

wget -N http://files.webuzo.com/install.sh
chmod 0755 install.sh
./install.sh

Install from Web GUI

Log into your VPS control panel, click on Control Panel icon and choose Webuzo.



Configure webuzo

Once installed you will need to configure webuzo, goto http://[Your_Server_IP]:2040 and input username, password, nameservers. Keep the license field empty since license will auto activate once purchased.

Get Webuzo license and activate

Go to https://webuzo.com/pricing and purchase a license for your IP address

Configure Domain A Record

For the configuration to work, your domain must be pointed to the VPS or dedicated server IP. Create an A (Address) record in your dns to point to this IP.

Install Tomcat

  1. Login at http://[Your_Server_IP]:2002 with the admin user you just created in previous step
  2. Search for Tomcat.
  3. Click on the version you need to install.


Tomcat will be installed at /usr/local/apps/tomcat8 on default ports that being port 8080 for web and 8009 for AJP.

You should be able to test your tomcat installation using the 8080 port. http://[Your_Server_IP]:8080

Configure Apache to proxy tomcat

Create a file named proxy.conf in your local machine with below contents:

ProxyPreserveHost On
ProxyPass / ajp://localhost:8009/ retry=5
ProxyPassReverse / ajp://localhost:8009/

Go to http://[Your_Server_IP]:2002/ >> Extra Configuration >> Upload the proxy.conf file and ‘Add record’

You will then be able to access tomcat using your website. In this example its http://your_domain.com/

Stop, Start or Restart Tomcat

To stop, start or restart tomcat requires the use of SSH. Here are examples:

ssh roo@[Your_Server_IP]

/etc/init.d/tomcat stop
/etc/init.d/tomcat start
/etc/init.d/tomcat restart

 

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Jetty and Apache Stack

First Install The OS First install the latest version CentOS 7 on your Dedicated or VPS server....