虚拟主机破坏了Apache

对人好点

在Win 8 64上运行XAMP。新计算机。

已经运行XAMPP数周,并且在htdocs之外的子目录中进行工作,而没有任何实际问题。

下载了当前可运行的网站并使其正常运行(文档根地址等),因此希望创建一个简单的虚拟主机设置。我之前做过一次非常清楚,简单的说明,没有任何问题。这次发现了太多冲突的内容,并且在编辑httpd.conf之后我无法重新启动Apache。

我收到错误消息:

1:49:55 PM  [Apache]    Error: Apache shutdown unexpectedly.
1:49:55 PM  [Apache]    This may be due to a blocked port, missing dependencies,
1:49:55 PM  [Apache]    improper privileges, a crash, or a shutdown by another method.
1:49:55 PM  [Apache]    Press the Logs button to view error logs and check
1:49:55 PM  [Apache]    the Windows Event Viewer for more clues
1:49:55 PM  [Apache]    If you need more help, copy and post this
1:49:55 PM  [Apache]    entire log window on the forums

我在驱动程序中对etc进行了编辑,以:

127.0.0.1       ot48
127.0.0.1       sanetext
127.0.0.1       saneText22
127.0.0.1       alohaenergy
127.0.0.1       unify
127.0.0.1       myexample
127.0.0.1       test  etc etc (10 directories)

读取Apache信息和其他地方后,对httpd.conf进行了编辑以添加以下内容:

Listen 80
NameVirtualHost 127.0.0.1:80

<VirtualHost 127.0.0.1:80>
DocumentRoot c:/xampp/htdocs/ot48
ServerName ot48.loc
</VirtualHost>

<VirtualHost 127.0.0.1:80>
DocumentRoot c:/xampp/htdocs/sanetext
ServerName sanetext.loc
</VirtualHost>

<VirtualHost 127.0.0.1:80>
DocumentRoot c:/xampp/htdocs/saneText22
ServerName saneText22.loc
</VirtualHost>

<VirtualHost 127.0.0.1:80>
DocumentRoot c:/xampp/htdocs/alohaenergy
ServerName alohaenergy.loc
</VirtualHost>

感谢任何建议

编辑应该说,如果我删除了httpd.conf中的编辑内容,Apache启动就不会出现问题

克劳

您真的不想为此使用回送地址。使用内部或外部真实地址(或不使用,我将告诉您)。

尝试以下Apache配置设置:

Listen 80
NameVirtualHost *:80

<VirtualHost *:80>
  ServerName ot48.loc
  ServerAlias ot48.loc *.ot48.loc
  DocumentRoot c:/xampp/htdocs/ot48
</VirtualHost>

..etc..

同样,您可以通过将所有内容放在一行上来简化您的主机文件,如下所示:

192.168.0.1   ot48.loc sanetext.loc saneText22.loc alohaenergy.loc unify.loc myexample.loc

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章