LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices

Reply
 
LinkBack Search this Thread
Old 07-04-2009, 02:56 AM   #1
tommytomato
Member
 
Registered: Nov 2003
Location: Narrogin Western Australia
Distribution: GUI Ubuntu 12.04 - Server 12.04.4 LTS
Posts: 927

Rep: Reputation: 32
Apache2 Redirect


Hey all

any one know how to redirect to another PC on a local network to show up a site.

I use Ubuntu Server and its alittle different to how I did it in the past on a Tiny Sofa system

Old code as follows

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

# Mate this is where to edit to make it bonce to your windows Server.
#<IfModule mod_alias.c> 
#Redirect permanent /windows http://<192.168.10.6:80  
#</IfModule>
How do I check to see it I have IfModule mod_alias.c installed

Any one done this before on the Unbuntu system ?

TT
Attached Images
File Type: jpg apache-folder.jpg (128.0 KB, 4 views)
 
Old 07-04-2009, 03:30 AM   #2
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,772

Rep: Reputation: 1294Reputation: 1294Reputation: 1294Reputation: 1294Reputation: 1294Reputation: 1294Reputation: 1294Reputation: 1294Reputation: 1294
To find out if mod_alias is compiled as an apache module you can use:
Code:
httpd -l|grep alias
 
Old 07-04-2009, 03:42 AM   #3
micxz
Senior Member
 
Registered: Sep 2002
Location: CA
Distribution: openSuSE, Cent OS, Slackware
Posts: 1,131

Rep: Reputation: 75
Should not be different' per OS apache is apache

Looks like you need to change the line
#Redirect permanent /windows http://<192.168.10.6:80

remove the comment and the "<".
 
Old 07-04-2009, 05:06 AM   #4
tommytomato
Member
 
Registered: Nov 2003
Location: Narrogin Western Australia
Distribution: GUI Ubuntu 12.04 - Server 12.04.4 LTS
Posts: 927

Original Poster
Rep: Reputation: 32
Quote:
Originally Posted by bathory View Post
To find out if mod_alias is compiled as an apache module you can use:
Code:
httpd -l|grep alias

That command doesn't seem to be working on the command line

Reason why I asked about that redirect is my apache2 has diffferent folders for enabling sites just like int he image, where do I put the code, under apache2.conf as Normal ?

TT
 
Old 07-04-2009, 04:07 PM   #5
cmdln
Member
 
Registered: Apr 2009
Location: Lawrence, KS
Distribution: Debian, Centos
Posts: 102
Blog Entries: 1

Rep: Reputation: 24
That's just the debian way of doing ghosts. They are just included from the main conf. Makes managing multiple site configs easier. As for your redirect if the client computers can access the new server directly then you just want to do a 301 rediret. If the client computers can not access the new server directly then you need to do a reverse proxy.
 
Old 07-04-2009, 06:31 PM   #6
micxz
Senior Member
 
Registered: Sep 2002
Location: CA
Distribution: openSuSE, Cent OS, Slackware
Posts: 1,131

Rep: Reputation: 75
Put the redirect in your virtualhost containment and you should be good to go.
 
Old 07-05-2009, 05:11 AM   #7
tommytomato
Member
 
Registered: Nov 2003
Location: Narrogin Western Australia
Distribution: GUI Ubuntu 12.04 - Server 12.04.4 LTS
Posts: 927

Original Poster
Rep: Reputation: 32
Doesn't seem to be working

I've put the Redirect permanent code with in the apache2.conf it self, restarted apache2, NO errors.
Code:
<IfModule mod_alias.c> 
Redirect permanent /cam http://192.168.x.x <---the windows box 
</IfModule>
See I've got one of those cam programs that runs on windows, I'm trying to redirect a link like http://www.thesite.com/cam thesite.com been the main domain box, hoping when one visits http://www.thesite.com/cam it will take it to the other box which runs the cam server.

I've opned up the ports on my router added the IP and port and opened up the windows port for 8080

hope all that makes sense

TT
 
Old 07-05-2009, 02:09 PM   #8
micxz
Senior Member
 
Registered: Sep 2002
Location: CA
Distribution: openSuSE, Cent OS, Slackware
Posts: 1,131

Rep: Reputation: 75
Quote:
Originally Posted by tommytomato View Post
See I've got one of those cam programs that runs on windows, I'm trying to redirect a link like http://www.thesite.com/cam thesite.com been the main domain box, hoping when one visits http://www.thesite.com/cam it will take it to the other box which runs the cam server.

I've opned up the ports on my router added the IP and port and opened up the windows port for 8080

hope all that makes sense

TT
OK I see now your trying to to forward internal cam to the out side. You need to test by going to your external IP not the internal IP. This apache config is on a server on you local lan or outside network? Also check your router/firewall config again to forward windowsIP:8080 to external ifaceort and make sure that port is open on the firewall.
 
Old 07-05-2009, 06:57 PM   #9
tommytomato
Member
 
Registered: Nov 2003
Location: Narrogin Western Australia
Distribution: GUI Ubuntu 12.04 - Server 12.04.4 LTS
Posts: 927

Original Poster
Rep: Reputation: 32
I did get it going one way

had to install IIS and shut down my Apache2Triad on my windows box, change the IIS port and port to firewalls

Not really the way I wanted it, I wanted to be able to use redirect so I dont have to add the port number on the end of the link each time I get my mates to view our cam.

TT ( karl )
 
Old 07-05-2009, 08:52 PM   #10
micxz
Senior Member
 
Registered: Sep 2002
Location: CA
Distribution: openSuSE, Cent OS, Slackware
Posts: 1,131

Rep: Reputation: 75
I see. To get rid of the port # you could use a frame page.
Code:
<HTML>
<HEAD>
<TITLE>Cam</TITLE>
</HEAD>
<FRAMESET ROWS="*,0">
<FRAME SRC="http://123.123.123.123:8080" NORESIZE>
<NOFRAMES>
Your browser does not support frames.
</NOFRAMES>
</FRAMESET>
</HTML>
 
  


Reply

Tags
apache2, redirect


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache2 redirect plk Linux - Server 7 11-27-2008 01:37 PM
Apache2 .htaccess redirect problem raven Linux - Networking 0 08-06-2007 02:35 AM
Apache2 Network Share Redirect nuebKitsune Linux - Newbie 2 01-28-2007 05:59 PM
redirect SquirrelMail from http to https using Apache2 cccc Linux - Server 3 09-23-2006 10:02 AM
Apache2 internal redirect? WopMaster8 Linux - Software 2 03-28-2005 01:25 AM


All times are GMT -5. The time now is 04:40 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration