zhyiwww
          用平實的筆,記錄編程路上的點點滴滴………
          posts - 536,comments - 394,trackbacks - 0
          Linux(Ubuntu)
          默認(rèn)情況下,linux上apache使用的
          默認(rèn)文檔目錄是:/var/www
          默認(rèn)端口是:80

          如果想發(fā)布自己的一個系統(tǒng)資源目錄,可以使用下面的方法,執(zhí)行如下命令:

          (1)添加監(jiān)聽端口
          #cd /etc/apache2
          #vim ports.conf
          文件添加:
          NameVirtualHost *:8000
          Listen 8000

          (2)配置虛擬目錄
          #cd /etc/apache2/sites-available
          #cp default default-me
          #vim default-me
          文件內(nèi)容如下:

          <VirtualHost *:8000>
              ServerAdmin webmaster@localhost

              DocumentRoot /wwwroot
              <Directory />
                  Options FollowSymLinks
                  AllowOverride None
              </Directory>
              <Directory /wwwroot/>
                  Options Indexes FollowSymLinks MultiViews
                  AllowOverride None
                  Order allow,deny
                  allow from all
              </Directory>


              ErrorLog /var/log/apache2/error.log

              # Possible values include: debug, info, notice, warn, error, crit,
              # alert, emerg.
              LogLevel warn

              CustomLog /var/log/apache2/access.log combined

          </VirtualHost>
          粗體部分是關(guān)鍵點。

          (3)發(fā)布站點

          # ln -s /etc/apache2/sites-available/default-me /etc/apache2/sites-enabled/001-default

          (4)重啟服務(wù)

          #/etc/init.d/apache2 restart

          (5)測試
          http://localhost:8000/
          如果能夠正常訪問就說明配置正確了。






          |----------------------------------------------------------------------------------------|
                                     版權(quán)聲明  版權(quán)所有 @zhyiwww
                      引用請注明來源 http://www.aygfsteel.com/zhyiwww   
          |----------------------------------------------------------------------------------------|
          posted on 2010-05-24 16:50 zhyiwww 閱讀(3081) 評論(0)  編輯  收藏 所屬分類: j2eelinux
          主站蜘蛛池模板: 阜新| 天门市| 余姚市| 安多县| 余干县| 谢通门县| 永德县| 乌鲁木齐市| 玉门市| 刚察县| 天峻县| 綦江县| 西乌珠穆沁旗| 通渭县| 彭州市| 游戏| 师宗县| 阿拉善左旗| 吴桥县| 东平县| 石家庄市| 余江县| 玛沁县| 宁晋县| 景德镇市| 曲水县| 凌源市| 龙南县| 赤壁市| 云梦县| 河源市| 镇坪县| 宽城| 九龙坡区| 荣昌县| 九江市| 嘉祥县| 临江市| 北票市| 安顺市| 当阳市|