简体   繁体   English

虚拟主机不工作

[英]Virtual host not working

I have the virtual host setup in my /etc/apache2/sites-available and the file name is roomstaysback. 我在/ etc / apache2 / sites-available中有虚拟主机设置,文件名是roomstaysback。

<VirtualHost *:80>    
DocumentRoot "/var/www/roomstaysback/public"    
ServerName roomstaysback

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

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

My /etc/hosts file contain the following: 我的/ etc / hosts文件包含以下内容:

127.0.0.1   roomstaysback

# 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

The sites-enabled also contain the roomstaysback and it enabled properly. 启用的站点还包含roomstaysback并正确启用。 My code is in /var/www/roomstaysback/public and it also contain the .htaccess file with proper mod rewrite rule. 我的代码在/ var / www / roomstaysback / public中,它还包含带有正确mod重写规则的.htaccess文件。

But when I trying to open roomstaysback in browser it shows nothing (blank page). 但是当我试图在浏览器中打开roomstaysback时它什么都没显示(空白页)。

Is my virtual host is configured properly or not. 我的虚拟主机是否配置正确。 If it then where should be the problem. 如果它然后应该在哪里问题。 If not then help for configuring it properly. 如果没有,那么请帮助正确配置它。 Thanks..... 谢谢.....

i had faced the same problem while setting up virtual host in ubuntu for zend framework.add a trailing slash in the following. 我在ubuntu中为zend framework.add设置虚拟主机时遇到了同样的问题,下面是一个尾部斜杠。

<Directory /var/www/roomstaysback/public/>

here is the tutorial that might help you. 这是可能对您有所帮助的教程。

http://blog.code4hire.com/2011/03/setting-up-virtual-hosts-for-apache-on-ubuntu-for-local-development/ http://blog.code4hire.com/2011/03/setting-up-virtual-hosts-for-apache-on-ubuntu-for-local-development/

如果它是只读模式,请检查/ var / www / roomstaysback文件夹权限,然后将其更改为读写模式。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM