CentOS Apache2.4 编译

先安装 

apr 、 apr-util、 pcre-devel

执行编译命令

./configure --prefix=/usr/local/apache --enable-module=so--enable-deflate=shared --enable-expires=shared --enable-rewrite=shared --enable-cache --enable-file-cache --with-mpm=worker --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util/

将httpd 加入service

cp /usr/local/apache/bin/apachectl  /etc/rc.d/init.d/httpd

修改httpd 加入

# chkconfig: 2345 50 90

# description:Activates/Deactivates Apache Web Server)

启动Apache

service httpd start

查看端口占用情况

lsof -i:80

LoadModule php5_module modules/libphp5.so

AddType application/x-httpd-php .php .html .htm

Apache按照每天记录日志配置

# Log Format

ErrorLog "|/usr/local/apache/bin/rotatelogs/data/log/httpd/datasheets/error_log%Y%m%d.log 86400 480"

CustomLog "|/usr/local/apache/bin/rotatelogs/data/log/httpd/datasheets/access_log%Y%m%d.log 86400 480" common

403错误需要在虚拟主机中添加如下配置

Options Indexes FollowSymLinks Includes ExecCGI

AllowOverride All

Require all granted

<./Direcotry>

你可能感兴趣的:(CentOS Apache2.4 编译)