LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-25-2003, 11:32 PM   #1
theserge
LQ Newbie
 
Registered: Aug 2003
Location: Stinky Philly
Distribution: RedHat9
Posts: 10

Rep: Reputation: 0
Question soft linking for apache?


I'm not sure if my subject accurately describes what I'm trying to do.

I have an http server running on port 4444 and I would like to be able to access it via a subdirectory on port 80.

Here's an example:

htttp://myserver:80/gobble/index.html

would take the visitor to:

htttp://myserver:4444/index.html

And another one:

htttp://myserver:80/gobble/hibble/index.html

would take the visitor to:

htttp://myserver:4444/hibble/index.html

.

Currently the best thing I've come up with is creating a refresh meta tag for all files that I expect visitors will enter.

I apologize if I put the post in the wrong forum, Thanks for the help!

Serge
 
Old 11-26-2003, 02:16 AM   #2
arvindn
LQ Newbie
 
Registered: Nov 2003
Location: India
Distribution: fedora
Posts: 20

Rep: Reputation: 0
Hi,

What you want to do is called port forwarding, and it's not specific to apache. In linux you can do it using iptables. You will find detailed instructions in the iptables documentation.

Arvind
 
Old 11-26-2003, 03:00 AM   #3
theserge
LQ Newbie
 
Registered: Aug 2003
Location: Stinky Philly
Distribution: RedHat9
Posts: 10

Original Poster
Rep: Reputation: 0
Thanks Arvind, I took a look at port forwarding, but that forwards the whole port (80 to 4444 for instance). Do you know of a way offhand to forward just "domain:80/directory" to "domain:4444/"? Maybe I missed it in the iptables docs, I'll keep looking. Thanks again

Serge
 
Old 11-26-2003, 11:35 AM   #4
arvindn
LQ Newbie
 
Registered: Nov 2003
Location: India
Distribution: fedora
Posts: 20

Rep: Reputation: 0
Hi,

Sorry I didn't understand your question correctly the first time. Of course what you have is an apache question

Apache has a thing called mod_rewrite. I've never used it myself but I think it can do what you want, because it is supposed to be able to handle any kind of URL redirection imaginable.

Google will give you a wealth of resources.

Arvind
 
Old 11-26-2003, 01:44 PM   #5
stickman
Senior Member
 
Registered: Sep 2002
Location: Nashville, TN
Posts: 1,552

Rep: Reputation: 53
There is a pretty good URL Rewriting Guide over on the Apache site that explains mod_rewrite pretty well.
 
Old 11-26-2003, 02:07 PM   #6
theserge
LQ Newbie
 
Registered: Aug 2003
Location: Stinky Philly
Distribution: RedHat9
Posts: 10

Original Poster
Rep: Reputation: 0
Thank you very much stickman and arvind, I got it working The only problem was that I could not do a RewriteLock or RewriteLog because I kept getting "RewriteLog not allowed here" no matter where I tried to put it.

My current setup is:
<Directory /var/www/html>
RewriteEngine ON
RewriteBase /directory
RewriteRule ^directory(.+) http://server:4444$1 [R,L]
</Directory>

If anyone knows why I cannot get a RewriteLock or RewriteLog please let me know. Thanks!!!
 
  


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
Forbidden access to soft link on apache web server bnj Linux - Software 3 05-03-2005 09:14 AM
linking mrtg and apache pkrishna10 Linux - Software 3 12-15-2004 05:06 PM
How to make apache follow soft links Snerkel Linux - Software 1 12-10-2004 11:38 AM
soft links in apache-newbie prac2 Linux - Software 1 07-25-2002 02:41 AM
chili!soft/apache:recompile with -DEAPI? katana Linux - General 0 09-04-2001 09:35 PM


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

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