如果使用apt-get的方式安裝apache,會發現apache的安裝目錄很亂,而且并不是按照默認的apache目錄結構組織的,這給后期的配置造成了很大麻煩!
在編譯安裝apache之前,需要確定您的系統是否已經安裝gcc編譯環境和Zlib,如果沒有安裝您可以通過以前幾步安裝:
1、安裝gcc:sudo apt-get build-dep gcc
2、安裝zlib:apt-get install zlib1g-dev
3、下載apache2.2.14: sudo wget http://labs.xiaonei.com/apache-mirror/httpd/httpd-2.2.14.tar.gz
4、解壓apache:sudo tar -zxvf httpd-2.2.14.tar.gz
5、進入解壓出來的apache目錄:
sudo ./configure --prefix=/usr/server/apache --with-mysql=/usr/share/mysql --enable-so --enable-track-vars --enable-rewrite --with-zlib --enable-mods-shared=all --enable-suexec --with-suexec-caller=daemon --with-suexec-docroot=/var/www/wwwsource
其中后面是三個參數:--enable-suexec --with-suexec-caller=daemon --with-suexec-docroot=/var/www/wwwsource是為安裝Extmail而準備的
6、sudo make
7、sudo make install
8、設置apache開機自啟動:
1)復制 /usr/server/apache/bin/apachectl到/etc/init.d
2)加載為服務
sudo update-rc.d apachectl defaults
9、在webmin里設置apache模塊,因為webmin中默認的設置是按照apt-get安裝apache的方式設置的,所以需要做適當的改動
1)增加虛擬服務器的文件:/usr/server/apache/conf/extra/httpd-vhosts.conf
2)Directory to create links in for new virtual servers 設為none
3)Apache服務器根目錄:/usr/server/apache
4)httpd執行文件路徑:/usr/server/apache/bin/httpd
5)命令apachectl的路徑:/usr/server/apache/bin/apachectl
6)啟動apache命令:/usr/server/apache/bin/apachectl start
7)停止apache命令:/usr/server/apache/bin/apachectl stop
8)Command to apply configuration設為:/usr/server/apache/bin/apachectl
9)httpd.conf的路徑:/usr/server/apache/conf/httpd.conf
10)srm.conf的路徑設為自動
11)access.conf的路徑設為自動
12)mime.types的路徑設為:/usr/server/apache/conf/mime.types
13)Environment file defining Apache variables 設為;None
posted on 2009-11-04 15:14
零全零美 閱讀(2171)
評論(1) 編輯 收藏 所屬分類:
ubuntu