题
我要如何设置子W / O顶级域名?我有这个组下我的主配置
<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>
我在Debian框使用的apache2是否有帮助。
解决方案 2
您不能拥有一个IP地址的子域。解决这个问题的最好的办法是有一个域或免费子域名(如无IP)来点你的IP地址,并创建一个服务器名。记住域名添加到您的服务器的DNS区域。
或做出域主机文件,并使用它。
其他提示
我不认为服务器名称(bbs.67.777.777.777)将让你在任何地方 - 除非你把它添加到您的主机文件......你能ping该地址确定
为什么不只是让你的网站的默认...如果你不需要一个默认的?
不隶属于 StackOverflow