httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Greg Rundlett (freephile)" <>
Subject Re: [users@httpd] Renaming localhost
Date Thu, 11 Feb 2016 17:13:01 GMT
On Wed, Feb 10, 2016 at 4:57 AM, Raja <> wrote:

> Hello,
> I sometimes work in remote sites with no network. I have the same setup
> on different machines and I need the server name to know dynamically
> where to do changes, etc.

It's not clear to me the situation that you're describing above.

> I edited /etc/hosts to show
> localhost somename
> Now, with my Wifi off I am trying `http://somename` and it is not
> connecting. If I turn my wifi on, it works. But I need it to work with
> no connection. How can I resolve this?

DNS is the system that resolves names to (numeric) hosts.

The /etc/hosts file on Linux systems is consulted first, before any (local
or network) DNS server is consulted.

Therefore, the entry in /etc/hosts that you list above WILL map "
http://somename" to the numeric address, which is the local

In order for this to actually produce a usable result, you must have a web
server (e.g. Apache) running on the local machine, along with the proper
configuration (e.g. /etc/apache2/conf-enabled/somename.conf) and
files/scripts in the document root (e.g. /var/www/
to serve some website called "somename" from your local machine without
using any network.

p.s. If you have the same set of files, and configuration to synchronize
across multiple hosts (e.g. local, testing, production), you will need a
tool like rsync; and be sure to use the --dry-run --verbose options.
Better yet, use git to commit your changes, and setup a "remotes" such as
'origin' and 'dev' to allow you to track, and push code changes.

Greg Rundlett <>

View raw message