Apache22 + php5 + tomcat5 quick installation guide-Linux Enterprise Application-Linux server application information. For more information, see the following. Apache22 mod_proxy_ajp module trial and apache22 + php5 + tomcat5 quick installation guide
Note: The entire installation is completed in 5.3-RELEASE. But it should also be applicable to other unix like platforms.
I. preparations:
1. First update the port, # cvsup-g-L 2 your-ports-supfile.
2. Install JDK1.5
We recommend that you use JDK1.5p2 (native mode). We will introduce many articles compiled by JDK under FreeBSD, which will not be described here. After installing JDK, do not forget to set the environment variable JAVA_HOME. Then verify that JDK is correctly installed. Execute java? Version to check whether the output is correct.
Ii. Installation
1. install tomcat
Install from port.
2. Install apache22
My make parameters are as follows:
Make WITH_AUTH_MODULES = yes WITH_DAV_MODULES = yes WITH_LDAP_MODULES les = yes WITH_MISC_MODULES = yes wit= yes WITH_SSL_MODULES = yes WITH_SUEXEC_MODULES = yes WITH_PROXY_MODULES = "proxy proxy_http proxy_ajp proxy_balancer"
Make install
Make clean
After the installation is complete, test the lynx localhost. Make sure the installation is correct.
3. Install php5
Cd/usr/ports/lang/php5
Make install clean
Install other required php extension modules
Cd/usr/ports/lang/php5-extension
Make config
Make
Make install
Make clean
Edit httpd. conf and add the following lines:
AddType application/x-httpd-php. php
AddType application/x-httpd-php-source. phps
4. Configure mod_proxy_ajp
First, check whether the mod_proxy module is correctly loaded in httpd. conf. If not, recompile and install apache22. The configuration of mod_proxy_ajp is very simple. Based on flexibility, it is best to configure it separately in the virtual host. My configuration is as follows:
Note:/indicates that all http access requests sent to port 80 are automatically redirected to port 8080 of tomcat listening (default listening port 8180 of tomcat installed by FreeBSD port ). Lynx localhost, you can see the tomcat welcome page. The installation is successful.
Note: Because/sets forward all access to port 80 to tomcat, this may not be what we want. In this case, apache is only a forwarding proxy. In general, we want apache to provide mod_perl and php functions at the same time. Therefore, you must configure URI ing for the jsp application separately. The configuration is also simple: ProxyPass/myapp ajp: // localhost: 8009/, ProxyPassReverse/myapp ajp: // localhost: 8009.
As you can see, mod_proxy_ajp is very simple and convenient compared with the previous generation of mod_jk. The configuration of mod_jk is a nightmare. Haha, what are you waiting for? upgrade now.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service