Deploy Django in Apache in Windows, apachedjango
Win7/Apache/Python2.7/Django1.9 Web environment deployment: Windows7Apache httpd-2.4.16-win64-VC14Python2.7.11Django1.9.7 1, install Apache1) download the relevant components steps refer to the http://blog.csdn.net/qq_15096707/article/details/47319545 from the official http://httpd.apache.org download ApacheFiles for microsoft windows-> Apache Lounge-> after the httpd-2.4.16-win64-VC14 download is complete, we have to do is to decompress the file to the custom directory, find the bin directory in Apache24 and open ApacheMonitor.exe. If ApacheMonitor.exe cannot run, the system prompts that a file is missing, such as vcruntime1. 40. dll file, the VC library for installation response, I installed vc_redist.x64 (VC2015) 2) Modify httpd. line 37 of the conf configuration file: ServerRoot "apache directory" (e.g. change 'C:/apache24' to e:/apache34) ServerRoot "e:/apache24" Row 219: ServerName server name (e. g demo.app.com or 127.0.0.1) Remove # (localhost can also be entered here) ServerName 127.0.0.1 row 243: DocumentRoot modify the website root directory address DocumentRoot "e:/Apache24/htdocs" Row 244: <Directory "website root Directory address"> <Directory "e:/Apache24/htdocs"> Row 3: ScriptAlias/cgi-bin/"apach E directory +/cgi-bin/"ScriptAlias/cgi-bin/" e:/Apache24/cgi-bin/"Row 376: <Directory "apache Directory +/cgi-bin/"> <Directory "e:/Apache24/cgi-bin"> 3) run Command Line cmd to install the Apache service and start the command line in administrator mode, then run httpd-k install in the apache/bin directory. If it is restarted or uninstalled # restart the service httpd-k restart # uninstall the service httpd-k uninstall 4) after the Apache service is successfully started and tested, open ApacheMonitor.exe and click start. to test whether the service is successfully started, enter http in the browser: // localhost/"It works" 2. Deploy Django with reference to the http://blog.csdn.net/ying Mutongxue/article/details/43985559 1) download mod_wsgi download link http://www.lfd.uci.edu /~ Gohlke/pythonlibs/# mod_wsgi select the corresponding version of python2.7 and 64-bit system mod_wsgi-4.4.23 + ap24vc9-cp27-cp27m-win_amd64.whl decompress mod_wsgi.so and put it in the apache24/module folder at the beginning I downloaded the wrong version of this component resulting in apache the service cannot be started on the command line, enter the command httpd-w-n "apache2.4"-k start. The error message Cannot load modules/mod_wsgi.so into server is displayed on the screen and no error is reported after the correct version is changed. 2) modify the configuration file httpd. conf # Add mod_wsgi.so module LoadModule wsgi_module modules/mod_wsgi.so at the end of the document # specify wsgi for the myweb project. py configuration file path WSGIScriptAlias /" E:/code/wljk_workshop/wsgi. py "# specify the project path WSGIPythonPath" E:/code/wljk_workshop "<Directory E:/code/wljk_workshop> <Files wsgi. py> Require all granted </Files> </Directory> Alias/statics E:/code/wljk_workshop/statics <Directory E: /code/wljk_workshop/statics> Require all granted </Directory> 3) set settings. pyDEBUG = False TEMPLATE_DEBUG = FalseALLOWED_HOSTS = ['2017. 0.0.1 ', 'localhost'] 4) After troubleshooting the above settings Still unable to start the server. View apache24/logs/error [Thu Jun 30 18:30:54. 678499 2016] [mpm_winnt: notice] [pid 1776: tid 300] AH00455: Apache/2.4.16 (Win64) mod_wsgi/4.4.23 Python/2.7.11 configured -- resuming normal operations [Thu Jun 30 18:30:54. 678499 2016] [mpm_winnt: notice] [pid 1776: tid 300] AH00456: Apache Lounge VC14 Server built: Jul 22 2015 13:24:19 [Thu Jun 30 18:30:54. 678499 2016] [core: notice] [pid 1776: tid 300] AH00094: Command line: 'e: \ Apache24 \ bin \ httpd.exe-d E:/Apache24 '[Thu Jun 30 18:30:54. 678499 2016] [mpm_winnt: notice] [pid 1776: tid 300] AH00418: Parent: Created child process 5868 ImportError: No module named site [Thu Jun 30 18:30:55. 068500 2016] [mpm_winnt: crit] [pid 1776: tid 300] AH00419: master_main: create child process failed. exiting. error AH00419: master_main: create child process fail Ed reference http://stackoverflow.com/questions/34440078/apache24-x86-vc9-with-mod-wsgi-says-ah00419-master-main-create-child-process/35767105 Configuration Add: WSGIPythonPath "E:/code/wljk_workshop; E:/Python27/Lib; E:/Python27/Lib/site-packages; E: /Python27/DLLs "WSGIPythonHome" E:/Python27 "the server is successfully started and the website is successfully accessed. However, only local access is allowed at this time. When accessing other terminals, the system returns the 400 Bad request to modify settings. pyALLOWED_HOSTS = ['*']. The access is successful.