Skip to content

Instantly share code, notes, and snippets.

@NathanWailes
Last active January 14, 2019 08:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NathanWailes/eb26ff1119b704c5eb5d3be36967aebf to your computer and use it in GitHub Desktop.
Save NathanWailes/eb26ff1119b704c5eb5d3be36967aebf to your computer and use it in GitHub Desktop.
/etc/apache2/sites-available/rhymecraft.conf
WSGIDaemonProcess rhymecraft.guru processes=2 threads=15 display-name=%{GROUP}
WSGIProcessGroup rhymecraft.guru
<VirtualHost *:80>
ServerName www.rhymecraft.guru
ServerAlias rhymecraft.guru
ServerAdmin nathan.wailes@gmail.com
# The proxy stuff below is for Confluence
# See https://confluence.atlassian.com/kb/proxying-atlassian-server-applications-with-apache-http-server-mod_proxy_http-806032611.html
ProxyRequests Off
<Proxy *>
Require all granted
</Proxy>
ProxyPass /synchrony http://localhost:8091/synchrony
<Location /synchrony>
Require all granted
RewriteEngine on
RewriteCond %{HTTP:UPGRADE} ^WebSocket$ [NC]
RewriteCond %{HTTP:CONNECTION} Upgrade$ [NC]
RewriteRule .* ws://127.0.0.1:8091%{REQUEST_URI} [P]
</Location>
ProxyPass /wiki http://localhost:8090/wiki
ProxyPassReverse /wiki http://localhost:8090/wiki
<Location /wiki>
Require all granted
</Location>
Alias /blog /var/www/html
WSGIScriptAlias / /var/www/rhymecraft/server/rhymecraft.wsgi
DocumentRoot /var/www/rhymecraft/server
Alias /robots.txt /var/www/rhymecraft/server/robots.txt
Alias /favicon.ico /var/www/rhymecraft/server/robots.txt
<Directory /var/www/rhymecraft/server>
Order allow,deny
Allow from all
</Directory>
Alias /static /var/www/rhymecraft/server/static
ErrorLog ${APACHE_LOG_DIR}/error.log
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
# RewriteEngine on
# RewriteCond %{SERVER_NAME} =www.rhymecraft.guru [OR]
# RewriteCond %{SERVER_NAME} =rhymecraft.guru
# RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
<VirtualHost *:443>
ServerName www.rhymecraft.guru
ServerAlias rhymecraft.guru
ServerAdmin nathan.wailes@gmail.com
Alias /blog /var/www/html
WSGIScriptAlias / /var/www/rhymecraft/server/rhymecraft.wsgi
DocumentRoot /var/www/rhymecraft/server
Alias /robots.txt /var/www/rhymecraft/server/robots.txt
Alias /favicon.ico /var/www/rhymecraft/server/robots.txt
<Directory /var/www/rhymecraft/server>
Order allow,deny
Allow from all
</Directory>
Alias /static /var/www/rhymecraft/server/static
ErrorLog ${APACHE_LOG_DIR}/error.log
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/rhymecraft.guru/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/rhymecraft.guru/privkey.pem
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment