Apache2.x + atat6.0 integrated notes

Source: Internet
Author: User
Tags php website

The installation sequence of the software can be adjusted as appropriate, but JRE (JDK) must be installed before Tomcat:
1. Install JRE (JDK)
Select "install by default" here. (After JDK of the old version is installed, you must set the system environment variables. It does not matter if JRE and JDK 1.5.0 are not set .) After the installation is complete, you can choose to set your system environment variables as follows: My computer-> right-click Properties-> General-> advanced-> Environment Variables
Java_home = D: \ Java \ jre1.5.0 _ 06
Classpath =.; D: \ Java \ jre1.5.0 _ 06 \ Lib \ DT. jar; D: \ Java \ jre1.5.0 _ 06 \ Lib \ tools. Jar
Path = D: \ Java \ jre1.5.0 _ 06 \ bin
Note that the file path should be changed to the actual installation path.

2. install Apache
Note that if your local machine has already installed IIS and uses port 80, you must first stop or disable IIS in the service. Install the software by default. Set the network domain and server name to localhost during the installation process and set your email address. below, you will choose only for the current user or for all users. The default value is for all users. In this way, Apache occupies port 80 and runs as a system service.
After the installation is complete, enter http: // localhost in the browser and you will see the successful Apache page. the main directory of Apache is D: \ apache \ apache2. Apache is running. You can view its icon on the tray of the window and double-click it, in the displayed window, select "Open Apache monitor", click STOP to stop the apaceh service, because Tomcat and JK are to be installed below.

3. tomcat installation
Select "D: \ Tomcat" as the installation directory, and enter "http: // localhost: 8080" in the browser after the installation is successful. The "Tomcat" page indicates that the installation is successful. There have been many detailed articles on Tomcat settings, so I will not detail them here.

4. JK Installation
Copy mod_jk_2.0.55.so to D: \ apache \ apache2 \ modules.

After the installation is complete, open the CMD command prompt and run D: \ apache \ apache2 \ bin \ apache.exe-T. You will see "syntax OK", indicating that Apache configuration is normal. this command is very useful and will be used again when you continue to configure Apache.

Configuration server:

1. Configure Tomcat
Search for the conf/workers. properties file in the directory and compare the text content below. If the following content is different, modify it.
Workers. tomcat_home = D: \ Tomcat # Let the mod_jk module know the location of Tomcat
Workers. java_home = D: \ Java \ jre1.5.0 _ 06 # Let the mod_jk module know the location of the JRE
PS = \
Worker. List = ajp13 # module version
Worker. ajp13.port = 8009 # Working port. Do not modify it if it is not occupied
Worker. ajp13.host = localhost # local machine. If the above Apache host is not localhost, modify it accordingly.
Worker. ajp13.type = ajp13 # type
Worker. ajp13.lbfactor = 1 # Number of proxies, no need to modify

If the file does not exist, it is created. And fill in the above content.

2. Configure Apache
Open httpd. conf under D: \ apache \ apache2 \ conf, add the following code and save it.
# Set the connection between APACHE and tomcat. When apache encounters a JSP file, it is handed over to tomcat in the background for processing.
Loadmodule jk_module modules/mod_jk.so

# I downloaded mod_jk_2.0.55.so. The original version does not always report an error. Therefore, version compatibility is very important. The so module must correspond to the name you load. For example, the jk_module and mod_jk.so


# The mod_jk file here is the file you downloaded
Jkworkersfile "D:/tomcat/CONF/workers. properties"
# Specify the Tomcat Listener Configuration File address
Jklogfile "D:/tomcat/logs/mod_jk2.log"
# Specify the log storage location
Jkloglevel info
Jkmount/*. jsp ajp13

# Apache supports JSP transmission, which can be placed in the <virtualhost> Configuration for Tomcat Parsing

Jkmount/servlet/* ajp13
# Apache supports servlet transfer for Tomcat Parsing
Jkmount/*. Do ajp13
# Apache supports. Do transmission for Tomcat Parsing

Apache's Vm settings are as follows: Modify CONF/httpd. conf find # virtual hosts # include CONF/extra/httpd-vhosts.conf to # virtual hostsinclude CONF/extra/httpd-vhosts.conf to remove comments
Then edit CONF/extra/httpd-vhosts.conf and add the following code (mainly set the VM ):

<Virtualhost *>
<Directory "../vhosts/www.test.com">
Options-indexes followsymlinks
</Directory>
Serveradmin admin@test.com
DocumentRoot "../vhosts/www.test.com"
Servername http://www.test.com/
Serveralias * .test.sxtcg.com
Errorlog logs/test.com-error_log

</Virtualhost>

 

 

Then, set the Tomcat virtual host to open the conf/server. xml file in the tomcat installation directory, and add a host node to the original host node. The content is as follows:

<Host name = "test.com" DEBUG = "0" appbase = "webapps" unpackwars = "true" autodeploy = "true">
<Alias> test.sxtcg.com </alias>
<Context Path = "" docbase = "E:/phpnow/vhosts/www.test.com/" DEBUG = "0" reloadable = "true"/>
</Host>

/* E:/phpnow/vhosts/www.test.com/is the directory for Apache to parse PHP. 2 must be the same directory */

 

In this way, jsp can be delegated to the PHP website.

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.