You can refer to the following to install Apache + PHP + Tomcat7 + MySQL on CentOS.
Linux The most used web environment on the platform is php, Java and MySQL, we will build this environment, you can Run many open source programs.
As a programmer, although you don't need to be proficient in operation and maintenance, it is better to master the basic Linux environment construction, and it is also convenient for you to debug some codes and programs.
There are lamp and lnmp one-click packages for php, which can easily install the environment with one click. If you are running Java Web application, you need to use Tomcat.
In fact, under Linux, it is easy to manually install and configure these software by yourself. Instead of compiling and installing from source code, we use yum commands to complete.
Let's take the most commonly used Linux systems CentOS5.x and 6.x as examples to talk about the installation steps. According to this operation, you can also build a php+java+MySQL environment by yourself!
After remote ssh login into the system, first
Start Tomcat7
#. /usr/local/tomcat7/bin/startup.sh
Enter http://your IP:8080/ in the browser address bar, you can see the start page of Apache Tomcat, if you can’t see it, please confirm whether it is a firewall problem.
Apache and Tomcat integration
Here we use a simple Proxy method to integrate Apache and Tomcat
Add ProxyPass / ajp://localhost:8009/ (If you already have this file, just delete the comment symbol # before the corresponding content)
/////////////////////////////////////////////////////////////////////
Using ProxyPass / ajp://localhost:8009/ will cause applications installed under Apache (httpd) to be inaccessible.
The directories can be distinguished by the following methods
ProxyPass /tomcat/ ajp://localhost:8009/
Enter http://your IP/tomcat/ in the browser address bar, you can see the start page of Apache Tomcat
/////////////////////////////////////////////////////////////////////
After saving the changes, restart Apache
The software files and configuration paths installed above are as follows:
The apache configuration file is under /etc/httpd/conf
Apache's modules are placed under /usr/lib/httpd
The php configuration file is under /etc/php.d/ and /etc/php.ini
PHP modules are placed under /usr/lib/php/modules
The installation directory of Tomcat7 is located at /usr/local/tomcat7
Through the above simple steps, you can also configure the web environment commonly used under Linux.
reference:
http://my.oschina.NET/vikingz/blog/153469
http://www.xianren.org/system/centos6-4-yum-mysql-jdk-tomcat.html
Recommended Posts