从同一个Ubuntu服务器托管两个网站

时间:2017-11-30 16:35:07

标签: ubuntu apache2 ubuntu-server

我已经建立了一个完美的网站。现在我想在同一台服务器上设置另一个,但它会出错无法找到名为&#34的服务器; ct-ttm.xceedance.com" ---服务器没有DNS条目。也许服务器名称中存在拼写错误,或者服务器不再存在。仔细检查名称,然后重试

这是我的虚拟主机配置文件:

<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    ServerName ct-ttm.xceedance.com
        ServerAlias www.ct-ttm.xceedance.com
    DocumentRoot /var/www/ct-ttm/public_html
    <Directory />
        Options FollowSymLinks
        AllowOverride None
    </Directory>
    <Directory /var/www/ct-ttm/public_html>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride None
        Order allow,deny
        allow from all
    </Directory>

    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
    <Directory "/usr/lib/cgi-bin">
        AllowOverride None
        Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
        Order allow,deny
        Allow from all
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/error.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn

    CustomLog ${APACHE_LOG_DIR}/access.log combined

    Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 192.168.0.0/255.255.255.0 ::1/128
    </Directory>

</VirtualHost>

旧网站工作正常,我已经类似地配置了上述代码。但是上面的一个不起作用,而下面的一个是:

<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    ServerName ttm.xceedance.com
        ServerAlias www.ttm.xceedance.com
    DocumentRoot /var/www/ttm.com/public_html
    <Directory />
        Options FollowSymLinks
        AllowOverride None
    </Directory>
    <Directory /var/www/ttm.com/public_html>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride None
        Order allow,deny
        allow from all
    </Directory>

    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
    <Directory "/usr/lib/cgi-bin">
        AllowOverride None
        Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
        Order allow,deny
        Allow from all
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/error.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn

    CustomLog ${APACHE_LOG_DIR}/access.log combined

    Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 192.168.0.0/255.255.255.0 ::1/128
    </Directory>

</VirtualHost>

0 个答案:

没有答案
相关问题