创建httpd的系统用户

解压

安装



cd httpd-2.4.10
./configure --prefix=http://www.likecs.com/usr/local/apache --sysconf=http://www.likecs.com/etc/httpd2.4 --enable-ssl --enable-cgi --enable-rewrite --with-zlib --with-pcre --with-apr=http://www.likecs.com/usr/local/apr --with-apr-util=http://www.likecs.com/usr/local/apr-util --enable-modules=most --enable-mpms-shared=all --with-mpm=prefork
make && make install
生成httpd控制脚本(手动编写或修改自带控制脚本)


#chkconfig: 35 85 21 #设定默认启动级别3、5,85为启动优先级 21为关闭优先级,数字越小,优先级越高
#description:wwww #描述信息
添加环境变量



export PATH=http://www.likecs.com/usr/local/apache/bin:$PATH
自定义启动deflate和rewrite模块并修改servername属性




启动服务并设定开机自启


也可以使用apachectl命令进行控制