0

如何设置不带 oa TLD 的子域?我在我的主要配置下有这个设置

<VirtualHost *:80>
    ServerName bbs.67.777.777.777 #fake bc my server can easily be hacked ATM :(
    DocumentRoot /var/www/phpBB
</VirtualHost>

当我转到 bbs.serveripaddress 时,我收到地址未找到错误。如果我把它放在我的主要配置上面它仍然不起作用但是整个站点指向 /var/www/phpBB 而不是 /var/www (嗯!?!)

主v主机是

<VirtualHost *:80>
    ServerAdmin webmaster@localhost

    DocumentRoot /var/www/
    <Directory />
        Options FollowSymLinks
        AllowOverride None
    </Directory>
    <Directory /var/www/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride None
        Order allow,deny
        allow from all
        # This directive allows us to have apache2's default start page
                # in /apache2-default/, but still have / go to the right place
                RedirectMatch ^/$ /apache2-default/
    </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 /var/log/apache2/error.log

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

    CustomLog /var/log/apache2/access.log combined
    ServerSignature On

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

</VirtualHost>

如果有帮助,我正在使用 apache2 的 debian 机器上。

4

2 回答 2

1

我认为服务器名称 (bbs.67.777.777.777 ) 不会带您到任何地方 - 除非您将它添加到主机文件中...您可以 ping 该地址好吗?

为什么不将您的网站设为默认值...如果您不需要默认值?

于 2008-11-25T07:39:23.403 回答
0

您不能拥有带有 IP 地址的子域。解决此问题的最佳方法是让域或免费子域(例如 no-ip)指向您的 IP 地址并为此创建一个 ServerName。请记住将域添加到您的服务器 DNS 区域。

或在您的主机文件中创建一个域并使用它。

于 2008-12-03T18:45:11.997 回答