httpd的rpm包及源碼安裝配置linux
一、rpm包安裝vim
系統環境:centos
[root@zhaochj ~]# cat /etc/issue測試
CentOS release 6.4 (Final)ui
Kernel \r on an \m.net
[root@zhaochj ~]# uname -rrest
2.6.32-358.el6.x86_64htm
[root@zhaochj ~]# ifconfig | grep Bcast:get
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.0.200 zhaochj #增長此行
配置主配置文件,啓用ServerName:
[root@zhaochj httpd]# vim conf/httpd.conf
ServerName 192.168.1.200:80 #啓用ServerName,並修改成
測試配置文件:
[root@zhaochj httpd]# httpd -t
Syntax OK
啓用httpd服務:
[root@zhaochj httpd]# service httpd start
Starting httpd: [ OK ]
查看httpd的版本:
[root@zhaochj ~]# httpd -v
Server version: Apache/2.2.15 (Unix)
Server built: Oct 16 2014 14:48:21
查看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
CentOS 6.5編譯安裝httpd-2.4.7 http://www.linuxidc.com/Linux/2014-02/97265.htm
httpd中工做模型的比較 http://www.linuxidc.com/Linux/2014-03/99093.htm
源碼編譯安裝httpd2.4及虛擬主機 http://www.linuxidc.com/Linux/2014-08/105384.htm
編譯安裝最新版httpd-2.4 http://www.linuxidc.com/Linux/2014-03/98761.htm
httpd2.4基本功能的實現... http://www.linuxidc.com/Linux/2014-03/98762.htm