LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-17-2004, 09:34 PM   #1
tommytomato
Member
 
Registered: Nov 2003
Location: Narrogin Western Australia
Distribution: GUI Ubuntu 12.04 - Server 12.04.4 LTS
Posts: 939

Rep: Reputation: 32
site forwarding


Hi guys

How would you forward a site from a linux machine to another machine on the same network as on port 81

my brother has his server up which is linux, but has a site on a windows box as well.
and he wants to be able to type in http://202.x.x.x./windows and it will take him to his windows box .

http://202.x.x.x./ port 80 would be his default linux httpd page, http://202.x.x.x./windows/ would be his windows IIS PC rinning on 192.168.x.x port 81.

I was wonder if he can add a 2nd IP to his nick card
Or can apache point him that way..

I hope this makes sence..


TT
 
Old 05-17-2004, 10:02 PM   #2
fuubar2003
Member
 
Registered: May 2004
Location: Orlando, Florida
Distribution: SLES10/11, RH4/5 svrs, Fedora, Debian/Ubuntu/Mint; FreeBSD/OpenBSD
Posts: 63

Rep: Reputation: 26
How to add a 2nd IP to a single NIC:

ifconfig eth0:1 inet 192.168.0.100 up
 
Old 05-17-2004, 10:06 PM   #3
tommytomato
Member
 
Registered: Nov 2003
Location: Narrogin Western Australia
Distribution: GUI Ubuntu 12.04 - Server 12.04.4 LTS
Posts: 939

Original Poster
Rep: Reputation: 32
Thank you.

what do i do next if you dont mine explaining

is it a matter of adding it to Apache config file ?

I'm real unsure about this..

I've only work with Apache by putting in subdomains

TT
 
Old 05-17-2004, 10:09 PM   #4
tommytomato
Member
 
Registered: Nov 2003
Location: Narrogin Western Australia
Distribution: GUI Ubuntu 12.04 - Server 12.04.4 LTS
Posts: 939

Original Poster
Rep: Reputation: 32
Quote:
How to add a 2nd IP to a single NIC: ifconfig eth0:1 inet 192.168.0.100 up
I tried it, this is what i get


root@localhost ~# ifconfig eth:1 inet 192.168.0.100 up
SIOCSIFADDR: No such device
eth:1: unknown interface: No such device
eth:1: unknown interface: No such device
root@localhost ~#

Our IP ifconfig

Code:
root@localhost ~# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:40:F4:75:6B:86
          inet addr:192.168.0.222  Bcast:192.168.0.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1167 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1391 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:131165 (128.0 Kb)  TX bytes:178538 (174.3 Kb)
          Interrupt:11 Base address:0x9000

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:16 errors:0 dropped:0 overruns:0 frame:0
          TX packets:16 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:1384 (1.3 Kb)  TX bytes:1384 (1.3 Kb)

root@localhost ~#
TT

P.s i see i forgot the 0

Last edited by tommytomato; 05-17-2004 at 10:14 PM.
 
Old 05-17-2004, 10:18 PM   #5
tommytomato
Member
 
Registered: Nov 2003
Location: Narrogin Western Australia
Distribution: GUI Ubuntu 12.04 - Server 12.04.4 LTS
Posts: 939

Original Poster
Rep: Reputation: 32
Ok this worked thank you fuubar2003

Code:
root@localhost ~# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:40:F4:75:6B:86
          inet addr:192.168.0.222  Bcast:192.168.0.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1306 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1514 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:145890 (142.4 Kb)  TX bytes:189958 (185.5 Kb)
          Interrupt:11 Base address:0x9000

eth0:1    Link encap:Ethernet  HWaddr 00:40:F4:75:6B:86
          inet addr:192.168.0.100  Bcast:192.168.0.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          Interrupt:11 Base address:0x9000

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:16 errors:0 dropped:0 overruns:0 frame:0
          TX packets:16 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:1384 (1.3 Kb)  TX bytes:1384 (1.3 Kb)

root@localhost ~#
On to the next bit

TT
 
Old 05-17-2004, 10:19 PM   #6
Demonbane
LQ Guru
 
Registered: Aug 2003
Location: Sydney, Australia
Distribution: Gentoo
Posts: 1,796

Rep: Reputation: 47
There's probably more than one way of doing this but what I would do is I would first forward a port(say 81) on the external interface to the windows box on 192.168.x.x port 81
Then configure Apache using Redirect directive
Code:
<IfModule mod_alias.c>
Redirect permanent /windows http://<external ip>:81
</IfModule>
If external connection is not an issue you can simply redirect it to 192.168.x.x:81

Last edited by Demonbane; 05-17-2004 at 10:21 PM.
 
Old 05-17-2004, 10:26 PM   #7
tommytomato
Member
 
Registered: Nov 2003
Location: Narrogin Western Australia
Distribution: GUI Ubuntu 12.04 - Server 12.04.4 LTS
Posts: 939

Original Poster
Rep: Reputation: 32
thank you Demonbane

I think he wants his Linux server page to stay as is, but if he types in his main IP with the site he wants 202..x.x.x/windows/ its taken to his Win box, but the linux one is up as well.

I hope this make sence, it's hard to explain some times because i dont know all the linux terms yet.

TT
 
Old 05-17-2004, 10:34 PM   #8
Demonbane
LQ Guru
 
Registered: Aug 2003
Location: Sydney, Australia
Distribution: Gentoo
Posts: 1,796

Rep: Reputation: 47
Yea what happens if you configure port forwarding and add those lines to apache config file is that when ppl access http://202.x.x.x/windows (assuming 202.x.x.x is an external ip), the request gets redirected to http://202.x.x.x:81, which points to the IIS server.
 
Old 05-17-2004, 10:38 PM   #9
tommytomato
Member
 
Registered: Nov 2003
Location: Narrogin Western Australia
Distribution: GUI Ubuntu 12.04 - Server 12.04.4 LTS
Posts: 939

Original Poster
Rep: Reputation: 32
yer he's got DSL

and your right about assuming 202.x.x.x is his external ip

I think he added the IP and the port 81 to his DSL config stuff last night.

Just looking for Redirect directive in the httpd.conf file now

TT
 
Old 05-17-2004, 10:43 PM   #10
tommytomato
Member
 
Registered: Nov 2003
Location: Narrogin Western Australia
Distribution: GUI Ubuntu 12.04 - Server 12.04.4 LTS
Posts: 939

Original Poster
Rep: Reputation: 32
Is this it ? looks to me it is. but i'm unsure..

Code:
#
# Redirect allows you to tell clients about documents which used to exist in
# your server's namespace, but do not anymore. This allows you to tell the
# clients where to look for the relocated document.
# Example:
# Redirect permanent /foo http://www.example.com/bar

TT
 
Old 05-17-2004, 10:49 PM   #11
tommytomato
Member
 
Registered: Nov 2003
Location: Narrogin Western Australia
Distribution: GUI Ubuntu 12.04 - Server 12.04.4 LTS
Posts: 939

Original Poster
Rep: Reputation: 32
Well this is where i put it and i get page cannont be display
I know the page is there because i just try the address, i get no error's in httpd on restart

Code:
#
# Redirect allows you to tell clients about documents which used to exist in
# your server's namespace, but do not anymore. This allows you to tell the
# clients where to look for the relocated document.
# Example:
# Redirect permanent /foo http://www.example.com/bar

<IfModule mod_alias.c>
Redirect permanent /windows http://192.168.0.200:81
</IfModule>

#
# Directives controlling the display of server-generated directory listings.
#
TT
 
Old 05-17-2004, 11:11 PM   #12
Demonbane
LQ Guru
 
Registered: Aug 2003
Location: Sydney, Australia
Distribution: Gentoo
Posts: 1,796

Rep: Reputation: 47
Are you trying to access it through the internet or it's all local?
nevertheless check if there's anything in the Apache error log.
 
Old 05-17-2004, 11:21 PM   #13
tommytomato
Member
 
Registered: Nov 2003
Location: Narrogin Western Australia
Distribution: GUI Ubuntu 12.04 - Server 12.04.4 LTS
Posts: 939

Original Poster
Rep: Reputation: 32
yer i can access the main linux box via http://202.x.x.x

and yes the other site we are trying to access is on his lan on another box
Ip 192.168.0.200
and we are trying the address http://202.x.x.x/windows

I get no errors by doing this tail -f /var/log/httpd/access_log


[18/May/2004:21:27:23 +0800] "GET /windows/ HTTP/1.1" 301 396


TT

Last edited by tommytomato; 05-17-2004 at 11:24 PM.
 
Old 05-17-2004, 11:38 PM   #14
Demonbane
LQ Guru
 
Registered: Aug 2003
Location: Sydney, Australia
Distribution: Gentoo
Posts: 1,796

Rep: Reputation: 47
He has to configure port forwarding and forward port 81 to 192.168.0.200:81,
then configure redirect using the external ip.
Code:
Redirect permanent /windows http://202.x.x.x:81
Otherwise it'll be your own box on the other side of the internet trying to connect to 192.168.0.100 on his LAN, which of course won't work.
 
Old 05-17-2004, 11:39 PM   #15
mhiggins
Member
 
Registered: Feb 2004
Posts: 140

Rep: Reputation: 15
Here is what you Apache conf should have.

<IfModule mod_proxy.c>
ProxyRequests On
ProxyPass /windows http://ip.of.the.win.box:81/
</IfModule>

You may need an extra slash after windows like this

ProxyPass /windows/ http://ip.of.the.win.box:81/

Last edited by mhiggins; 05-18-2004 at 07:57 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Mail Forwarding in postfix/maildrop/redhat (like yahoo mail forwarding) topcat Linux - Software 1 08-31-2007 01:10 PM
Simple Port Forwarding Firewall - not forwarding MadTurki Linux - Security 14 04-09-2006 01:08 PM
Do you know sourceforge site? How to upload to this site? TruongAn General 2 07-02-2005 06:26 AM
Site Forwarding to another box tommytomato Linux - Networking 1 06-14-2004 04:37 PM
port forwarding and packet forwarding syrtsardo Linux - Newbie 2 07-03-2003 11:37 AM


All times are GMT -5. The time now is 06:51 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration