apache 配置问题(ubuntu server 版的系统)急急急

「已注销」 2014-11-29 07:58:58
我想弄2个web应用一个名字discuz。另个一个smoektest。
通过如下地址能够访问到:
1.http://10.38.32.174/discuz/
2.http://10.38.32.174/smoketest/

我新建了2个 .conf 文件 在目录/etc/apache2/sites-available下:
ls sites-available/
000-default.conf default-ssl.conf discuz.conf smoketest.conf
这个两个的配置文件如下: 但是好像只有discuz这个可以访问,smoketest访问不到。
我的目的就是 想不同website用不同的配置文件。这些配置文件都会在sites-enable目录下建立连接的。例如apache 默认的那个default文件就是这样的。我的两个配置文件都是复制的default文件的,然后在其上做些修改的。


root@mamh:/etc/apache2# cat sites-available/discuz.conf
<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.discuz.com
ServerAdmin webmaster@localhost

DocumentRoot /srv/www/htdocs/
<Directory "/srv/www/htdocs/discuz">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Allow from all
Require all granted
</Directory>

# 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}/discuz.error.log
CustomLog ${APACHE_LOG_DIR}/discuz.access.log combined

# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
</VirtualHost>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
root@mamh:/etc/apache2#

root@mamh:/etc/apache2# cat sites-available/smoketest.conf
<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.smoketest.com
ServerAdmin webmaster@localhost

DocumentRoot /srv/www/htdocs/
<Directory "/srv/www/htdocs/smoketest">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Allow from all
Require all granted
</Directory>

# 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}/smoketest.error.log
CustomLog ${APACHE_LOG_DIR}/smoketest.access.log combined

# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
</VirtualHost>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
root@mamh:/etc/apache2#
...全文
261 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

24,923

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 Apache
社区管理员
  • Apache
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧