净哥哥
2014-11-15 15:29
<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
系统版本不一样配置文件有一些区别。不过精髓是一样的。关于不同版本的配置文件区别网上有很多文章提到。
a2ensites 下会自动生成软连接
在Ubuntu14.04里,需要修改一下/etc/apache2下的apache2.conf就行,一共两处需要修改:
(1)添加<Directory ></Directory>标签
(2)将最下面一行的# IncludeOptional sites-enabled/下面改成:
IncludeOptional sites-enabled/
ubuntu 14.04 LTS + apache 2.4.7 遇到同样的问题 测试发现在sites-enabled目录中创建软链接时,链接名称要跟sites-available中的文件名相同才能生效哦
解决访问到系统中的问题:查看apache2.conf可以看出include的是从sites-enabled目录下*.conf文件,所以设置软连接时不能设置为video,而应该是video.conf,之后重启就行了。
然后可能会遇到forbidden的错误,属于权限相关:
<Directory /wwwroot/video/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
具体结合这个:Ubuntu配置apache2.4配置虚拟主机遇到的问题
同楼主,有解决的方法么?
在Ubuntu Server下搭建LAMP环境
41158 学习 · 391 问题
相似问题