问题是我的服务器必须安装,所以我试图让网站在www中运行。我已经复制了我的旧内容www但是当我尝试重新启动apache2时,我得到以下内容:
root@microsoft:/# service apache2 restart
Syntax error on line 1 of /etc/apache2/sites-enabled/microsoft.com:
Invalid command '../sites-available/microsoft.com', perhaps misspelled or defined by a module not included in the server configuration
Action 'configtest' failed.
等/ apache2的/启用的站点 - / microsoft.com 在文件内:../ sites-available / microsoft.com
的/ etc / apache2的/位点可用 在文件内:
<VirtualHost *:80>
ServerAdmin admin@microsoft.com
ServerName microsoft.com
ServerAlias www.microsoft.com
DocumentRoot /var/www/microsoft
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/microsoft>
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
</VirtualHost>
任何帮助都会很棒!
答案 0 :(得分:0)
请在<VirtualHost *:80>
</VirtualHost>
关闭</Directory>
<VirtualHost *:80>
ServerAdmin admin@microsoft.com
ServerName microsoft.com
ServerAlias www.microsoft.com
DocumentRoot /var/www/microsoft
<Directory "/var/www/microsoft">
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/microsoft>
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>
</VirtualHost>
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
答案 1 :(得分:0)
看起来你没有错误地对其进行符号链接,并且该文件的已启用网站的版本已损坏。
文件中的“etc / apache2 / sites-enabled / microsoft.com”: ../站点可用/ microsoft.com“
您正在显示站点可用文件的内容,但错误消息表明启用站点的文件的内容不是有效的httpd配置。
按照退出模式仔细阅读错误消息。
答案 2 :(得分:0)
尝试删除已启用网站的microsoft.com文件,将microsoft.com重命名为microsoft.com。 conf 在sites-available中。运行a2ensite并重启apache2服务。