linux下安裝apache

來源:互聯網
上載者:User

標籤:http   ar   sp   檔案   on   bs   ef   linux   tt   

1,apache 下載

  apache在 http://httpd.apache.org/ 下載,我用的版本是httpd-2.2.29.tar.gz

2,apache 解壓

  將檔案上傳到linux下 /opt 檔案中 執行命令 tar -xzvf httpd-2.2.29.tar.gz

  此時檔案中會出現 httpd-2.2.29檔案夾,這個就是解壓之後的apache檔案,如果不習慣檔案名稱可以用

  mv httpd-2.2.29 apache  命令,將檔案名稱改為 apache

3,apache 安裝

  cd apache 進入apache檔案夾

  設定安裝參數,命令如下

  ./configure --prefix=/opt/apache2 --enable-module=so prefix參數指明將apache安裝到 /opt/apache2目錄,並且配置apache支援dso方式

  make 編譯 

  make install 執行安裝命令

  有些系統會出現cannot find the library `.../srclib/apr-util/xml/expat/libexpat.la‘ or unhandled argument `.../srclib/apr-util/xml/expat/libexpat.la‘錯誤,可以在 ./configure 後面加上 --with-expat=builtin

  如果要清除原來的make檔案 可以用 make clean命令或者重新解壓

4,修改apache 資訊 在 conf/httpd.conf

  經常修改的資訊有連接埠號碼

  listen 80 改為其它

   DocumentRoot 改為其它

 

  完成

linux下安裝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.