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错误需要在虚拟主机中添加如下配置

<Directory "/www">

Options Indexes FollowSymLinks Includes ExecCGI

AllowOverride All

Require all granted

<./Direcotry>

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容