httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Raja <>
Subject Re: [users@httpd] Renaming localhost
Date Fri, 12 Feb 2016 08:26:35 GMT
Hi Greg,

Thanks for your reply. 

Yes the apps are driven by LAMP stack. I looked in
the /etc/apache2/conf-enabled/ folder and found shortcut files.

This one is for apache docs

Alias /manual /usr/share/doc/apache2-doc/manual/

<Directory "/usr/share/doc/apache2-doc/manual/">
    Options Indexes FollowSymlinks
    AllowOverride None
    Require all granted
    AddDefaultCharset off

I am guessing I have to create such a file for http://somename/ whose
files are under /var/www/html/somename.

Right now I found a solution by assigning an IP to the NIC by using
ifconfig command

ifconfig eth0 netmask up

The problem is if the connecting is intermittent, when the connection is
live, the eth0 is assigned a static IP. When the connection dies, the IP
is nullified.

Ideally I would like to know how to make Apache point to the same
address,,  using a localhost alias, even when the NIC does not
have an IP.


Regards, Raja.

On Thu, 2016-02-11 at 12:13 -0500, Greg Rundlett (freephile) wrote:
> 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
> machine.  
> 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

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message