Google Answers Logo
View Question
 
Q: Running Apache and AOLServer Together ( Answered,   0 Comments )
Question  
Subject: Running Apache and AOLServer Together
Category: Computers > Internet
Asked by: martin_sullivan-ga
List Price: $20.00
Posted: 15 Jan 2006 10:20 PST
Expires: 14 Feb 2006 10:20 PST
Question ID: 433691
Running Apache and AOLServer Together 

I want to do the following 
Run two web sites off one server using two different http daemons 

1 Apache listening on port 80 
2 AOLServer listening on port 8080 

The apache server will be accessed by using url http://s1.com 
The AOLServer will be accessed by using url http://s2.com 

The Names s1.com and s2.com are pointing at the same IP Address. 

If apache gets a request for www.s1.com it deals with it. 
If apache gets a request for www.s2.com it says not for me and 
Reads its proxy entry, which tells it go to AOLServer on port 8080 

The Proxy stuff is working on apache. 

Problem apache won't do this for me (I not sure if this scenario is even possible) 
My entry in the apache conf file is as follows. 

ProxyRequests Off 
<Proxy *> 
Order deny,allow 
Allow from all 
</Proxy> 
ProxyPass /s1.com http://s1.com:80/ 
ProxyPass /s2.com http://s2.com:8080/ 

Why such a ridiculous set-up (Very long story) 
I know about apache Virtual Hosting option but can't use it in this situation. 
Can you help?

Request for Question Clarification by bookface-ga on 20 Jan 2006 15:18 PST
This page has a fairly good description of the Reverse Proxy process
and what it is intended to do, which is not quite what you want to do
(but what you have currently in your config):
http://www.serverwatch.com/tutorials/article.php/10825_3290851_3

As you can see, the intention is for folder roots within the host to
be transferred to another web host, such as www.example.com/marketing
-> www.marketing.com -- your current config is set up to forward
http://s1.com/s2.com/ to http://s2.com.


I'm assuming http://s2.com:8080 will be available directly to the
user, based on what you wrote, and moreover that you have no problem
with the URL showing up in user's browsers as i.e.
http://s2.com:8080/directory/file.etc.html , but since I'm not sure
I'm posting this as a clarification request. The module you need to
know about is mod_rewrite, and it is handy for any number of URL
rewriting tasks.

Here is the official documentation:
http://httpd.apache.org/docs/2.0/misc/rewriteguide.html

This handy one-page document covers the most typical cases:
http://www.ilovejackdaniels.com/mod_rewrite_cheat_sheet.pdf

Finally, these are the specific lines you will need to your httpd.conf:
----------------------------------------------------------------------
# Forward s2.com to s2.com:8080

RewriteEngine on
RewriteCond   %{HTTP_HOST}     ^s2.com$   [NC]
RewriteRule   ^(.*)$           http://s2.com:8080/$1 [R=301,L]
----------------------------------------------------------------------
The NC makes the rewrite condition case-insensitive, the =301 is
optional and makes the forwarding show up as an HTTP message 301 Moved
Permanently. Another option is to use R=302, which will be Moved
Temporarily. Your choice depends on your content. For more
information, see:
  http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
  http://www.seomatrix.com/301-redirects.php
  http://www.404-error-page.com/301-apache-httpd.conf-redirect.shtml

Finally, this page explains how to handle what you're asking for, but
WITH VirtualHosts, should that become a possibility in the future:
http://www.experts-exchange.com/Web/Web_Servers/Apache/Q_21156806.html

I believe that VirtualHosts would be more efficient, but I could be
wrong -- I don't think there'd be too much of a difference either way.
I don't know that there's any other way besides those two to do what
you're asking, but there are a lot of extensions available for Apache.

- bookface-ga
Answer  
Subject: Re: Running Apache and AOLServer Together
Answered By: bookface-ga on 26 Jan 2006 07:06 PST
 
As a sufficient amount of time has passed, I assume my clarification
was helpful in providing you with a workable solution.


These are the specific lines you will need to your httpd.conf:
----------------------------------------------------------------------
# Forward s2.com to s2.com:8080

RewriteEngine on
RewriteCond   %{HTTP_HOST}     ^s2.com$   [NC]
RewriteRule   ^(.*)$           http://s2.com:8080/$1 [R=301,L]
----------------------------------------------------------------------

Thank you for choosing Google Answers!

- bookface-ga
Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy