Skip to content

Instantly share code, notes, and snippets.

@SmiddyPence
Last active December 22, 2015 16:28
Show Gist options
  • Save SmiddyPence/6499394 to your computer and use it in GitHub Desktop.
Save SmiddyPence/6499394 to your computer and use it in GitHub Desktop.
Neo4J Apache Configuration for Application and Web Admin
Details on how to configure Apache to serve both a web application and the Neo4J Webadmin
<VirtualHost *:80>
ServerName mydomian.com
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass / http://localhost:8080/
ProxyPassReverse / http://localhost:8080/
ErrorLog /var/www/mydomian.com/logs/error.log
</VirtualHost>
<VirtualHost *:7474>
ServerName mydomian.com
<Proxy *>
Order deny,allow
Allow from all
AuthType Basic
AuthUserFile /srv/auth/.htpasswd
AuthName "Login:"
Require valid-user
AddOutputFilterByType SUBSTITUTE application/json
Substitute "s|http://localhost:7474/db/manage|http://mydomian.com:7474/db/manage|i"
Substitute "s|http://localhost:7474/db/data|http://mydomian.com:7474/db/data|i"
</Proxy>
ProxyPass / http://localhost:7474/
ProxyPassReverse / http://localhost:7474/
ErrorLog /var/www/size.me.uk/logs/error.log
</VirtualHost>
# If you just change the port or add more ports here, you will likely also
# have to change the VirtualHost statement in
# /etc/apache2/sites-enabled/000-default
# This is also true if you have upgraded from before 2.2.9-3 (i.e. from
# Debian etch). See /usr/share/doc/apache2.2-common/NEWS.Debian.gz and
# README.Debian.gz
NameVirtualHost *:80
Listen 80
NameVirtualHost *:7474
Listen *:7474
<IfModule mod_ssl.c>
# If you add NameVirtualHost *:443 here, you will also have to change
# the VirtualHost statement in /etc/apache2/sites-available/default-ssl
# to <VirtualHost *:443>
# Server Name Indication for SSL named virtual hosts is currently not
# supported by MSIE on Windows XP.
Listen 443
</IfModule>
<IfModule mod_gnutls.c>
Listen 443
</IfModule>
<IfModule mod_proxy.c>
#turning ProxyRequests on and allowing proxying from all may allow
#spammers to use your proxy to send email.
ProxyRequests Off
<Proxy *>
AddDefaultCharset off
Order deny,allow
Deny from all
Allow from localhost
</Proxy>
# Enable/disable the handling of HTTP/1.1 "Via:" headers.
# ("Full" adds the server version; "Block" removes all outgoing Via: headers)
# Set to one of: Off | On | Full | Block
ProxyVia On
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment