您的位置:首页 > 运维架构 > Apache

centos下编译安装apache

2016-04-05 17:34 417 查看
下载安装包:cd /usr/local/src wget http://mirrors.sohu.com/apache/httpd-2.2.31.tar.bz2解压:tar jxf httpd-2.2.31.tar.bz2编译安装cd /usr/local/src/httpd-2.2.31yum -y install gccyum -y install zlib-devel openssl-develapr依赖包 shared动静态的包 pcre正则相关的库./configure --prefix=/usr/local/apache2 --with-included-apr --enable-so --enable-deflate=shared --enable-expires=shared --enable-rewrite=shared --with-pcremakemake install启动Apache:/usr/local/apache2/bin/apachectl startps aux |grep httpdnetstat -lnpvi /usr/local/apache2/conf/httpd.conf(若报错就需要编辑该文件)搜到 ServerName,添加以下信息:ServerName localhost:80保存提出ps aux |grep httpdnetstat -lnp/usr/local/apache2/bin/apachectl -M (列出所有模块)ls /usr/local/apache2/modules/ (.so结尾的文件是模块文件)ls /usr/local/apache2/bin/httpddu -sh !$/usr/local/apache2/bin/apachectl -l (列出静态模块)/usr/local/apache2/bin/apachectl -t (查看配置文件是否有语法错误)ls /usr/local/apache2/conf/httpd.conf/usr/local/apache2/bin/apachectl restart(杀掉进程,才重新开启)/usr/local/apache2/bin/apachectl stop!ps /usr/local/apache2/bin/apachectl restart/usr/local/apache2/bin/apachectl graceful (原来进程还在,重新加载配置文件)工作模式:/usr/local/apache2/bin/apachectl -l (prefork)./configure --help |less (可以用/--with-mpm选项指定模式,共三种event、worker 、prefork默认是prefork)2.4版本是event,2.2版本默认是prefork
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: