Virtual host configuration in Ubuntu 13.04

  • 29 September 2013
  • mohit.aghera
Now a days I am learning symfony framework.
While installation I came across the need to configure the virtual host on my ubuntu.
Here is what I found on the Ubuntu online documentation.
In Apache2 ships with a virtual-host-friendly default configuration. That is, it is configured with a single default virtual host (using the VirtualHost directive) which can modified or used as-is if you have a single site, or used as a template for additional virtual hosts if you have multiple sites. If left alone, the default virtual host will serve as your default site, or the site users will see if the URL they enter does not match the ServerName directive of any of your custom sites. To modify the default virtual host, edit the file /etc/apache2/sites-available/default.
I needed to configure virtual host for my application.
My document root for the symfony project was /var/www/
Now we need to cony the default virtual host file from the 
sudo cp /etc/apache2/sites-available/default /etc/apache2/sites-available/
Edit the new file named to configure the new site using some of the directives described below.



  DocumentRoot "/var/www/"

  DirectoryIndex app_dev.php

  <Directory "/var/www/">

    AllowOverride All

    Allow from All


The ServerName directive is optional and specifies what FQDN your site should answer to. The default virtual host has no ServerName directive specified, so it will respond to all requests that do not match a ServerName directive in another virtual host.
Enable the new VirtualHost using the a2ensite utility and restart Apache2:
sudo a2ensite

sudo service apache2 restart
Be sure to replace with a more descriptive name for the VirtualHost. One method is to name the file after the ServerName directive of the VirtualHost.
Similarly, use the a2dissite utility to disable sites. This is can be useful when troubleshooting configuration problems with multiple VirtualHosts:

sudo a2dissite

sudo service apache2 restart


Hi there, for all time i used to check blog posts
here in the early hours in the daylight, because i like to find out more and more.

Joseph Antony's picture

The arena hopes for even more passionate writers such as you who aren’t afraid to mention how they believe. All the time follow your



Quest Bars's picture

Hi there, I discovered your blog via Google while searching for a related matter, your web site got here up, it seems to be great.
I have bookmarked it in my google bookmarks.
Hello there, simply became aware of your weblog through Google, and
found that it is really informative. I am going to be careful for brussels.
I'll be grateful for those who continue this in future.
Lots of other folks shall be benefited out of your writing.

Henry Lara's picture

Great job! your blog is really great.I will definitely share it with my friends about this blog.



Thanks in favor of sharing such a good thinking,
piece of writinmg is pleasant, thats why i have read it

My blog post หางานพาร์ทไทม์

play minecraft's picture

Whats up this is somewhat of off topic but I was wanting to know if blogs
use WYSIWYG editors or if you have to manually code
with HTML. I'm starting a blog soon but have no
coding skills so I wanted to get guidance from someone with experience.
Any help would be enormously appreciated!

mohit.aghera's picture

There is button that allows you to format the code in wywsyg editors. So don't worry and create the blog..Good luck :)

Elma Sherry's picture

up-to-the-minute exclusive post' gratitude  for this post DesertLeatherOnline

This design is incredible! You certainly know how to keep a reader amused.
Between your wit and your videos, I was almost moved to start my own blog (well, almost...HaHa!) Fantastic job.
I really enjoyed what you had to say, and more than that, how you presented it.
Too cool!

catarboy's picture

Hello, i am glad to read the whole content of this blog and am very excited and happy to say that the webmaster has done a very good job here.

how to get more instagram followers

Add new comment