Linux環境的AMP安裝--APACHE安裝

2、APACHE的安裝

1)當然還是下載源碼包,如:httpd-2.0.55.tar.gz,地址自己找……
2)解壓縮,>tar -zxvf httpd-2.0.55.tar.gz
3)進入解壓後的httpd-2.0.55,>cd httpd-2.0.55
4)安裝配置,>./configure --prefix=/opt/apache --enable-cgi
5)編譯,>make
6)安裝,>make install
7)啓動,>/opt/apache/bin/apachectl start (restart 重啓,stop停止)
現在打開瀏覽器,輸入http://localhost,即可看到apache的歡迎界面。

注:
1)apache配置文件的修改,路徑:/opt/apache/conf/httpd.conf,修改完配置文件記得重啓apache
*修改默認首頁:DirectoryIndex index.html index.html,改爲:DirectoryIndex index.html index.html index.php
*添加執行PHP文件:AddType application/x-httpd-php .php
*修改默認編碼:AddDefaultCharset utf-8
2)apache建立虛擬機
NameVirtualHost *:80

<VirtualHost *:80>
ServerName test.test.com
DocumentRoot /opt/htdocs/test
</VirtualHost>

發佈了64 篇原創文章 · 獲贊 2 · 訪問量 30萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章