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

Hi I'm using Ubuntu as server OS for my webhosting but I'm having problem redirecting my domainname to my server.

Here are my /etc/hosts file and /etc/apache2/sites-available/mysite file.

hosts file:

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


<VirtualHost *:80>
    ServerAdmin webmaster@localhost

    DocumentRoot /var/www/doost/
    <Directory />
        Options FollowSymLinks
        AllowOverride None
    <Directory /var/www/doost/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride None
        Order allow,deny
    allow from all

    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
    <Directory "/usr/lib/cgi-bin">
        AllowOverride None
        Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
        Order allow,deny
        Allow from all

    ErrorLog ${APACHE_LOG_DIR}/error.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn

    CustomLog ${APACHE_LOG_DIR}/access.log combined

And a screenshot from my domain name provider:

The site has been enabled in Ubuntu. I've restarted apache2 and the folder /var/www/doost/ is there. What am I doing wrong?

share|improve this question

1) your mysite file needs this 1st line

    <VirtualHost *:80>

2) Enable your site by running in terminal:

    sudo a2ensite mysite

3) The procedure to publish a site to Internet needs:

  • a web (not intranet) ip ( which you have to attach from your router, to your Ubuntu server intranet (fake) static ip ( This must be done from the router panel.

  • set your Ubuntu server intranet (fake) static ip ( in /etc/hosts file (add this line)

  • Tell your domain provider of to turn hearing in the router web ip (

After some hours you can see through Internet.

share|improve this answer

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.