手工編譯安裝Apache

來源:互聯網
上載者:User

標籤:檔案   red   gcc   follow   htm   2.4   應用   ofo   apr   

軟體包連結: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庫,支援Regex)

第五步: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

手工編譯安裝Apache

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.