UbuntuThis forum is for the discussion of Ubuntu Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Distribution: GUI Ubuntu 12.04 - Server Ubuntu 12.04
Posts: 903
Rep:
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
Distribution: GUI Ubuntu 12.04 - Server Ubuntu 12.04
Posts: 903
Original Poster
Rep:
Quote:
Originally Posted by bathory
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 ?
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.
Distribution: GUI Ubuntu 12.04 - Server Ubuntu 12.04
Posts: 903
Original Poster
Rep:
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
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.
Distribution: GUI Ubuntu 12.04 - Server Ubuntu 12.04
Posts: 903
Original Poster
Rep:
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.
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>
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.