centos6安裝apache2.2

來源:互聯網
上載者:User

標籤:iptables   目錄   nbsp   table   eterm   ati   sts   檔案中   prefix   

1. 從https://mirrors.tuna.tsinghua.edu.cn/apache/httpd下載httpd包 執行命令 wget https://mirrors.tuna.tsinghua.edu.cn/apache/httpd/httpd-2.2.32.tar.gz 

  

2. 解壓到本地  3. 進入到 httpd-2.2.32目錄 執行./configure --prefix=/usr/local/apache2 --sysconfdir=/usr/local/etc/httpd  4. 執行 make 命令5. 執行make install 命令,安裝完成6. 進入到apache安裝路徑 /usr/local/apache2/bin ,執行啟動指令碼./apachectl start  注意事項:1. 啟動之前檢查80連接埠是否開啟  netstat -tan  

2. 檢查防火牆配置是否開啟80連接埠

  

  重啟防火牆

  service iptables restart

3. 如果啟動中報錯 :

  httpd: apr_sockaddr_info_get() failed for captian2(主機名稱)

  httpd: Could not reliably determine the server‘s fully qualified domain name, using 127.0.0.1 for ServerName

  方法 (1):

  設定 /usr/local/etc/http2/httpd.conf 中的ServerName 為 ServerName localhost:80

  

  

  方法(2) 

  在 /etc/hosts 檔案中添加自己的主機名稱,如 127.0.0.1 captain2 

啟動之後,可以在瀏覽器中輸入主機ip地址,即可訪問apache頁面

  

 

 

centos6安裝apache2.2

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.