How to create VirtualHost in Ubuntu 12.10
Posted
by
Mifas
on Server Fault
See other posts from Server Fault
or by Mifas
Published on 2012-11-27T01:18:00Z
Indexed on
2012/11/27
5:09 UTC
Read the original article
Hit count: 481
I had followed many articles to 'How to create VirtualHost in Ubuntu'. This is what have I done
Installed Apache
sudo apt-get install lamp-server^ phpmyadmin
I created folder called site1.com
in /var/www/
Then I have created the file in /etc/apache2/sites-available/site1.com
Then added the following code to that site1.com
file
<VirtualHost *:80>
ServerName www.site1.com
ServerAdmin [email protected]
ServerAlias site1.com
DocumentRoot /var/www/site1.com
# Other directives here
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/site1.com/>
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
Then after that I edit the host file added the following line of code
127.0.0.1 site1.com
Edit
Also I enable the site1.com via sudo a2ensite site1.com
Then i restart the apache serivice. (Even i restarted the pc)
When I go to the site1.com, It will say The connection has timed out
Error Message. But I can browse via localhost/site1.com
. I have been trying since last two days. No solution. And followed many articles and videos.
© Server Fault or respective owner