===Linux下apache2的安裝和配置===
Linux下apache2的安裝和配置1、下載安裝包(如httpd-2.2.0.tar.gz)并拷貝到服務器上
2、[test@wasu apache2]$ tar -xzvf httpd-2.2.0.tar.gz //解壓安裝包
3、[test@wasu apache2]$ cd httpd-2.2.0 //進入解壓出的文件目錄中
4、[test@wasu httpd-2.2.0]$ ./configure --prefix=/home/test/apache2 --enable-so --enable-rewrite --enable-expire //指定安裝目錄和配置項
5、[test@wasu httpd-2.2.0]$ make //編譯
6、[test@wasu httpd-2.2.0]$ make install //安裝
7、[test@wasu conf]$ pwd
/home/test/apache2/conf
[test@wasu conf]$ vi httpd.conf
//進入安裝目錄的conf下編輯httpd.conf文件進行apache服務器的IP和Prot的設置,相關內容如下:
#
ServerRoot "/home/test/apache2" //apache服務器根目錄
#
#
#Listen 12.34.56.78:80
Listen 1080 //監聽端口
#
# Dynamic Shared Object (DSO) Support
#
ServerName 218.108.0.82:1080 //服務器IP和Port
#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "/home/test/apache2/htdocs" //服務器文件根目錄
#
[test@wasu bin]$ ./apachectl start //啟動服務
9、[test@wasu bin]$ ps -ef|grep httpd
test 5199 1 0 15:48 ? 00:00:00 /home/test/apache2/bin/httpd -k start
test 5200 5199 0 15:48 ? 00:00:00 /home/test/apache2/bin/httpd -k start
test 5201 5199 0 15:48 ? 00:00:00 /home/test/apache2/bin/httpd -k start
test 5202 5199 0 15:48 ? 00:00:00 /home/test/apache2/bin/httpd -k start
test 5203 5199 0 15:48 ? 00:00:00 /home/test/apache2/bin/httpd -k start
test 5204 5199 0 15:48 ? 00:00:00 /home/test/apache2/bin/httpd -k start
test 5207 5199 0 15:49 ? 00:00:00 /home/test/apache2/bin/httpd -k start
test 15258 5154 0 16:15 pts/1 00:00:00 grep httpd
[test@wasu bin]$ netstat -lnp|grep 1080
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
tcp 0 0 :::1080 :::* LISTEN 5199/httpd
posted on 2011-06-16 16:25 XuFeng 閱讀(302) 評論(0) 編輯 收藏 所屬分類: Work Experience