我试图添加一个新的域到我的服务器运行debian和apache2。 我应该如何去添加域? 通过网站启用/可用? 如果是的话,我该怎么做
谢谢
在Debian虚拟主机默认情况下是启用的,所以在你configuration好你的dns之后,你可以在/ etc / apache2 / sites-下载一个名为你喜欢的文件(例如site.example.org)
# This tell apache to enable this vhost for all ports <VirtualHost *> # These two are the only mandatory params for a vhost ServerName your.dns.name # dns name for this vhost DocumentRoot /your/document/root # document root for this vhost # Optional, allow override in .htaccess files <Directory /your/document/root> Options FollowSymLinks AllowOverride All </Directory> # optional, log accesses and errors to a different file ErrorLog /var/log/apache2/your-name-error.log CustomLog /var/log/apache2/your-name-access.log combined </VirtualHost>
然后以root身份运行命令a2ensite site.example.org (文件名),并按照前面的命令build议的方式使用/etc/init.d/apache2 reload加载apache。 而已。
如果出现问题,请使用apache2ctl -t检查语法,使用apache2ctl -s进行虚拟主机configuration。