CentOS Apache安裝設(shè)置編譯器及編譯參數(shù)
CentOS Apache安裝還是比較常用的,于是我研究了一下CentOS Apache安裝,在這里拿出來和大家分享一下,希望對(duì)大家有用。CentOS是一個(gè)開源軟件貢獻(xiàn)者和用戶的社區(qū)。下面介紹CentOS Apache安裝。
1、下載:apache2.2.4
[root@localhost ~]# cd /usr/local/src/
[root@localhost src]# wget
http://archive.apache.org/dist/httpd/httpd-2.2.4.tar.gz
[root@localhost src]# chmod +x httpd-2.2.4.tar.gz
[root@localhost src]# tar -zxvf httpd-2.2.4.tar.gz
2、CentOS Apache安裝設(shè)置編譯器的編譯參數(shù)
[root@localhost src]# cd httpd-2.2.4
[root@localhost httpd-2.2.4]# ./configure --prefix=/usr/local/apache2 --enable-so --enable-rewrite=share --enable-proxy=share --enable-proxy-ajp=share --enable-dav=share --enable-dav-fs
#注解:
--prefix=/usr/local/apache2
設(shè)置CentOS Apache安裝目錄。這里設(shè)定安裝在/usr/local/apache2下,今后如果要卸載或者升級(jí)CentOS Apache時(shí),直接刪除這個(gè)目錄即可。
--enable-so
指定允許DSO(動(dòng)態(tài)共享對(duì)像)
--enable-rewrite=share
開啟Rewrite支持,以實(shí)現(xiàn)URL靜態(tài)化,建議開啟。
--enable-dav-fs
開啟WebDAV支持,svn服務(wù)器等需要。附:《什么是webDAV?及如何應(yīng)用?
其它的額外設(shè)置請(qǐng)使用./configure --help來查看。
3、CentOS Apache安裝和編譯:
[root@localhost httpd-2.2.4]# make; make install
#如果沒有錯(cuò)誤的話,那么Apache就已經(jīng)安裝在/usr/local/apache2目錄中了
4、啟動(dòng)服務(wù):
[root@localhost httpd-2.2.4]# /usr/local/apache2/bin/apachectl start
5、確定啟動(dòng)狀:
[root@localhost apache2]# netstat -utl
#看到上面這行就表示你的CentOS Apache已經(jīng)啟動(dòng)。
#用瀏覽器訪問,看到It works!,說明CentOS Apache安裝成功了,恭喜您!
【編輯推薦】