Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > HOWTO-Related Questions

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Thread Tools Display Modes
Old 22nd April 2013, 16:44
dimko dimko is offline
Junior Member
Join Date: Apr 2013
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default HowTo access installed site via hostname not IP


I use Ubuntu 12.10.
I read a lot of information and as result I have become more confused.
I have installed Apache, MySQL, PHP and phpMyAdmin successfully. And I can access my site from local network by
How can I do access via alias as "buro" or smth like it from LAN.

Should I configured bind9 or just correct cinfigure Virtual Hosts?

I tried to edit /etc/hosts, added virtual host

/etc/hosts localhost buro
# buro websrv
# websrv

passwd: compat
group: compat
shadow: compat

hosts: files dns
networks: files

protocols: db files
services: db files
ethers: db files
rpc: db files

netgroup: nis

<VirtualHost *:80>
ServerName buro
ServerAlias buro

DocumentRoot /var/www
ErrorLog /var/www/error.log
CustomLog /var/www/access.log common


root@websrv:~# sudo /etc/init.d/apache2 restart
* Restarting web server apache2
apache2: Could not reliably determine the server's fully qualified domain name, using for ServerName
... waiting apache2: Could not reliably determine the server's fully qualified domain name,
using for ServerName

root@websrv:/etc/apache2/sites-available# sudo a2ensite buro
ERROR: Site buro does not exist!

root@websrv:/etc/apache2/sites-available# ping buro
PING localhost ( 56(84) bytes of data.
64 bytes from localhost ( icmp_req=1 ttl=64 time=0.038 ms

From another PC cannot ping by hostname.

/etc/apache2/apache2.conf - This config I left without any change.

Last edited by dimko; 22nd April 2013 at 17:05.
Reply With Quote
Sponsored Links
Old 22nd April 2013, 21:27
bch bch is offline
Junior Member
Join Date: Feb 2013
Posts: 12
Thanks: 1
Thanked 2 Times in 2 Posts

Hello dimko

I would add this line to the LAN PC's hosts file,
(assuming it's Windows PC's - C:\WINDOWS\system32\drivers\etc\hosts): buro

Then the LAN PCs know where to look for buro.

You could also change their primary DNS to,
but then your server will be asked for all domains requested from LAN PC's
which would be rejected, and then the LAN PC's will try with their secondary DNS.

If you have a domain with DNS (or too many LAN PC's to edit) you could also point
buro.yourdomain.com to from your domain provider's DNS control panel.

Some gateways/routers also have the ability to resolve local domains.

This is only about resolving. It's not about configuring the server alias.
Reply With Quote


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
MySQL Error Nolan Installation/Configuration 13 27th November 2014 06:04
how to access my 1st site Osa2Unx General 8 4th November 2011 18:02
Virtual Users And Domains With Postfix, Courier, MySQL And SquirrelMail -Ubuntu 8.04 c4rdinal HOWTO-Related Questions 112 23rd August 2011 11:49
Webmin upgrade lishaw1968 Installation/Configuration 15 26th August 2010 16:23
Upgrade to php 5.2 in suse 10.1 gimhan90 Installation/Configuration 3 1st January 2009 21:32

All times are GMT +2. The time now is 01:46.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.