LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Ubuntu (http://www.linuxquestions.org/questions/ubuntu-63/)
-   -   Apache2 Redirect (http://www.linuxquestions.org/questions/ubuntu-63/apache2-redirect-737659/)

tommytomato 07-04-2009 02:56 AM

Apache2 Redirect
 
1 Attachment(s)
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 :confused:

Any one done this before on the Unbuntu system ?

TT

bathory 07-04-2009 03:30 AM

To find out if mod_alias is compiled as an apache module you can use:
Code:

httpd -l|grep alias

micxz 07-04-2009 03:42 AM

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 "<".

tommytomato 07-04-2009 05:06 AM

Quote:

Originally Posted by bathory (Post 3596296)
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

cmdln 07-04-2009 04:07 PM

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.

micxz 07-04-2009 06:31 PM

Put the redirect in your virtualhost containment and you should be good to go.

tommytomato 07-05-2009 05:11 AM

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

micxz 07-05-2009 02:09 PM

Quote:

Originally Posted by tommytomato (Post 3597179)
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 iface:port and make sure that port is open on the firewall.

tommytomato 07-05-2009 06:57 PM

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 )

micxz 07-05-2009 08:52 PM

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>



All times are GMT -5. The time now is 06:33 PM.