【发布时间】:2016-11-27 08:14:38
【问题描述】:
我从 Fedora 迁移到 ubuntu 16.04。
在 Fedora 中,我可以在一个文件中列出无尽的虚拟主机。在 ubuntu 中,我必须为每个虚拟主机创建一个新文件。我已经有了包含所有虚拟主机的列表。有没有办法在 ubuntu 中做到这一点?
# Virtual Hosts
#
# Required modules: mod_log_config
# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs/2.4/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.
#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#
<VirtualHost *:80>
ServerAdmin admin@apecenergy
DocumentRoot /var/www/html/apecenergy.co.uk/public_html
ServerName www.apecenergy.co.uk
ServerAlias apecenergy.co.uk
ErrorLog "/var/log/httpd/apecenergy-error_log"
CustomLog "/var/log/httpd/apecenergy-access_log" common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin admin@apecenergy
DocumentRoot /var/www/html/plumbing_sites/crouchendplumber.co.uk/public_html
ServerName www.crouchendplumber.co.uk
ServerAlias crouchendplumber.co.uk
</VirtualHost>
【问题讨论】:
标签: apache ubuntu virtualhost