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>
Also it enabled on /etc/apache2/sites-enabled folder
And following is my host file:
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
I configured my site in var/www/roomstays. But when I entered roomstays on it not opening the site and showing this message :
It works!
This is the default web page for this server.
The web server software is running but no content has been added, yet.
What's wrong with virtual host.
How to set up virtual host for Zend Project:
Create project(folder) in location /var/www/ named 'roomstays'
Put in file /etc/hosts line:
Create file in /etc/apache2/sites-available/ named "roomstays.conf" and put in it:
Copy that file 'roomstays.conf' to location /etc/apache2/sites-enabled/
Restart apache, open browser and enter "roomstays.test" and that's work for me.
is it not conflicting with localhost? try assigning a different IP address like
and also make sure you have added a directory with the alias name in to the apache log files directory
Hope it helps!
This is what I did to fix this problem. Copy the virtualhost file in etc/apache2/sites-available and paste it into etc/apache2/sites-enabled. Go to your browser and refresh and you would see it work
Three things to check:
1. Sites enabled
Make sure your virtual host file is in /etc/apache2/sites-enabled.
2. NameVirtualHost
Make sure you have this somewhere in the apache config:
I have it in /etc/apache2/ports.conf (can't remember if thats the standard on Ubuntu)
3. Remove default virtual host
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
Remember to restart apache after each change...
Be sure that # Virtual hosts line is active in your httpd.conf file.
Generally, it places under: /etc/apache2/httpd.conf
To edit the file you need root permission, so:
Uncomment the line
Save file ESC + :wq + Enter
Restart your apache
Then change htaccess to