虚拟主机在Zend框架中不起作用 [英] Virtual host not working in zend framework

查看:102
本文介绍了虚拟主机在Zend框架中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下是我在/etc/apache2/sites-available中的虚拟主机:

Following is my virtual host in /etc/apache2/sites-available:

<VirtualHost *:80>

DocumentRoot "/var/www/roomstays/public"

ServerName roomstays

#This should be omitted in the production environment
SetEnv APPLICATION_ENV development

<Directory "/var/www/roomstays/public">
Options Indexes MultiViews FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>

</VirtualHost>

还在/etc/apache2/sites-enabled文件夹中启用了

Also it enabled on /etc/apache2/sites-enabled folder

以下是我的主机文件:

127.0.0.1   localhost
127.0.0.1   roomstays

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

我在var/www/roomstays中配置了我的网站.但是当我在其上输入roomtays时,未打开网站并显示此消息:

I configured my site in var/www/roomstays. But when I entered roomstays on it not opening the site and showing this message :

有效!

这是此服务器的默认网页.

This is the default web page for this server.

Web服务器软件正在运行,但尚未添加任何内容.

The web server software is running but no content has been added, yet.

虚拟主机出了什么问题.

What's wrong with virtual host.

推荐答案

要检查的三件事:

1.网站已启用

确保您的虚拟主机文件已在/etc/apache2/sites- 已启用中.

Make sure your virtual host file is in /etc/apache2/sites-enabled.

2.名称VirtualHost

请确保您在apache配置中的某处有此

Make sure you have this somewhere in the apache config:

NameVirtualHost *:80

我在/etc/apache2/ports.conf中拥有它(不记得那是否是Ubuntu上的标准)

I have it in /etc/apache2/ports.conf (can't remember if thats the standard on Ubuntu)

3.删除默认的虚拟主机

如果上述方法均无效,则可以将虚拟主机重命名为/etc/apache2/sites-enabled/000000-myhost.这将确保首先加载您的虚拟主机文件.或者删除/etc/apache2/sites-enabled/000-default

If none of the above works, you can rename your virtual host to something like /etc/apache2/sites-enabled/000000-myhost. This will ensure your virtual host file is loaded first. Alternatively remove /etc/apache2/sites-enabled/000-default

记住每次更改后都要重新启动apache ...

Remember to restart apache after each change...

这篇关于虚拟主机在Zend框架中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆