I am utilizing a framework that utilizes a complete-stack to show its web pages. This runs standard on port 9000. Very fine, however when starting production, the server appears to bar everything except a couple of standard ports.

Therefore, the framework (Play framework), recommends you to get this done inside your front-finish webserver (during my situation Apache2).

file: play.conf

<VirtualHost *:80>
  ServerName http://avon.ugent.be
  CustomLog /var/www/log/proxy-access.log common
  ErrorLog /var/www/log/proxy-error.log
  ProxyPreserveHost On
  DocumentRoot /var/www
  <Location /dev/app>
    AuthType Basic
    AuthName "Test Omgeving"
    AuthUserFile /var/trac/htpasswd
    Require valid-user

    ProxyPass http://127.0.0.1:9000/
    ProxyPassReverse http://127.0.0.1:9000/
  </Location>
</VirtualHost>

This obviously necessitates the mod_proxy module, that's being enabled with a2enmod mod_proxy. (I run this on the Debian distro)

The concept would be to run two webservers, one front-finish and something back-finish using the application. The reloading from the apache webserver works fine, the website is enabled and everything, however when I surf towards the http://my.website.com/dev/app url, it renders a 404... Suggestions what is going on wrong?


EDIT3: After 10+ hrs of attempting it boils lower for this: I discovered the debugging command (finally :p) which is the output:

apache2ctl -S
VirtualHost configuration:
wildcard NameVirtualHosts and _default_ servers:
*:80                   is a NameVirtualHost
         default server avon.ugent.be (/etc/apache2/sites-enabled/000-default:1)
         port 80 namevhost avon.ugent.be (/etc/apache2/sites-enabled/000-default:1)
         port 80 namevhost avon.ugent.be (/etc/apache2/sites-enabled/play.conf:1)
Syntax OK

Which signifies the virtual server is definitely being put into the configuration. But nonetheless, it renders a 404. Now, somewhere i have read like there's no index.html for the reason that path. Is the fact that necessary if you want to make use of a reverse proxy?

Thanks in advance! greetings,

Jasper

To begin with please use Location rather than Directory. Directory can be used for determining directory pathways around the filesystem not pathways in accordance with the document root.

<Location '/dev/app'>
  AuthType Basic
  AuthName "Test Omgeving"
  AuthUserFile /var/trac/htpasswd
  Require valid-user
</Location>

Try the next. It will prompt for that username/password after which pass the request to http://127.0.0.1:9000. During my situation, Apache provides a "Service Temporarily Unvavailable", which you need to get too should you switch off the applying running on port 9000

<VirtualHost *:80>
    ServerName my.website.com

    <Location /dev/app>
      AuthType Basic
      AuthName "Test Omgeving"
      AuthUserFile passwd/.htpasswd
      Require valid-user

      ProxyPass http://127.0.0.1:9000
      ProxyPassReverse http://127.0.0.1:9000
    </Location>
</VirtualHost>

Should you get a 404, are you able to make sure it isn't the after sales server delivering it?