LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 01-18-2012, 03:46 PM   #1
saphil
LQ Newbie
 
Registered: Aug 2006
Location: Atlanta
Distribution: Ubuntu, Fedora, CEntOS, Linux Mint, PCLinux, AntiX, others
Posts: 12

Rep: Reputation: 2
Wink Debian Apache2 Redirect or ProxyPass fails


Redmine is in its Bitnami world and running on its own webserver
at http://sub.example.org:8080/redmine
apache2 is running and presents a web site of its own at http://sub.example.org
example.org points to an entirely different machine.
These DNS "A" records are split out at the domain registrar.

Code:
     <Directory /var/www/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
                # Point / to redmine
                # ----------------------------------------------------------
                #Alias /redmine/ :8080/redmine/
                #RedirectMatch 301 ^/redmine/$ :8080/redmine/
                #ProxyPass /redmine :8080/redmine
                #ProxyPassReverse /redmine :8080/redmine
                #these inside a container failed entirely
        </Directory>

        # Point / to redmine
                # ----------------------------------------------------------
        #Alias / :8080/redmine/ # Fails because the actual baseurl
                                #  is on a different box
        #RedirectMatch 301 ^/$ :8080/redmine/
        #ProxyPass http://HOSTNAME-01/redmine http://HOSTNAME-01:8080/redmine
        #ProxyPassReverse http://HOSTNAME-01/redmine http://HOSTNAME-01:8080/redmine
        #  RedirectMatch and ProxyPass both gave me a proxy to 
        #  http://sub.example.org/redmine/:8080/redmine/ 
        #  which is broken
Is there a better way to get a redirect to send sub.example.org/redmine to sub.example.org:8080/redmine? I might have to turn off the port 80 webserver entirely, then it would be an issue of putting an alias into the yaml file for redmine.
 
Old 01-18-2012, 04:30 PM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Hi,

You can use the following configuration (reverse proxy):
Code:
ProxyRequests     Off
ProxyPass /redmine http://127.0.0.1:8080/redmine
ProxyPassReverse /redmine http://127.0.0.1:8080/redmine
Regards
 
Old 01-18-2012, 08:49 PM   #3
saphil
LQ Newbie
 
Registered: Aug 2006
Location: Atlanta
Distribution: Ubuntu, Fedora, CEntOS, Linux Mint, PCLinux, AntiX, others
Posts: 12

Original Poster
Rep: Reputation: 2
Quote:
Originally Posted by bathory View Post
Hi,

You can use the following configuration (reverse proxy):
Code:
ProxyRequests     Off
ProxyPass /redmine http://127.0.0.1:8080/redmine
ProxyPassReverse /redmine http://127.0.0.1:8080/redmine
Regards
This sends me to http://sub.example.org/redmine/:8080/redmine
when I type http://sub.example.org/redmine in the address bar.
I am putting this in the /etc/apache2/sites-available/default file
should I be putting it in the mod_proxy.conf file instead?
/etc/apache2/mods-available/proxy.conf
 
Old 01-18-2012, 08:55 PM   #4
saphil
LQ Newbie
 
Registered: Aug 2006
Location: Atlanta
Distribution: Ubuntu, Fedora, CEntOS, Linux Mint, PCLinux, AntiX, others
Posts: 12

Original Poster
Rep: Reputation: 2
Nope, when it is in the mod_proxy it fails exactly the same way.
 
Old 01-19-2012, 12:22 AM   #5
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Hi,
Quote:
This sends me to http://sub.example.org/redmine/:8080/redmine
when I type http://sub.example.org/redmine in the address bar.
Are you sure it's not your browser cache? I guess you're restarting apache after making changes.

Quote:
I am putting this in the /etc/apache2/sites-available/default file
should I be putting it in the mod_proxy.conf file instead?
I'm not familiar with debian's apache config files, but I guess you need to put those directives in the sub.example.org vhost config (something like /etc/apache2/sites-enabled/<sub-example>), unless it's your default vhost.
Also try to put those directives outside of the <Directory ...></Directory> part.

Regards
 
1 members found this post helpful.
Old 01-19-2012, 08:37 AM   #6
saphil
LQ Newbie
 
Registered: Aug 2006
Location: Atlanta
Distribution: Ubuntu, Fedora, CEntOS, Linux Mint, PCLinux, AntiX, others
Posts: 12

Original Poster
Rep: Reputation: 2
I went a different route, in the end.
I had discovered the ProxyPass directives failed inside a container
The end solution was
inside the vhost file but outside of a location container:
Code:
Redirect 301 / http://sub.example.org:8080/redmine
Thanks for your help
 
  


Reply



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
[SOLVED] Where to write ProxyPass in apache2 tkmsr Linux - Server 4 04-24-2010 01:35 AM
Apache2 Redirect tommytomato Ubuntu 9 07-05-2009 08:52 PM
Apache2 redirect plk Linux - Server 7 11-27-2008 01:37 PM
Apache2: ProxyPass working fine on LAN, says Bad Gateway from outside... ishaqmalik Linux - Enterprise 0 05-31-2007 03:00 AM
Apache2 internal redirect? WopMaster8 Linux - Software 2 03-28-2005 01:25 AM

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

All times are GMT -5. The time now is 06:19 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