LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   fake ip's (https://www.linuxquestions.org/questions/linux-networking-3/fake-ips-189006/)

g452 06-02-2004 06:15 PM

fake ip's
 
hi all,

i have a question that i hope can be answered and that isn't stupid ... well here goes ...

i run apache with php4 and mysql and webmin to manage everything - now i want to be able to host all the web sites i work on locally so they can be mirrored to the sites that is actually online - so basically i want to be able to work on them and view them as though they where really online - so my question is can it be done ?? like they should have the same URL as the ones online and maybe get them to work on seperate ip's or fake ip's ... the pc i work my sites on is only connected to a lan - so it is like isolated from the WWW -

i use Slack 9.1 BTW - :D :D :D

laterz

Mathieu 06-02-2004 08:38 PM

The easiest way would be to add your domain to the /etc/hosts file by appending it to the loopback IP or a private IP.
For example:
Code:

127.0.0.1  mydomain.pvt  mydomain
If you want to use a private IP, you will have to implement an IP alias.
Take a look at this small HowTO, it will show you two methods for implementation.
I am not sure which method Slackware uses (my guess is the old one), try both.
http://www.troubleshooters.com/linux/ipalias.htm

g452 06-03-2004 05:38 PM

cool, thanx for the reply

so it seems like it is possible to have diff ip ranges without too much trouble -

i'll have a look at the howto- :D :D :D

laterz

g452 06-04-2004 01:26 PM

ok - i got this going at least

/sbin/ifconfig eth0:0 192.168.2.1

and when i ping that it works - now my question is my nic is addy 192.168.1.XXX - will it still work to use the 192.168.2.1 as an ip for apache ????

i need this only on my local lan - so not too worried bout anything else - a pvt network

laterz


All times are GMT -5. The time now is 10:56 PM.