手工編譯安裝Apache

軟件包鏈接:https://pan.baidu.com/s/1e7AHrQnK2kwR3jZulpL3ow 密碼:yt3b
第一步:mount.cifs //192.168.176.1/LAMP /opt/lamp
第二步:tar xzvf httpd-2.4.2.tar.gz -C /opt
tar xzvf apr-1.4.6.tar.gz -C /opt (支持Apache上層應用跨平臺,提供底層接口庫)
tar xzvf apr-util-1.4.1.tar.gz -C /opt

第三步:cp -R apr(解壓後的文件夾) /opt/httpd-2.4.2/srclib/apr
cp -R apr-util(解壓後的文件夾) /opt/httpd-2.4.2/srclib/apr-util

第四步:安裝 gcc 、 gcc-c++ 、 make 、 pcre、pcre-devel 四個包
(pcre : 一個Perl庫,支持正則表達式)

第五步:cd /opt/httpd-2.4.2(到httpd的目錄下)
.配置:/configure \
--prefix=/usr/local/apache \
--enable-so \
--enable-rewrite \
--enable-mods-shared=most \
--with-mpm=worker \
--disable-cgid \
--disable-cgi

第六步:make && make install
**第七步:vi /etc/init.d/httpd 在文件最前面插入下面的行

#!/bin/sh

chkconfig:2345 85 15

# description:Apache is a World Wide Web server.


第八步:chmod +x /etc/init.d/httpd //給httpd執行1權限
chkconfig --add httpd
chkconfig --list httpd
chkconfig --level 35 httpd on

第九步:建立軟連接便於管理 ln -s /usr/local/apache/conf/httpd.conf /etc/httpd.conf (注意:軟連接使用絕對路徑)
**第十步:vi /usr/local/apache/conf/httpd.conf

Listen:IPV4
ServerName:主機名.域名

**
第十一步:
service httpd stop
service httpd start

主頁存放路徑爲:/usr/local/apache/htdocs/index.html

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章