久久国产成人av_抖音国产毛片_a片网站免费观看_A片无码播放手机在线观看,色五月在线观看,亚洲精品m在线观看,女人自慰的免费网址,悠悠在线观看精品视频,一级日本片免费的,亚洲精品久,国产精品成人久久久久久久

分享

在Ubuntu 14.04 LTS系統(tǒng)中設(shè)置Apache虛擬主機(jī) 第2頁

 昵稱27716608 2015-09-18

5. 創(chuàng)建虛擬主機(jī)配置文件

默認(rèn)情況下,apache有一個(gè)默認(rèn)的虛擬主機(jī)文件叫000-default.conf,。我們將會(huì)復(fù)制000-default.conf文件內(nèi)容到我們新的虛擬主機(jī)配置文件中。

  1. sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/unixmen1.local.conf
  2. sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/unixmen2.local.conf

確保虛擬主機(jī)配置文件末尾包含.conf擴(kuò)展名。

現(xiàn)在,,修改unximen1.local.conf文件以符合需求。

  1. sudo vi /etc/apache2/sites-available/unixmen1.local.conf

使相關(guān)的變化直接呈現(xiàn)在unixmen1站點(diǎn)中(譯注:以“#”開頭的注釋行可以忽略,。),。

  1. <VirtualHost *:80>
  2. # The ServerName directive sets the request scheme, hostname and port that
  3. # the server uses to identify itself. This is used when creating
  4. # redirection URLs. In the context of virtual hosts, the ServerName
  5. # specifies what hostname must appear in the request's Host: header to
  6. # match this virtual host. For the default virtual host (this file) this
  7. # value is not decisive as it is used as a last resort host regardless.
  8. # However, you must set it for any further virtual host explicitly.
  9. #ServerName www.example.com
  10. ServerAdmin [email protected]
  11. ServerName unixmen1.local
  12. ServerAlias www.unixmen1.local
  13. DocumentRoot /var/www/unixmen1.local/public_html
  14. # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
  15. # error, crit, alert, emerg.
  16. # It is also possible to configure the loglevel for particular
  17. # modules, e.g.
  18. #LogLevel info ssl:warn
  19. ErrorLog ${APACHE_LOG_DIR}/error.log
  20. CustomLog ${APACHE_LOG_DIR}/access.log combined
  21. # For most configuration files from conf-available/, which are
  22. # enabled or disabled at a global level, it is possible to
  23. # include a line for only one particular virtual host. For example the
  24. # following line enables the CGI configuration for this host only
  25. # after it has been globally disabled with "a2disconf".
  26. #Include conf-available/serve-cgi-bin.conf
  27. </VirtualHost>

同理,修改第二臺(tái)主機(jī)文件,。

  1. sudo vi /etc/apache2/sites-available/unixmen2.local.conf

使相關(guān)的修改在unixmen2 站點(diǎn)呈現(xiàn)出來,。

  1. <VirtualHost *:80>
  2. # The ServerName directive sets the request scheme, hostname and port that
  3. # the server uses to identify itself. This is used when creating
  4. # redirection URLs. In the context of virtual hosts, the ServerName
  5. # specifies what hostname must appear in the request's Host: header to
  6. # match this virtual host. For the default virtual host (this file) this
  7. # value is not decisive as it is used as a last resort host regardless.
  8. # However, you must set it for any further virtual host explicitly.
  9. #ServerName www.example.com
  10. ServerAdmin [email protected]
  11. ServerName unixmen2.local
  12. ServerAlias www.unixmen2.local
  13. DocumentRoot /var/www/unixmen2.local/public_html
  14. # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
  15. # error, crit, alert, emerg.
  16. # It is also possible to configure the loglevel for particular
  17. # modules, e.g.
  18. #LogLevel info ssl:warn
  19. ErrorLog ${APACHE_LOG_DIR}/error.log
  20. CustomLog ${APACHE_LOG_DIR}/access.log combined
  21. # For most configuration files from conf-available/, which are
  22. # enabled or disabled at a global level, it is possible to
  23. # include a line for only one particular virtual host. For example the
  24. # following line enables the CGI configuration for this host only
  25. # after it has been globally disabled with "a2disconf".
  26. #Include conf-available/serve-cgi-bin.conf
  27. </VirtualHost>

修改虛擬主機(jī)文件后,禁用默認(rèn)的虛擬主機(jī)配置(000.default.conf),,然后啟用新的虛擬主機(jī)配置,,如下所示。

  1. sudo a2dissite 000-default.conf
  2. sudo a2ensite unixmen1.local.conf
  3. sudo a2ensite unixmen2.local.conf

最后,,重啟apache服務(wù)器,。

  1. sudo service apache2 restart

就是這樣。現(xiàn)在,,我們成功地配置了apach虛擬主機(jī)在我們的Ubuntu服務(wù)器上

測(cè)試虛擬主機(jī)

編輯/etc/hosts文件,,

  1. sudo vi /etc/hosts

在文件末尾添加如下所示的虛擬域名。

  1. 192.168.1.250 unixmen1.local
  2. 192.168.1.250 unixmen2.local

保存并關(guān)閉文件,。

打開你的瀏覽器并訪問http://unixmen1.localhttp://unixmen2.local,。你將會(huì)看到我們之前創(chuàng)建的示例頁,。

Unixmen1.local 測(cè)試頁:

Unixmen2.local 測(cè)試頁

如果你想從你的遠(yuǎn)程系統(tǒng)訪問這些站點(diǎn),你需要在你的DNS服務(wù)器添加實(shí)際域名記錄,。不過,,我沒有真實(shí)的域名和DNS服務(wù)器,我只想通過我的本地系統(tǒng)測(cè)試,,那么它剛好如我所愿地工作,。

Cheers!

更多Ubuntu相關(guān)信息見Ubuntu 專題頁面 http://www./topicnews.aspx?tid=2

本文永久更新鏈接地址http://www./Linux/2014-06/102871.htm

linux

    本站是提供個(gè)人知識(shí)管理的網(wǎng)絡(luò)存儲(chǔ)空間,,所有內(nèi)容均由用戶發(fā)布,,不代表本站觀點(diǎn)。請(qǐng)注意甄別內(nèi)容中的聯(lián)系方式,、誘導(dǎo)購買等信息,謹(jǐn)防詐騙,。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,,請(qǐng)點(diǎn)擊一鍵舉報(bào)。
    轉(zhuǎn)藏 分享 獻(xiàn)花(0

    0條評(píng)論

    發(fā)表

    請(qǐng)遵守用戶 評(píng)論公約

    類似文章 更多