在Ubuntu上启动Apache2失败

时间:2012-02-16 21:00:49

标签: apache2

我使用了OSQA的Ubuntu和MYSQL安装指南。在我到达最后一步,即启动Apache2服务器之前,这很简单。我仔细检查,看看我是否错过了之前的任何步骤,我碰巧错过了一个。它是sudo ln -s / etc / apache2 / sites-available / osqa / etc / apache2 / sites-enabled / osqa命令。所以我从我的根目录运行此命令。运行上面的命令后,我再次尝试启动Apache2服务器。它仍然无法正常工作。然后我运行了这些命令:

sudo chmod -R g+w /home/osqa/osqa-server/forum/upfiles
sudo chmod -R g+w /home/osqa/osqa-server/log

这些对这个问题没有帮助。我启动或重启服务器时遇到的错误是:

osqa@osqa-Latitude-E4300:/$ sudo /etc/init.d/apache2 restart
[sudo] password for osqa: 
Sorry, try again.
[sudo] password for osqa: 
apache2: Syntax error on line 230 of /etc/apache2/apache2.conf: Syntax error on line 7 of /etc/apache2/sites-enabled/osqa: /etc/apache2/sites-enabled/osqa:7: <VirtualHost> was not closed.
Action 'configtest' failed.
The Apache error log may have more information.
   ...fail!

我关注的安装指南是:http://wiki.osqa.net/display/docs/Ubuntu+with+Apache+and+MySQL

任何帮助都将受到极大的赞赏!

4 个答案:

答案 0 :(得分:5)

服务器的配置文件有错误。使用文本编辑器打开/etc/apache2/apache2.conf并添加VirtualHost结束标记:</VirtualHost>

答案 1 :(得分:1)

结束virtualhost标记:

</VirtualHost> (它位于 7 行之后)

答案 2 :(得分:0)

这取决于您是否运行了多个虚拟主机,必须在启动另一个虚拟主机之前关闭每个虚拟主机

<VirtualHost 10.1.2.3:80>
    ServerAdmin webmaster@host.example.com
    DocumentRoot /www/docs/host.example.com
    ServerName host.example.com
    ErrorLog logs/host.example.com-error_log
    TransferLog logs/host.example.com-access_log
</VirtualHost> 

答案 3 :(得分:0)

我的问题是我有一些ssl证书错了。确保您的证书和私钥有效且匹配!