View Single Post
Old 02-05-2016, 02:45 PM   #329
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Quote:
Originally Posted by Branch Delay View Post
that will only work if the network you connect to is doing DNS lookups from /etc/hosts. i.e. that might be possible on your router.
'files' is the usual default for Linux NSS.

Example:
Code:
$ less /etc/nsswitch.conf

# /etc/nsswitch.conf
#
# Example configuration of GNU Name Service Switch functionality.
# If you have the `glibc-doc-reference' and `info' packages installed, try:
# `info libc "Name Service Switch"' for information about this file.

passwd:         compat
group:          compat
shadow:         compat

hosts:          files mdns4_minimal [NOTFOUND=return] dns mdns4
networks:       files

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

netgroup:       nis
Now my local hosts file looks like this (only showing two lines for this example:
Code:
127.0.0.1       localhost

169.254.57.36   hp6940
If I am following this correctly, then I need it to look like this, if I have a server on 'localhost' (I do - most Linux distros do, although it might not be running).
Code:
127.0.0.1       localhost
127.0.0.1       a
169.254.57.36   hp6940
Currently, if I browse to either 'localhost' or 'isp assigned address of my pc' I get:
Quote:
It works!

This is the default web page for this server.
The web server software is running but no content has been added, yet.
(that is the default set-up of Debian/Ubuntu based distros).


Now if I check the config to find out where my web root is:
Code:
less /etc/apache2/sites-enabled/000-default


<VirtualHost *:80>
        ServerAdmin webmaster@localhost

        DocumentRoot /var/www
* * * much more * * *
But that is the part we need to know at the moment -

this server will answer to **any** packet, for any domain name that shows up at its door (the first line) -
and it will serve the document index.html from the directory /var/www -


So the top level of /var/www is where I want to unpack the JB files.


Then with the change to the /etc/hosts file made above (assuming that my desktop pc is also my router (it isn't - I can't quote for this part) browsing to 'a' from anything on my internal network will end up getting /var/www/<whatever> served to it.


Many (most?) routers run Linux also -
So you would want to make changes similar to the above on your router.


Sorry, I can't give more specific instructions - router setup procdures are in the hundreds of different ways to do the same thing.
knc1 is offline   Reply With Quote