httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Raja <r...@rsdisk.com>
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
</Directory>

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 10.0.0.100 netmask 255.255.255.0 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, 127.0.0.1,  using a localhost alias, even when the NIC does not
have an IP.

Thanks.

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 <raja@rsdisk.com> 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
>         127.0.0.1 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 127.0.0.1, 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/somename.com/index.html) 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
> https://eQuality-Tech.com
> https://freephile.org



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message