Once I tried to make a virtual host, and the problem was that if I make another file in /etc/apache2/sites-available/ that says

DocumentRoot /var/www/newsite
ServerName   newsite

Then save it, restart Apache, and appending /etc/hosts like this: newsite

I get the page that corresponds the DocumentRoot from /etc/apache2/sites-available/default

That time I left it unsolved. Now I want to do it once again and I get the same problem. Despite the fact that I use different version of Linux distro. I feel like I'm doomed.


did you enable the site using the a2ensite command? The /etc/apache2/sites-available directory lists those that you have setup but it needs to be in /etc/apache2/sites-enabled to be picked up when you next reload the apache2 configuration.

  • damn, that was easy! I don know why i didnt ever faced this command reading dozens of how to's and examples. Thank you so much – M2_ Jan 17 '11 at 23:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.