LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 04-11-2011, 02:11 PM   #1
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Apache: IP- and port-based virtual server with Redirect


Hello :-)

How to redirect when using a non-standard port?

Netsearching has not found an answer, perhaps because the combination of an IP- and port-based virtual server with Redirect is unusual.

Our LAN has no name service running (it's not a technical issue) so I can only use IP-based virtual hosts. The live and development virtual hosts are differentiated by port so the first lines of the virtual hosts definitions look like
Code:
<VirtualHost *:80>
and
<VirtualHost *:8080>
So far so good but the application is CGI; we need to pass CGI parameters in the URL. For flexibility and usability the live users' URL is http://<host_ID>/search which is redirected like this
Code:
<VirtualHost *:80>
    CustomLog "/var/log/apache2/xapian.access.log" combined
    DocumentRoot "/srv/docoll"
    <Directory "/srv/docoll">
        AllowOverride None
        Options All
        Order Allow,Deny
        Allow from all
    </Directory>
    <Directory "/usr/lib/cgi-bin/omega/omega/">
        AllowOverride None
        Options None
        Order Allow,Deny
        Allow from all
    </Directory>
    Redirect "/search" "/cgi-bin/omega?DB=docoll"
    ScriptAlias "/cgi-bin/" "/usr/lib/cgi-bin/omega/"
    ServerAdmin <email address hidden>
    ServerName "Document Collation"
</VirtualHost>
That works OK, the problem is doing the equivalent for the port 8080 virtual server. Using http://192.168.168.51/cgi-bin/omega?DB=docoll_dev&:8080 directly works. Using 'Redirect "/search_dev" "/cgi-bin/omega?DB=docoll_dev&:8080"' and browsing http://192.168.168.51/search_dev:8080 gets a 404. Same for 'Redirect "/search_dev" "/cgi-bin/omega?DB=docoll_dev"'.

Apache's proxy and proxy_http modules were suggested in the Xapian user mailing list but the responder did not know I was using a separate virtual host for the 8080 port and the topic had become Apache rather than Xapian so better continued elsewhere.

Best

Charles

Last edited by catkin; 04-11-2011 at 02:13 PM. Reason: Cleaned up a bit
 
Old 04-11-2011, 04:17 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
erm, why is the port on the end of the uri??? that's tooootally not right. it's
Code:
http://ip:port/uri?query
 
1 members found this post helpful.
Old 04-12-2011, 12:42 AM   #3
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578

Original Poster
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Thanks Chris

A little ignorance goes a long way!

http://192.168.168.51/cgi-bin/omega?DB=docoll_dev&:8080 appeared to work while http://192.168.168.51:8080/cgi-bin/omega?DB=docoll_dev did not.

The reason was Apache was not listening on 8080. Solved by adding the following lines to /etc/apache2/ports.conf
Code:
NameVirtualHost *:8080
Listen 8080
The OS is Debian 6.0 Squeeze.
 
  


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
Apache redirect based on LDAP authentication starmonche Linux - Server 3 03-21-2008 11:42 AM
Apache, I Can not get Name based Virtual Server to work kcasey Linux - Software 3 01-24-2004 12:09 AM
Webmin Vitualmin SUEXEC Apache Virtual Named Based Server Setup Questions ? Confused! wishiwas Linux - Software 0 12-02-2003 10:47 PM
Apache Virtual Host Redirect granny Linux - Networking 5 05-22-2003 02:20 PM
Apache Virtual URL Redirect nxny Linux - Software 0 07-19-2002 03:36 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 07:55 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
Open Source Consulting | Domain Registration