You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Augusto Casagrande <au...@gmail.com> on 2010/09/23 04:07:05 UTC

[users@httpd] Redirect public server to internal server

Hi,
I have a very common problem.
I'm running one Apache 2.2.0 server on the Dmz. I have another Apache
server on the Lan.
I need to have my Lan Apache accesible on internet.
My vhosts configuration on the Dmz Apache is :

<VirtualHost *:80>
DocumentRoot /srv/www/htdocs/
ServerName host2.example.com
<Directory "/srv/www/htdocs/">
allow from all
Options +Indexes
</Directory>
</VirtualHost>


<VirtualHost *:443>
DocumentRoot /srv/www/htdocs/squirrelmail
<Directory "/srv/www/htdocs/squirrelmail">
allow from all
Options +Indexes
</Directory>
ServerName host2.example.com
SSLEngine on
SSLCertificateFile /etc/apache2/ssl.crt/server.crt
SSLCertificateKeyFile /etc/apache2/ssl.key/server.key
</VirtualHost>

--- So far so good, so i create a new vhost

<VirtualHost *:*>
DocumentRoot /srv/www/htdocs/share
ServerName example.com
ProxyRequests Off
<Proxy *>
       Order deny,allow
       Allow from all
</Proxy>
ProxyPass / http://internal-ip-apache-server/
</VirtualHost>

I execute an Apache restart , but pointing at www.example.com/share i
can't get my internal redirect. I'm only viewing my " share
"directory.
I'm not seeing any error in my access_log or error_log.
I have also enabled the proxy modules :

 # a2enmod -l
actions alias auth_basic authn_file authz_host authz_groupfile
authz_default authz_user authn_dbm autoindex cgi dir env expires
include log_config mime negotiation setenvif ssl suexec userdir php5
mod_proxy mod_proxy_http

Any help will be apreciated.
Thanks!

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: Re: [users@httpd] Redirect public server to internal server

Posted by Eric Covener <co...@gmail.com>.
On Thu, Sep 23, 2010 at 8:10 PM, Augusto Casagrande
<au...@gmail.com> wrote:
> Yes , here it is :
>
> <VirtualHost *:80>
> DocumentRoot /srv/www/htdocs/share
> ServerName www.example/share/

ServerName is just a domain name.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: Re: [users@httpd] Redirect public server to internal server

Posted by Augusto Casagrande <au...@gmail.com>.
Yes , here it is :

<VirtualHost *:80>
DocumentRoot /srv/www/htdocs/share
ServerName www.example/share/
ProxyRequests Off
<Proxy *>
       Order deny,allow
       Allow from all
</Proxy>
ProxyPass / http://internal-ip-server
</VirtualHost>


2010/9/23 Eric Covener <co...@gmail.com>:
> On Thu, Sep 23, 2010 at 1:52 PM,  <au...@gmail.com> wrote:
>> I've added NameVirtualHost *:80 to the listen.conf file.
>
>> But still it is not working. Same as before , only shows my "share"
>> directory.
>
>
> Did you add a VirtualHost with *:80 and put your proxy directives in it?
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: Re: [users@httpd] Redirect public server to internal server

Posted by Eric Covener <co...@gmail.com>.
On Thu, Sep 23, 2010 at 1:52 PM,  <au...@gmail.com> wrote:
> I've added NameVirtualHost *:80 to the listen.conf file.

> But still it is not working. Same as before , only shows my "share"
> directory.


Did you add a VirtualHost with *:80 and put your proxy directives in it?

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: Re: [users@httpd] Redirect public server to internal server

Posted by au...@gmail.com.
I've added NameVirtualHost *:80 to the listen.conf file.

But still it is not working. Same as before , only shows my "share"  
directory.

Thanks!

El 23/09/2010 07:41, Eric Covener <co...@gmail.com> escribió:
> >

> >

> >



> The VirtualHost you added would only be selected when the more

> specific matches (port 80, port 443) were not applicable.



> You should make sure you have one NameVirtualHost *:80 and just add a

> second with the proper ServerName.





> --

> Eric Covener

> covener@gmail.com



> ---------------------------------------------------------------------

> The official User-To-User support forum of the Apache HTTP Server Project.

> See http://httpd.apache.org/userslist.html> for more info.

> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org

> " from the digest: users-digest-unsubscribe@httpd.apache.org

> For additional commands, e-mail: users-help@httpd.apache.org




Re: [users@httpd] Redirect public server to internal server

Posted by Eric Covener <co...@gmail.com>.
> <VirtualHost *:80>
> <VirtualHost *:443>
> <VirtualHost *:*>

The VirtualHost you added would only be selected when the more
specific matches (port 80, port 443) were not applicable.

You should make sure you have one NameVirtualHost *:80 and just add a
second <VirtualHost *:80> with the proper ServerName.


-- 
Eric Covener
covener@gmail.com

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org