为什么没有配置apache2

时间:2016-01-25 11:35:36

标签: django apache mod-wsgi httpd.conf

我正在尝试在apache中安装mod_wsgi模块来部署django项目。

我在apache2中使用预先安装的ubuntu。 安装模块后,我被要求通过执行apache2ctl -M验证apache是​​否正确加载模块:

comon@mylocal:~$ apache2ctl -M 

AH00558: apache2: Could not reliably determine the server's fully    qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
Loaded Modules:
 core_module (static)
 so_module (static)
 watchdog_module (static)
 http_module (static)
 log_config_module (static)
 logio_module (static)
 version_module (static)
 unixd_module (static)
 access_compat_module (shared)
 alias_module (shared)
 auth_basic_module (shared)
 authn_core_module (shared)
 authn_file_module (shared)
 authz_core_module (shared)
 authz_host_module (shared)
 authz_user_module (shared)
 autoindex_module (shared)
 deflate_module (shared)
 dir_module (shared)
 env_module (shared)
 filter_module (shared)
 mime_module (shared)
 mpm_event_module (shared)
 negotiation_module (shared)
 setenvif_module (shared)
 status_module (shared)

似乎没有mod_wsgi所以我发现我需要在apache中的LoadModule wsgi_module modules/mod_wsgi.so配置文件中添加httpd.conf

要知道这个文件的位置,我跑了:/usr/sbin/apache2 -V | grep SERVER_CONFIG_FILE然后我去了:

comon@mylocal:~$ /usr/sbin/apache2 -V | grep SERVER_CONFIG_FILE

[Mon Jan 25 12:04:39.169687 2016] [core:warn] [pid 7614] AH00111: Config variable ${APACHE_LOCK_DIR} is not defined
[Mon Jan 25 12:04:39.169748 2016] [core:warn] [pid 7614] AH00111: Config variable ${APACHE_PID_FILE} is not defined
[Mon Jan 25 12:04:39.169766 2016] [core:warn] [pid 7614] AH00111: Config variable ${APACHE_RUN_USER} is not defined
[Mon Jan 25 12:04:39.169773 2016] [core:warn] [pid 7614] AH00111: Config variable ${APACHE_RUN_GROUP} is not defined
[Mon Jan 25 12:04:39.169790 2016] [core:warn] [pid 7614] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
[Mon Jan 25 12:04:39.171891 2016] [core:warn] [pid 7614:tid 139649371690880] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
[Mon Jan 25 12:04:39.172022 2016] [core:warn] [pid 7614:tid 139649371690880] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
[Mon Jan 25 12:04:39.172037 2016] [core:warn] [pid 7614:tid 139649371690880] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
AH00526: Syntax error on line 74 of /etc/apache2/apache2.conf:
Invalid Mutex directory in argument file:${APACHE_LOCK_DIR}

似乎我的apache2中没有任何内容!

我做错了什么?

1 个答案:

答案 0 :(得分:0)

直接使用apachectl而不是apache2 / httpd可执行文件来获取apachectl上发布的自定义环境变量。