Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated django apache config for multiple websites #192

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 70 additions & 29 deletions Django_Blog/snippets/django_project.conf
Original file line number Diff line number Diff line change
@@ -1,52 +1,93 @@
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
#ServerName www.example.com

ServerName www.anovin.mk
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html

# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
Alias /static /home/anovindooel/apps/anovin/static
<Directory /home/anovindooel/apps/anovin/static>
Require all granted
</Directory>

Alias /media /home/anovindooel/apps/anovin/media
<Directory home/anovindooel/apps/journal/media>
Require all granted
</Directory>

<Directory /home/anovindooel/apps/anovin/portfolio>
<Files wsgi.py>
Require all granted
</Files>
</Directory>

WSGIScriptAlias / /home/anovindooel/apps/anovin/portfolio/wsgi.py
WSGIDaemonProcess django_app_anovin python-path=/home/anovindooel/apps/anovin python-home=home/anovindooel/apps/anovin/venv
WSGIProcessGroup django_app_anovin

</VirtualHost>

<VirtualHost *:80>

ServerName journal.anovin.mk
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

Alias /static /home/YOURUSER/YOURPROJECT/static
<Directory /home/YOURUSER/YOURPROJECT/static>
Alias /static /home/anovindooel/apps/journal/static
<Directory /home/anovindooel/apps/journal/static>
Require all granted
</Directory>

Alias /media /home/YOURUSER/YOURPROJECT/media
<Directory /home/YOURUSER/YOURPROJECT/media>
Alias /media /home/anovindooel/apps/journal/media
<Directory home/anovindooel/apps/journal/media>
Require all granted
</Directory>

<Directory /home/YOURUSER/YOURPROJECT/YOURPROJECT>
<Directory /home/anovindooel/apps/journal/sci>
<Files wsgi.py>
Require all granted
</Files>
</Directory>

WSGIScriptAlias / /home/YOURUSER/YOURPROJECT/YOURPROJECT/wsgi.py
WSGIDaemonProcess django_app python-path=/home/YOURUSER/YOURPROJECT python-home=/home/YOURUSER/YOURPROJECT/venv
WSGIProcessGroup django_app
WSGIScriptAlias / /home/anovindooel/apps/journal/sci/wsgi.py
WSGIDaemonProcess django_app_journal python-path=/home/anovindooel/apps/journal python-home=home/anovindooel/apps/journal/venv
WSGIProcessGroup django_app_journal

</VirtualHost>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

<VirtualHost *:80>

ServerName anovski.anovin.mk
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

Alias /static /home/anovindooel/apps/anovski/static
<Directory /home/anovindooel/apps/anovski/static>
Require all granted
</Directory>

Alias /media /home/anovindooel/apps/anovski/media
<Directory home/anovindooel/apps/anovski/media>
Require all granted
</Directory>

<Directory /home/anovindooel/apps/anovski/portfolio>
<Files wsgi.py>
Require all granted
</Files>
</Directory>

WSGIScriptAlias / /home/anovindooel/apps/anovski/portfolio/wsgi.py
WSGIDaemonProcess django_app_anovski python-path=/home/anovindooel/apps/anovski python-home=home/anovindooel/apps/anovski/venv
WSGIProcessGroup django_app_anovski

</VirtualHost>