LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
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 06-17-2011, 08:22 PM   #1
vockleya
Member
 
Registered: Aug 2009
Posts: 87

Rep: Reputation: 16
Apache rewrite help


I am trying to set up my server and am having some trouble. I need to have webmin proxied through apache, so that I can access it from https://www.mysite.com/webmin/. I have it working if I type that directly into a browser, but the next part is not working correctly. If someone types http://www.mysite.com/webmin/, I want it to automatically redirect to the secure site.

My current setup is as follows:

https virtual server:
Code:
ProxyPass /webmin/ http://localhost:10000/
ProxyPassReverse /webmin/ http://localhost:10000/
<proxy *>
        allow from all
</proxy>
This works just fine.

http virtual server:
Code:
<Directory /home/aaron/web-root/webmin/>
        RewriteEngine On
        RewriteCond %{HTTPS} off
        RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}https://www.vockley.com/webmin/
</Directory>
This doesn't work. I believe it is because the /webmin/ directory does not actually exist in /web-root/. It is just a proxied link. Apache give this error message when I try to access Webmin through this method:
Code:
[error] [client **.***.**.***] File does not exist: /home/aaron/web-root/webmin
Notice there is no trailing "/" on that path. There should be in order for the proxy in the https virtual server to pick up on it.

I just set up phymyadmin using the same directives. The same problem is occurring with this too. Apache is looking for /home/aaron/web-root/phpmyadmin instead of /home/aaron/web-root/phpmyadmin/.

Any thoughts?

I hope this explanation is good enough. I'll do my best to answer any questions. Any help will be greatly appreciated.

Last edited by vockleya; 06-17-2011 at 08:52 PM.
 
Old 06-17-2011, 11:36 PM   #2
vockleya
Member
 
Registered: Aug 2009
Posts: 87

Original Poster
Rep: Reputation: 16
I discovered the solution. I needed to use <Location> instead of <Directory> to control access to the proxies.
 
1 members found this post helpful.
  


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 Rewrite mahmoud Linux - Software 2 11-11-2008 07:52 AM
Apache Rewrite mahmoud Linux - Newbie 2 10-08-2008 08:11 AM
Apache rewrite rule help kinetik Linux - Software 1 11-05-2007 11:18 AM
apache rewrite help deesto Linux - Server 3 11-03-2006 02:07 PM
Need help with Apache rewrite kinetik Linux - General 6 05-19-2006 06:02 AM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration