Django 생산 환경의 배치 - Apache - modwsgi
6241 단어 apache.
ServerSignature On
ServerTokens Full
Define APACHE24 Apache2.4
Define SERVER_BASE_DIR "D:/ProgramFiles/wamp" # WAMP,
Define PYTHON_PATH "C:/Python27" # Python PATH
Define VIRTUALENV_HOME "D:/ProgramFiles/V" # PATH
Define PROJECT_BASE_DIR "E:/Users/zhangsan/Codes" # PATH
Define DEMO_PORT 8080 #
ServerRoot "${SERVER_BASE_DIR}/bin/apache/apache2.4.9"
WSGIPythonHome "${PYTHON_PATH}"
WSGIPythonPath "${VIRTUALENV_HOME}/o/Lib/site-packages"
Listen 0.0.0.0:80
Listen [::0]:80
Listen ${DEMO_PORT}
# module WAMP ,
LoadModule access_compat_module modules/mod_access_compat.so
LoadModule actions_module modules/mod_actions.so
LoadModule alias_module modules/mod_alias.so
LoadModule allowmethods_module modules/mod_allowmethods.so
LoadModule asis_module modules/mod_asis.so
LoadModule auth_basic_module modules/mod_auth_basic.so
LoadModule authn_core_module modules/mod_authn_core.so
LoadModule authn_file_module modules/mod_authn_file.so
LoadModule authz_core_module modules/mod_authz_core.so
LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
LoadModule authz_host_module modules/mod_authz_host.so
LoadModule authz_user_module modules/mod_authz_user.so
LoadModule autoindex_module modules/mod_autoindex.so
LoadModule cache_module modules/mod_cache.so
LoadModule cache_disk_module modules/mod_cache_disk.so
LoadModule cgi_module modules/mod_cgi.so
LoadModule deflate_module modules/mod_deflate.so
LoadModule dir_module modules/mod_dir.so
LoadModule env_module modules/mod_env.so
LoadModule file_cache_module modules/mod_file_cache.so
LoadModule include_module modules/mod_include.so
LoadModule isapi_module modules/mod_isapi.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule mime_module modules/mod_mime.so
LoadModule negotiation_module modules/mod_negotiation.so
LoadModule setenvif_module modules/mod_setenvif.so
LoadModule vhost_alias_module modules/mod_vhost_alias.so
# LoadModule that project may needed
LoadModule filter_module modules/mod_filter.so
LoadModule headers_module modules/mod_headers.so
LoadModule mime_magic_module modules/mod_mime_magic.so
LoadModule proxy_module modules/mod_proxy.so # ,
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule proxy_wstunnel_module modules/mod_proxy_wstunnel.so
LoadModule wsgi_module modules/mod_wsgi.so # .
<Files *.css>
Header set Content-type "text/css"
</Files>
<Files *.js>
Header set Content-type "application/javascript"
</Files>
LoadModule php5_module "D:/ProgramFiles/wamp/bin/php/php5.5.12/php5apache2_4.dll"
<IfModule unixd_module>
User daemon
Group daemon
</IfModule>
ServerAdmin [email protected]
ServerName localhost:80
HostnameLookups Off
DocumentRoot "${SERVER_BASE_DIR}/www/"
<Directory />
AllowOverride none
## Require all denied
Require all granted
</Directory>
<Directory "${SERVER_BASE_DIR}/www/">
Options Indexes FollowSymLinks
AllowOverride all
Require local
</Directory>
<IfModule dir_module>
DirectoryIndex index.php index.php3 index.html index.htm
</IfModule>
<Files ".ht*">
Require all denied
</Files>
ErrorLog "${SERVER_BASE_DIR}/logs/apache_error.log"
LogLevel warn
<IfModule log_config_module>
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
<IfModule logio_module>
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
</IfModule>
CustomLog "${SERVER_BASE_DIR}/logs/access.log" common
</IfModule>
<IfModule alias_module>
ScriptAlias /cgi-bin/ "${SERVER_BASE_DIR}/bin/apache/apache2.4.9/cgi-bin/"
</IfModule>
<IfModule cgid_module>
</IfModule>
<Directory "${SERVER_BASE_DIR}/bin/apache/apache2.4.9/cgi-bin">
AllowOverride None
Options None
Require all granted
</Directory>
<IfModule mime_module>
TypesConfig conf/mime.types
AddEncoding x-compress .Z
AddEncoding x-gzip .gz .tgz
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
AddType application/x-httpd-php .php
AddType application/x-httpd-php .php3
</IfModule>
EnableSendfile off
AcceptFilter http none
AcceptFilter https none
Include conf/extra/httpd-autoindex.conf
<IfModule proxy_html_module>
Include conf/extra/proxy-html.conf
</IfModule>
<IfModule ssl_module>
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</IfModule>
Include "${SERVER_BASE_DIR}/alias/*" # , httpd.conf ,
Define APP_BASE_DIR_BASE_DIR "${PROJECT_BASE_DIR}/appname" # Application
<VirtualHost *:${DEMO_PORT}>
DocumentAPP_BASE_DIR "${APP_BASE_DIR}"
# ServerName my-demo.com
WSGIScriptAlias / "${APP_BASE_DIR}/core/wsgi.py"
<Directory "${APP_BASE_DIR}/core">
<Files wsgi.py>
Require all granted
</Files>
</Directory>
Alias /static "${APP_BASE_DIR}/static"
<Directory "${APP_BASE_DIR}/files/static">
Require all granted
</Directory>
# <Location /ws>
# ProxyPass ws://127.0.0.1:8001/ws
# ProxyPassReverse ws://127.0.0.1:8001/ws
# </Location>
# <Location /ipython>
# ProxyPreserveHost On
# ProxyPass http://127.0.0.1:8002/ipython
# ProxyPassReverse http://127.0.0.1:8002/ipython
# ProxyPass ws://127.0.0.1:8002/ipython
# ProxyPassReverse ws://127.0.0.1:8002/ipython
# Header set Origin "http://127.0.0.1:8002/"
# RequestHeader set Origin "http://127.0.0.1:8002/"
# </Location>
</VirtualHost>
demo 내일 첨부
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
자바 파일 압축 및 압축 풀기파일 의 간단 한 압축 과 압축 해 제 를 실현 하 였 다.주요 테스트 용 에는 급 하 게 쓸 수 있 는 부분 이 있 으 니 불편 한 점 이 있 으 면 아낌없이 가르쳐 주 십시오. 1. 중국어 문 제 를 해 결 했 ...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.