Open source software supply chain lighting plan, waiting for you>>>
environment: Ubuntu 16.04.1 + Django 1.11.15 + Apache 2.4.18 + Python 3.5
for the steps mentioned in this article, please refer to the steps in the following links
Baidu cloud’s Ubuntu 16.04.1 deployment of Apache server + Django project
build the project on the virtual machine, and restart the error reported by Apache in the fourth step
error information:
Job for apache2.service failed because the control process exited with error code. See “systemctl status apache2.service” and “journalctl -xe” for details.
follow the prompts and use journalctl – Xe to open the error log
is displayed as follows:
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit apache2.service has begun starting up.
Aug 08 10:41:17 instance-4xi7rrkf apache2[10930]: * Starting Apache httpd web server apache2
Aug 08 10:41:17 instance-4xi7rrkf apache2[10930]: *
Aug 08 10:41:17 instance-4xi7rrkf apache2[10930]: * The apache2 configtest failed.
Aug 08 10:41:17 instance-4xi7rrkf apache2[10930]: Output of config test was:
Aug 08 10:41:17 instance-4xi7rrkf apache2[10930]: apache2: Syntax error on line 219 of /etc/apache2/apache
Aug 08 10:41:17 instance-4xi7rrkf apache2[10930]: Action 'configtest' failed.
Aug 08 10:41:17 instance-4xi7rrkf apache2[10930]: The Apache error log may have more information.
Aug 08 10:41:17 instance-4xi7rrkf systemd[1]: apache2.service: Control process exited, code=exited status=
Aug 08 10:41:17 instance-4xi7rrkf systemd[1]: Failed to start LSB: Apache2 web server.
-- Subject: Unit apache2.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit apache2.service has failed.
--
-- The result is failed.
Aug 08 10:41:17 instance-4xi7rrkf systemd[1]: apache2.service: Unit entered failed state.
Aug 08 10:41:17 instance-4xi7rrkf systemd[1]: apache2.service: Failed with result 'exit-code'.
Aug 08 10:41:22 instance-4xi7rrkf sshd[10964]: Connection closed by 5.188.218.246 port 34880 [preauth]
according to the error prompt: 219 line configuration error in/etc/apache2/apache.conf file
open the prompt file, and find line 219:
(VIM display line number: press ESC key, enter (: set nu)) )
218 # Include the virtual host configurations:
219 IncludeOptional sites-enabled/*.conf
change the 219 line configuration file to: tip.conf is the name of the network configuration file in the second step
218 # Include the virtual host configurations:
219 IncludeOptional sites-enabled/tip.conf
at this time, the Apache service can be restarted
quickly open the website:
the errors are as follows:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator at [no address given] to inform them of the time this error occurred,
and the actions you performed just before this error.
More information about this error may be available in the server error log.
Apache/2.4.18 (Ubuntu) Server at www.py6web.com Port 80
view the error log of apache2
switch to: CD/var/log/apache2 at this time
you will find that there are two more error log files in the folder
root@instance-4xi7rrkf:/var/log/apache2# ls
access.log django-tip-error.log error.log other_vhosts_access.log tip-django.log
open the error log and view the error information:
[Wed Aug 08 10:49:22.535845 2018] [wsgi:error] [pid 11109:tid 140181583668992] [client 106.121.68.131:64773] import pymysql
[Wed Aug 08 10:49:22.535881 2018] [wsgi:error] [pid 11109:tid 140181583668992] [client 106.121.68.131:64773] ImportError: No module named 'pymysql'
Obviously, there are fewer pymysql modules. After installing pymysql with PIP3 install, the website can be accessed normally (for other similar information, you’d better switch to the root user)
Switch root user: sudo Su
Similar Posts:
- The state of nginx is the failed solution
- nginx.service – A high performance web server and a reverse proxy server
- About the Ubuntu configuration file apache2 httpd.conf position
- [Solved] main process exited, code=exited, status=203/EXEC
- Job for mysqld.service failed because the control process exited with error code
- [Solved] Linux starts MySQL service Error: Error code = exited, status = 127
- Shell script error: Exec format error [How to Solve]
- [Solved] Docker error: Error starting daemon: Error initializing network controller: list bridge addresses failed: no available network
- Centos7 Restart NIC error: Job for network.service failed because the control process exited with error code
- [Solved] Centos7 linux ailed to stop iptables.service: Unit iptables.service not loaded.