I'v followed this tutorial which is recommended by various tutorial to deploy Django.
This is the content of my 000-default.conf file ..
UPDATED ".conf" file
<VirtualHost *:80>
Alias /static /home/myproject/static
<Directory /home/myproject/static>
Require all granted
</Directory>
<Directory /home/myproject/myproject>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
WSGIDaemonProcess myproject python-home=/home/myproject/myprojectenv python-path=/home/myproject/myprojectenv/lib/python2.7/site-packages
WSGIProcessGroup myproject
WSGIScriptAlias / /home/myproject/myproject/wsgi.py
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
This is my first experience to deploy Django web-app on VPS which is equipped with "ubuntu-16.04-64bit".
I am able to fetch "myproject" Django app while virtualenv is activated and with Django default server like this:
./manage.py runserver 0.0.0.0:8000
and able to successfully open myproject app with my_ip, which is represented by "xx.xxx.xxx.xx" and port 8000.
http://xx.xxx.xxx.xx:8000
While, after deactivating the virtualenv and configuring the apache2 server as described by given tutorial its not working.
As tutorial says, after successful installation and configuring your Django app on server it should work only with your IP like this:
http://xx.xxx.xxx.xx
Which is not working in my case rather its showing "Waiting for xx.xxx.xxx.xx...." for infinity on browser.. and page shows error like this..
This site can’t be reached
xx.xxx.xxx.63 refused to connect.
Search Google for 188 167 8000
ERR_CONNECTION_REFUSED
And also its not producing any log for apache2
ErrorLog /home/error.log
CustomLog /home/access.log combined
I am struggling since morning but not succeeded please help...
UPDATE
Apache2 error log:
[Thu Nov 09 03:38:23.800566 2017] [core:warn] [pid 8823:tid 140238720010112] AH00045: child process 8827 still did not exit, sending a SIGTERM
[Thu Nov 09 03:38:25.802552 2017] [core:warn] [pid 8823:tid 140238720010112] AH00045: child process 8827 still did not exit, sending a SIGTERM
[Thu Nov 09 03:38:27.804431 2017] [core:warn] [pid 8823:tid 140238720010112] AH00045: child process 8827 still did not exit, sending a SIGTERM
[Thu Nov 09 03:38:29.805890 2017] [core:error] [pid 8823:tid 140238720010112] AH00046: child process 8827 still did not exit, sending a SIGKILL
[Thu Nov 09 03:38:30.806571 2017] [mpm_event:notice] [pid 8823:tid 140238720010112] AH00491: caught SIGTERM, shutting down
[Thu Nov 09 03:38:31.551724 2017] [mpm_event:notice] [pid 8960:tid 140082895366016] AH00489: Apache/2.4.7 (Ubuntu) mod_wsgi/3.4 Python/2.7.6 configured -- resuming normal operations
[Thu Nov 09 03:38:31.551837 2017] [core:notice] [pid 8960:tid 140082895366016] AH00094: Command line: '/usr/sbin/apache2'
ImportError: No module named site
ImportError: No module named site
ImportError: No module named site
ImportError: No module named site
ImportError: No module named site
this is my "wsgi.py" content
"""
WSGI config for myproject project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "myproject.settings")
application = get_wsgi_application()