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.

I have a apache server running on ubuntu 10.04. i wanted to give the server a name. so i added a name called sdk in /etc/apache/sites-available/sdk with the following

VirtualHost *:80>
    ServerAdmin webmaster@localhost
    ServerName sdk.sat
    ServerAlias *.sdk.sat
    DocumentRoot /var/www
    <Directory /var/www>
            Options Indexes FollowSymLinks MultiViews
            AllowOverride None
            Order allow,deny
            allow from all
    </Directory>

    ErrorLog /var/log/apache2/error.log

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

    CustomLog /var/log/apache2/access.log combined

Now, I can access this web address thorught the lan using its ip address 192.168.1.5. But i want it to be accessed by the server name sdk.sat. How can i do this?

share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted

This depends on how wide you want this domain to work. If this is only for your personal use, you can add the following line to your /etc/hosts, and it would start working on your computer. Unless you are willing to buy sdk.sat from a domain registrar, you would also need to add the same entry to any other clients willing to access the site.

127.0.0.1 sdk.sat

Note that you'd need admin rights to edit the hosts file. So use gksudo gedit /etc/hosts

For any other computer make sure to use a network accessible ip address, such as 192.168.x.y(if its a LAN) or perhaps your internet accessible IP address.

share|improve this answer
    
excellent! thank you so much! –  Ubuntuser Jul 17 '12 at 7:54
add comment

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.