Apache build specifications

Source: Internet
Author: User

1. installation environment... 4

2. Installation Steps... 5

2.1. Install zlib. To use the Apache deflate module, use zlib... 5.

2.2. install and configure Apache. 5

2.2.1. Compile and install Apache. 5

2.2.2. Configure Apache. 6

2.2.3. mod_jk.so get... 9

 

1. installation environment

OS: SuSE Linux Enterprise Server 10

Apache: 2.2.14

JK: 1.2.28

 

 

2. Installation Steps

2. 1. Install zlib. To use the Apache deflate module, use zlib.

# Cd/data/postmall/Steve

# Tar-xzvf zlib-1.2.3.tar.gz

# Cd zlib-1.2.3

#./Configure

VI makefile
Find cflags =-O3-duse_mmap
After-FPIC is added, it becomes cflags =-O3-duse_mmap-FPIC.

# Make

# Make install

 

2. install and configure Apache

2.2.1. Compile and install Apache

Download Apache 2.2.14 from http://httpd.apache.org/download.cgito the temporary directory of the server. Assume It is/data/postmall/Steve.

 

# Cd/data/postmall/Steve

# Tar zxvf httpd-2.2.14.tar.gz

# Cd httpd-2.2.14

# Vi server/MPM/worker. c

Modify

# Define default_server _limit 512 default 16

# Define max_server_limit 20000

# Define default_thread_limit 1024 (default 64)

# Define max_thread_limit 20000

#. /Configure -- prefix =/usr/local/Apache -- With-MPM = worker -- enable-mod-shared = all -- enable-so -- enable-most -- enable-max -- enable- rewrite = shared -- enable-speling = shared -- enable-Deflate = shared -- enable-Cache = shared -- enable-file-Cache = shared -- enable-proxy = shared -- enable-Cache -- enable-disk-Cache -- enable-Mem-Cache -- enable-file-Cache -- enable-proxy-AJP = shared -- enable-proxy-balancer = shared

# Make

# Make install

Add/usr/local/Apache/lib to/etc/lD. So. conf

# Echo/usr/local/Apache/lib>/etc/lD. So. conf

# Ldconfig

# Cp/usr/local/Apache/bin/apachectl/etc/init. d/httpd

Make sure httpd is automatically started after the system is started.

# Chkconfig -- list | grep httpd

Httpd 0: off 1: off 2: off 3: On 4: off 5: on 6: Off

If all of the preceding values are off, execute

# Chkconfig httpd on

The httpd process can be started or stopped as root, but Apache does not need to be started before configuration.

#/Sbin/service httpd start (STOP, restart)

# Mkdir-P/data/logs/Apache

 

2.2.2. Configure Apache

/Usr/local/Apache/CONF/httpd. conf

Change the starting user and group to Web and users.

User Web

Group users

 

Add the following configuration so that Apache can smoothly access the/data/postmall directory.

<Directory "/data/postmall">

Options followsymlinks

AllowOverride none

Order allow, deny

Allow from all

</Directory>

 

Add the JK module. For more information about how to obtain the mod_jk.so file, see mod_jk.

Loadmodule jk_module modules/mod_jk.so

# JK modules config

Jkworkersfile/usr/local/Apache/CONF/workers. Properties

Jklogfile/data/logs/Apache/mod_jk.log

Jkloglevel warn

Jkoptions + forwardkeysize + forwarduricompat-forwarddirectories

Jkshmfile/data/logs/Apache/mod_jk.shm

 

Add index. php index. jsp after directoryindex

Directoryindex index.html index. php index. jsp

 

Remove the # above the line below

Include CONF/extra/httpd-vhosts.conf

 

/Usr/local/Apache/CONF/workers. properties (Add File)

Worker. List = ule1
Worker. ule1.type = ajp13
Worker. ule1.port = 8009
Worker. ule1.connection _ pool_size = 256
Worker. ule1.connection _ pool_timeout = 300
Worker. ule1.connection _ pool_minsize = 128
Worker. ule1.socket _ timeout = 300

 

Worker. List = ule2
Worker. ule2.type = ajp13
Worker. ule2.port = 9009
Worker. ule2.connection _ pool_size = 256
Worker. ule2.connection _ pool_timeout = 300
Worker. ule2.connection _ pool_minsize = 128
Worker. ule2.socket _ timeout = 300

 

/Usr/local/Apache/CONF/extra/httpd-mpm.conf

Comment out the original mpm_worker configuration information and use the following configuration

<Ifmodule mpm_worker_module>

Startservers 5

Serverlimit 128

Maxclients 25600

Minsparethreads 50

Maxsparethread S 200

Threadlimit 384

Threadsperchild 256

Maxrequestsperchild 10000

</Ifmodule>

 

 

/Usr/local/Apache/CONF/extra/httpd-vhosts.conf

Namevirtualhost *: 80

<Virtualhost *: 80>
Servername card.ule.tom.com

Serveralias card.ulechina.tom.com

DocumentRoot/data/postmall/tomcat/website_ulecard/root

Jkmount/* ule1

Errorlog "/data/logs/Apache/ulecard-error.log"
Customlog "/data/logs/Apache/ulecard-access.log" combined
</Virtualhost>

 

<Virtualhost *: 80>
Servername egiftcard.ule.tom.com

DocumentRoot/data/postmall/tomcat/website_egiftcard/root

Jkmount/* ule2

Errorlog "/data/logs/Apache/egiftcard-error.log"
Customlog "/data/logs/Apache/egiftcard-access.log" combined
</Virtualhost>

 

2.2.3. mod_jk.so get

Download the corresponding. So file from http://archive.apache.org/dist/tomcat/tomcat-connectors/jk/binaries/linux/jk-1.2.28/ based on different system platforms and Apache versions and rename it mod_jk.so to/usr/local/Apache/module/

 

Or

 

# Tar-zxvf tomcat-connectors-1.2.28-src.tar.gz

# Cd tomcat-connectors-1.2.28-src/native

#./Configure -- With-apxs =/usr/local/Apache/bin/apxs

# Make

# Cp APACHE-2.0/mod_jk.so/usr/local/Apache/modules/

This article is from the "Zhanghe" blog, please be sure to keep this source http://9206668.blog.51cto.com/9196668/1535908

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.