Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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:

127.0.0.1   www.lowkey.se

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

sites-available/file:

<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    ServerName www.lowkey.se

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

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

    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
</VirtualHost>

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 Answer 1

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 (213.xxx.xxx.xxx) which you have to attach from your router, to your Ubuntu server intranet (fake) static ip (192.168.xxx.xxx). This must be done from the router panel.

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

    192.168.xxx.xxx www.lowkey.se

  • Tell your domain provider of lowkey.se to turn lowkey.se hearing in the router web ip (213.xxx.xxx.xxx)

After some hours you can see www.lowkey.se through Internet.

share|improve this answer

Your Answer

 
discard

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.