Apache Compilation Installation

Source: Internet
Author: User

1, installation

Yum InstallZlib Zlib-devel-yTarXF httpd-2.2. -.Tar. GZ CD httpd-2.2. -./Configure--prefix=/application/apache2.2.27 --enable-deflate--enable-Expires--enable-Headers--enable-modules= Most--enable- So--with-mpm=worker--enable-rewrite Make&& Make InstallLN-s/application/apache2.2.27//application/Apache./Configure--prefix=/application/apache2.2.27 --enable-deflate \ #压缩--enable-expires \ #超时--enable-headers \ #http头--enable-modules= Most--enable- So--with-mpm=worker \ #apache两种模式, worker: Process thread, perform: process provides service--enable-rewrite Make&& Make InstallLN-s/application/apache2.2.27//application/apache

Check syntax and start

/application/apache/bin/apachectl-t

/application/apache/bin/apachectl start

Master configuration file

" /application/apache2.2.27/htdocs " ...
#打开vhost配置Include conf/extra/httpd-vhosts.conf ...
Include conf/extra/httpd-mpm.conf #默认perfork模式, if you open MPM is worker mode
127.0. 0.1 :

Virtual Host Configuration

[Email protected] extra]# vim httpd-vhosts.conf
#虚拟主机支持, you must open Namevirtualhost*: the<virtualhost *: the>ServerAdmin781647046@qq. com documentroot"/var/html/www"ServerName www.lanny.com serveralias www.ma.com errorlog"Logs/www-error_log"Customlog"Logs/www-access_log"Common</virtualhost><virtualhost *: the>ServerAdmin781647046@qq. com documentroot"/var/html/blog"ServerName blog.lanny.com serveralias blog.ma.com errorlog"Logs/blog-error_log"Customlog"Logs/blog-access_log"Common</virtualhost><virtualhost *: the>ServerAdmin781647046@qq. com documentroot"/var/html/bbs"ServerName bbs.lanny.com serveralias bbs.ma.com errorlog"Logs/bbs-error_log"Customlog"Logs/bbs-access_log"Common</VirtualHost>Serious NOTE: If you do not add Namevirtualhost*:80 below will be an error.

Virtual Host 403 Error:

append to httpd.conf after modification " /var/html ">    allowoverride none    Options none    Order allow,deny    allow from all </ Directory>

403 error will be reported if index.html or the file accessed is not present

mkdir /var/html/{www,blog,bbs}-ptouch /var/html/{www,blog,bbs}/index.html  for  in www bbs blog;  Do Echo " $i. lanny.com " >/var/html/$i/index.html;  Done  for  in www bbs blog;  Do cat /var/html/$i/index.html;  Done

Strace command: Trace Why the CPU is high. (Usually the program bug, there is a dead loop, etc.)

strace/application/apache/bin/Apachectl–m

Apache Compilation Installation

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.