2016-07-23 16 views
0

Ich bin von Fedora zu Ubuntu 16.04 gewechselt.wie man mehrere vhost in einer Datei einrichtet

in Fedora konnte ich endlose vhost in einer Datei auflisten. wo wie in ubuntu muss ich eine neue Datei für jeden vhost erstellen. Ich habe bereits meine Liste mit allen Vhosts drin. gibt es einen Weg dies in Ubuntu zu tun?

# 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 [email protected] 
    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 [email protected] 
    DocumentRoot /var/www/html/plumbing_sites/crouchendplumber.co.uk/public_html 
    ServerName www.crouchendplumber.co.uk 
    ServerAlias crouchendplumber.co.uk 
</VirtualHost> 

Antwort

1

Das ist nur Ubuntus Abkürzung Organisation für Apache. Es wird genauso funktionieren. Sie können diese eine lange Datei mit mehreren VHosts in Ihrem Ordner sites_available unter speichern und dann alle auf einmal aktivieren.

Obwohl dies zunächst praktisch ist, werden Sie auf lange Sicht besser dran sein, wenn Sie sich die Zeit nehmen, sie auseinander zu brechen.

+0

Ich habe versucht, ich bekomme diese Nachricht Job für Apache2.Service gescheitert, weil der Steuerungsprozess mit Fehlercode beendet. Siehe "systemctl status apache2.service" und "journalctl -xe" für Details. – alwayslearning

+0

Und was ist der spezifische Fehler von diesen Details? –