===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"    //服務器文件根目錄

          #

          8、[test@wasu apache2]$ cd bin   
               [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 閱讀(301) 評論(0)  編輯  收藏 所屬分類: Work Experience

          <2011年6月>
          2930311234
          567891011
          12131415161718
          19202122232425
          262728293012
          3456789

          導航

          統計

          常用鏈接

          留言簿

          隨筆分類

          隨筆檔案

          搜索

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 理塘县| 武义县| 巴东县| 高邮市| 化德县| 买车| 镇康县| 江门市| 宝山区| 手游| 施甸县| 江津市| 高碑店市| 东乡族自治县| 博野县| 荣昌县| 敦化市| 革吉县| 凤城市| 永顺县| 山阳县| 尼勒克县| 泰兴市| 全椒县| 海丰县| 绥江县| 富平县| 武威市| 托里县| 武山县| 阿克陶县| 遵化市| 曲麻莱县| 马尔康县| 江安县| 上饶县| 隆化县| 荥经县| 东山县| 若羌县| 凭祥市|