Apache2 Virtual Host Configuration
This is an Apache2 configuration file for name based virtual hosting.
As you can see in the following listing, there are several placeholders,that must be filled to make this work.
As you may notice, there are three different types of placeholders.
[[placeholder_name]]These placeholders must be filled manually. Most noticable is line 4,where you must set the server name.
ServerName[[SERVER_NAME]]
${placeholder_name}These placeholders are filled by Apache itsself. Only mess with them, ifyou do exactly know what you are doing.{{ placeholder_name }}These placeholders do look familiar, don’t they? These are Djangotemplatetags. You may fill them manually (please refer to the providedresources in the comments), but you can Django let them fill them for youduring project creation. This will render the file through Django’stemplate engine and fill these placeholders:
This will set up a name based virtual host that uses mod_wsgi to interactwith Django.
It will serve static- and media-files from the default locations set insettings/common.py. This is not a production-setting, but is well suitedfor development purposes.
Line 10: Alias /static/ {{ project_directory }}/run/staticServe static files from STATIC_ROOT under STATIC_URL. Note lines36 - 40, where the directory is made accessible for Apache.Line 15: Alias /media/{{ project_directory }}/run/mediaServe media files from MEDIA_ROOT under MEDIA_URL. Note lines45 - 49, where the directory is made accessible for Apache.The dynamic Django content is served using the WSGI-application. Apache2 willuse mod_wsgi in Daemon-mode. This is in fact the preferred way of deployingDjango with Apache2, so you will not have to mess with these settings.
Line 18: WSGIScriptAlias/ {{ project_directory }}/{{ project_name }}/wsgi.pyThis must be set to the absolute filesystem path to the WSGI-application.Line 27: WSGIDaemonProcess ...This sets the name of the daemon process. Using Django’s template engine,this will be set to the name of your project. Please notice thepython-path-parameter. It is prepared to a virtualenv-setup, butfrankly, it must contain the project directory and the path to Python’ssite-packages.Line 31: WSGIProcessGroup ...Specifies a distinct name for the daemon process’s group.PREV: A dns server cannot be used ps4;Problems playing online with ...
NEXT: DNS Server Not Responding PS4 Fix - Actionable Solution (2021)