~> sudo apt-get install libapache2-mod-proxy-html
~> a2enmod proxy_http
Edit your virtual host:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<VirtualHost *:80> | |
... | |
ProxyPass /api http://127.0.0.1:28017 | |
ProxyPassReverse /api http://127.0.0.1:28017 | |
<Directory "FOLDER"> | |
... | |
</Directory> | |
</VirtualHost> |
Configure the module to allow connections from your network, edit /etc/apache2/mods-enabled/proxy.conf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<IfModule mod_proxy.c> | |
ProxyRequests Off | |
<Proxy *> | |
AddDefaultCharset off | |
Order deny,allow | |
Deny from all | |
Allow from 192.168.8.0/24 | |
</Proxy> | |
ProxyVia On | |
</IfModule> |
Restart apache and you are ready to go!.
Possible errors you could get
If you get this error in /var/log/apache2/error.log :
[error] [client 192.168.56.1] client denied by server configuration: proxy:http://127.0.0.1:28017/folder/
You have to check the "Allow" directive in /etc/apache2/mods-enabled/proxy.conf remember to allow your network!!!.
[error] [client 192.168.56.1] client denied by server configuration: proxy:http://127.0.0.1:28017/folder/
You have to check the "Allow" directive in /etc/apache2/mods-enabled/proxy.conf remember to allow your network!!!.
If you get this error in /var/log/apache2/error.log :
[warn] proxy: No protocol handler was valid for the URL /api/. If you are using a DSO version of mod_proxy, make sure the proxy submodules are included in the configuration using LoadModule.
you should remember to enable the module:
~> a2enmod proxy_http
you should remember to enable the module:
~> a2enmod proxy_http
Your this blog is very informative and interesting. Keep doing this type of great work.
ResponderBorraraccess eMp3World in UK