我的是這樣的。跟老師講的不一樣。就是沒(méi)法正常訪問(wèn)。訪問(wèn)到系統(tǒng)默認(rèn)的去了。
<virtualHost *:80>
? ? ? ? # The ServerName directive sets the request scheme, hostname and port that
? ? ? ? # the server uses to identify itself. This is used when creating
? ? ? ? # redirection URLs. In the context of virtual hosts, the ServerName
? ? ? ? # specifies what hostname must appear in the request's Host: header to
? ? ? ? # match this virtual host. For the default virtual host (this file) this
? ? ? ? # value is not decisive as it is used as a last resort host regardless.
? ? ? ? # However, you must set it for any further virtual host explicitly.
? ? ? ? #ServerName www.example.com
? ? ? ? ServerName www.bbs.net
? ? ? ? ServerAdmin webmaster@localhost
? ? ? ? DocumentRoot /wwwroot/bbs
? ? ? ? # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
? ? ? ? # error, crit, alert, emerg.
? ? ? ? # It is also possible to configure the loglevel for particular
? ? ? ? # modules, e.g.
? ? ? ? #LogLevel info ssl:warn
? ? ? ? ErrorLog ${APACHE_LOG_DIR}/error.log
? ? ? ? CustomLog ${APACHE_LOG_DIR}/access.log combined
? ? ? ? # For most configuration files from conf-available/, which are
2014-11-16
系統(tǒng)版本不一樣配置文件有一些區(qū)別。不過(guò)精髓是一樣的。關(guān)于不同版本的配置文件區(qū)別網(wǎng)上有很多文章提到。
2017-02-13
a2ensites 下會(huì)自動(dòng)生成軟連接
2015-04-05
在Ubuntu14.04里,需要修改一下/etc/apache2下的apache2.conf就行,一共兩處需要修改:
(1)添加<Directory ></Directory>標(biāo)簽
(2)將最下面一行的# IncludeOptional sites-enabled/下面改成:
????????IncludeOptional sites-enabled/
2015-03-02
ubuntu 14.04 LTS + apache 2.4.7 遇到同樣的問(wèn)題 測(cè)試發(fā)現(xiàn)在sites-enabled目錄中創(chuàng)建軟鏈接時(shí),鏈接名稱(chēng)要跟sites-available中的文件名相同才能生效哦?
2015-01-25
解決訪問(wèn)到系統(tǒng)中的問(wèn)題:查看apache2.conf可以看出include的是從sites-enabled目錄下*.conf文件,所以設(shè)置軟連接時(shí)不能設(shè)置為video,而應(yīng)該是video.conf,之后重啟就行了。
然后可能會(huì)遇到forbidden的錯(cuò)誤,屬于權(quán)限相關(guān):
<Directory?/wwwroot/video/>
????????????????Options?Indexes?FollowSymLinks?MultiViews
????????????????AllowOverride?All
????????????????Require?all?granted
????????</Directory>
具體結(jié)合這個(gè):Ubuntu配置apache2.4配置虛擬主機(jī)遇到的問(wèn)題
2015-01-25
同樓主,有解決的方法么?