Tag Archives: Apache

Apache: Setting up a simple reverse proxy

Hello,

this post describes how to setup a reverse proxy for a host. All http requests to host reverseproxy.domain.org should deliver the content of www.domain.org at Port 8080.

First you have to enable the requiered modules in httpd.conf


LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so

Then insert a virtual host directive:


<VirtualHost *>
    ServerName reverseproxy.domain.org
    ProxyRequests off
    ProxyPreserveHost On
    ProxyPass / http://www.domain.org:8080/
    ProxyPassReverse / http://www.domain.org:8080/
</VirtualHost>

That’s it.

Michael

Apache: Enable Server side includes SSI for a virtual directory

Hi,

short post as reminder how to enable Server Side Includes on a virtual directory.

mod_include must be enabled. MimeType for text/html must associated with .shtml file extension. Sample config for SSI looks like these:


<Directory "D:/user/www/virtualdirectory/">
    Options Indexes FollowSymLinks MultiViews ExecCGI Includes
    AllowOverride All
    Order allow ,deny
    Allow from all
    Require all granted
    AddType text/html .shtml
    AddOutputFilter INCLUDES .shtml
</Directory>

See you Michael

Apache: Alias directive for virtual directory returns HTTP Error 403

Hi,

I have added a virtual directory to an apache web server and the virtual directory is located outside the document root. I configured the httpd.conf how it is decripted in the apache doc

When I access the virtual directory an error “Access forbidden! Error 403” occured. The config seems to ok:

Alias /virtualdirectory/ "D:/user/www/virtual/"
<Directory "D:/user/www/virtual/">
   Options Indexes FollowSymLinks MultiViews ExecCGI
   AllowOverride All
   Order allow,deny
   Allow from all
</Directory>

Solution:

The default apache configration is very restrictive. It do not allow to access directories without authentication. This is defined in the Directory section of httpd.conf:


<Directory>
   AllowOverride none
   Require all denied
</Directory>

Add a “require all granted” directive to your virtual directory section will grant the access.

Alias /virtualdirectory/ "D:/user/www/virtual/"
<Directory "D:/user/www/virtual/">
   Options Indexes FollowSymLinks MultiViews ExecCGI
   AllowOverride All
   Order allow,deny
   Allow from all
   Require all granted
</Directory>