httpd的rpm包及源码安装配置
1、rpm包安装
系统环境:
[root@zhaochj ~]# cat /etc/issue CentOS release 6.4 (Final) Kernel \r on an \m [root@zhaochj ~]# uname -r 2.6.32-358.el6.x86_64 [root@zhaochj ~]# ifconfig | grep Bcast: inet addr:192.168.0.200 Bcast:192.168.0.255 Mask:255.255.255.0
查看当前yum源中可用的httpd安装包:
[root@zhaochj ~]# yum list all *httpd* Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: mirrors.btte.net * extras: mirrors.btte.net * updates: mirrors.btte.net Available Packages httpd.x86_64 2.2.15-31.el6.centos updates httpd-devel.i686 2.2.15-31.el6.centos updates httpd-devel.x86_64 2.2.15-31.el6.centos updates httpd-manual.noarch 2.2.15-31.el6.centos updates httpd-tools.x86_64 2.2.15-31.el6.centos updates
安装httpd:
[root@zhaochj ~]# yum -y install all httpd
查看生成的配置文件:
[root@zhaochj ~]# rpm -qc httpd /etc/httpd/conf.d/welcome.conf /etc/httpd/conf/httpd.conf /etc/httpd/conf/magic /etc/logrotate.d/httpd ……
httpd配置相关的目录结构:
[root@zhaochj httpd]# pwd /etc/httpd [root@zhaochj httpd]# tree . ├── conf │ ├── httpd.conf │ ├── httpd.conf.back │ └── magic ├── conf.d │ ├── README │ └── welcome.conf ├── logs -> ../../var/log/httpd ├── modules -> ../../usr/lib64/httpd/modules └── run -> ../../var/run/httpd
配置hosts文件:
[root@zhaochj httpd]# vim /etc/hosts 192.168.1.200 zhaochj #增加此行
配置主配置文件,启用ServerName:
[root@zhaochj httpd]# vim conf/httpd.conf ServerName 192.168.1.200:80 #启用ServerName,并修改为
查看httpd的使用的MPM,默认是prefork:
[root@zhaochj httpd]# httpd -l Compiled in modules: core.c prefork.c http_core.c mod_so.c
修改MPM为worker,并验证:
[root@zhaochj httpd]# vim /etc/sysconfig/httpd HTTPD=/usr/sbin/httpd.worker #启用此行 [root@zhaochj httpd]# service httpd restart [root@zhaochj httpd]# ps aux | grep httpd
本文出自 “SNAIL” 博客,请务必保留此出处http://357742954.blog.51cto.com/368705/1603702
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。