Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Server Operation

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 23rd April 2010, 08:27
vtapas vtapas is offline
Member
 
Join Date: Apr 2010
Posts: 51
Thanks: 1
Thanked 0 Times in 0 Posts
Default some misconfiguration in making a reverse proxy not clear what went wrong

I want to host sites.
http://www.myserver.com
http://site1.myserver.com
I have a public IP rest is on LAN.The main site is on public IP and want any request on site1.myserver.com to be redirected to internal LAN web server which will process the requests.
I am using a Debian Lenny and apache2.

In an earlier post on the forum I was able to configure Apache Reverse Proxy
by changing apache2.conf
the sites hosted at that time were
http://www.myserver.com
http://www.myserver.com/site1

Now I have formatted my server and it is a fresh installation of Debian Lenny and apache2 on it so previous settings are not there.
This time I created two virtual hosts.There are two files in /etc/apache2/apache2.conf
site1.myserver.com
and myserver.com
then
a2ensite myserver.com
a2ensite site1.myserver.com

The configuration of these are as follows
/etc/apache2/sites-available/myserver.com
contains
Code:
NameVirtualHost 10.10.10.10:80
NameVirtualHost 192.168.1.14:80
<VirtualHost 192.168.1.14:80 10.10.10.10:80>
#10.10.10.10 is  my public IP
#The above idea was from apache documentation http://httpd.apache.org/docs/2.0/vhosts/examples.html
        ServerAdmin webmaster@localhost
        ServerName myserver.com
        DocumentRoot /var/www/
        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory /var/www/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
        </Directory>

        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        <Directory "/usr/lib/cgi-bin">
                AllowOverride None
                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Order allow,deny
                Allow from all
        </Directory>

        ErrorLog /var/log/apache2/error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

        CustomLog /var/log/apache2/access.log combined

    Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>

</VirtualHost>
and the file
/etc/apache2/sites-available/site1.myserver.com
has


Code:
NameVirtualHost 10.10.10.10:80
NameVirtualHost 192.168.1.14:80
<VirtualHost 192.168.1.14:80 10.10.10.10:80>
#10.10.10.10 is  my public IP
#The above idea was from apache documentation http://httpd.apache.org/docs/2.0/vhosts/examples.html
        ServerAdmin webmaster@localhost
        ServerName site1.myserver.com
        DocumentRoot /var/www/
        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
         ProxyRequests off
        <Proxy *>
        Order deny,allow
        Allow from all
        </Proxy>
        ProxyPass / http://192.168.1.6/
        ProxyPassReverse / http://192.168.1.16/
       
 
        <Directory /var/www/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
        </Directory>

        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        <Directory "/usr/lib/cgi-bin">
                AllowOverride None
                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Order allow,deny
                Allow from all
        </Directory>

        ErrorLog /var/log/apache2/error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

        CustomLog /var/log/apache2/access.log combined

    Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>

</VirtualHost>
Then /etc/init.d/apache2 restart .Now If I point my browser to
http://www.myserver.com
or http://site1.myserver.com
they both are pointing to same site http://www.myserver.com

I do not have access to DNS.
In my /etc/hosts
I have
Code:
127.0.0.1       localhost
192.168.1.14  myserver.com myserver
192.168.1.6   site1.myserver.com site1
I wasted 24 hours on this went through
http://httpd.apache.org/docs/2.2/vhosts/name-based.html
http://httpd.apache.org/docs/2.0/dns-caveats.html
http://httpd.apache.org/docs/2.0/vhosts/
but still I am not able to catch the problem.
There is no URL rewriting till now.
Reply With Quote
Sponsored Links
  #2  
Old 23rd April 2010, 10:08
Mark_NL Mark_NL is offline
Senior Member
 
Join Date: Sep 2008
Location: The Netherlands
Posts: 912
Thanks: 12
Thanked 100 Times in 96 Posts
Default

Quote:
Originally Posted by vtapas View Post
I want to host sites.
http://www.myserver.com
http://site1.myserver.com
I have a public IP rest is on LAN.The main site is on public IP and want any request on site1.myserver.com to be redirected to internal LAN web server which will process the requests.
1. What do you mean with "the rest is on LAN", define "the rest" (another webserver f.e.?)
2. If someone from the outside requests site1.myserver.com, it should go to your public IP and then redirected to some internal ip??
Reply With Quote
  #3  
Old 23rd April 2010, 10:32
vtapas vtapas is offline
Member
 
Join Date: Apr 2010
Posts: 51
Thanks: 1
Thanked 0 Times in 0 Posts
 
Default

Quote:
Originally Posted by Mark_NL View Post
1. What do you mean with "the rest is on LAN", define "the rest" (another webserver f.e.?)
Yes the rest means other websites.In the question I have taken it as site1.myserver.com

Quote:
Originally Posted by Mark_NL View Post
2. If someone from the outside requests site1.myserver.com, it should go to your public IP and then redirected to some internal ip??
Yes.I was able to resolve the problem both Document Roots were pointing to same locations I deleted Document Root and then it is working now.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Transparent reverse squid proxy d31373 Installation/Configuration 5 22nd November 2009 21:44
can't help ispconfig to install please help steve51184 Installation/Configuration 17 20th February 2009 11:37
Mod_Perl Configuration Issue szise Installation/Configuration 4 28th November 2008 13:41
ISPConfig install issues... flyingaggie Installation/Configuration 2 18th July 2008 11:46
Installation Troubles bswinnerton Installation/Configuration 4 29th July 2007 17:56


All times are GMT +2. The time now is 08:50.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.