標籤:apache httpd安裝
1、rpm包安裝
系統內容:
[[email protected] ~]# cat /etc/issueCentOS release 6.4 (Final)Kernel \r on an \m[[email protected] ~]# uname -r2.6.32-358.el6.x86_64[[email protected] ~]# ifconfig | grep Bcast: inet addr:192.168.0.200 Bcast:192.168.0.255 Mask:255.255.255.0
查看當前yum源中可用的httpd安裝包:
[[email protected] ~]# yum list all *httpd*Loaded plugins: fastestmirrorLoading mirror speeds from cached hostfile * base: mirrors.btte.net * extras: mirrors.btte.net * updates: mirrors.btte.netAvailable Packageshttpd.x86_64 2.2.15-31.el6.centos updateshttpd-devel.i686 2.2.15-31.el6.centos updateshttpd-devel.x86_64 2.2.15-31.el6.centos updateshttpd-manual.noarch 2.2.15-31.el6.centos updateshttpd-tools.x86_64 2.2.15-31.el6.centos updates
安裝httpd:
[[email protected] ~]# yum -y install all httpd
查看產生的設定檔:
[[email protected] ~]# rpm -qc httpd/etc/httpd/conf.d/welcome.conf/etc/httpd/conf/httpd.conf/etc/httpd/conf/magic/etc/logrotate.d/httpd……
httpd配置相關的目錄結構:
[[email protected] httpd]# pwd/etc/httpd[[email protected] 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檔案:
[[email protected] httpd]# vim /etc/hosts192.168.1.200 zhaochj #增加此行
配置主設定檔,啟用ServerName:
[[email protected] httpd]# vim conf/httpd.confServerName 192.168.1.200:80 #啟用ServerName,並修改為
查看httpd的使用的MPM,預設是prefork:
[[email protected] httpd]# httpd -lCompiled in modules: core.c prefork.c http_core.c mod_so.c
修改MPM為worker,並驗證:
[[email protected] httpd]# vim /etc/sysconfig/httpdHTTPD=/usr/sbin/httpd.worker #啟用此行[[email protected] httpd]# service httpd restart[[email protected] httpd]# ps aux | grep httpd
本文出自 “SNAIL” 部落格,請務必保留此出處http://357742954.blog.51cto.com/368705/1603702
httpd的rpm包及源碼安裝配置