Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have Ubuntu running with Apache2, my website shows in browser when but doesn't show when, my website is in /home/username/public_html/

I used following, which doesnt work

sudo bash -c "cat >> /etc/apache2/sites-available/ <<EOF

<VirtualHost *:80>

  DocumentRoot /home/username/public_html/


share|improve this question

You should look into /etc/hosts. You need to include both:

Let me know if that works.

share|improve this answer
Eh, no, he doesn't have problem with the hosts, but with the virtual host. – Braiam Dec 16 '13 at 2:22

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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