CentOS7
Install Apache and mod_wsgi
(ApacheでWSGIを使用する為のインストール)
sudo yum -y update
sudo yum -y install mod_wsgi
Enable Software Collections
(WSGIを使用するためにhttpd-develをインストール)
sudo yum -y install httpd-devel
/etc/httpd/conf.d/django_project_name.conf
(バーチャルホスト設定を記述)
<VirtualHost *:80>
ServerAdmin info@enjineer-notes.com
ServerName django-project-name.enjineer-notes.com
DocumentRoot /var/www/
Alias /static /var/www/django_project_name/static
<Directory "/var/www/django_project_name/static">
Options FollowSymLinks
Order allow,deny
Allow from all
Require all granted
</Directory>
Alias /media /var/www/django_project_name/media
<Directory "/var/www/django_project_name/media">
Options FollowSymLinks
Order allow,deny
Allow from all
Require all granted
</Directory>
ErrorLog /var/www/django_project_name/logs/apis_error.log
CustomLog /var/www/django_project_name/logs/apis_access.log combined
WSGIPassAuthorization On
WSGIDaemonProcess outstanding python-path=/var/www/outstanding:/var/www/django_project_name/venv/lib/python3.7/site-packages
WSGIProcessGroup outstanding
WSGIScriptAlias / /var/www/django_project_name/django_application_name/wsgi.py
<Directory /var/www/django_project_name/django_application_name>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
</VirtualHost>