mod_wsgi - mod_wsgi-express 错误 AH00526:第16行语法错误

0 投票
1 回答
1041 浏览
提问于 2025-04-29 11:45

这个 问题 和我的问题有关。

其实我在使用的是 Ubuntu 14.04 LTS 64位上的 Apache 版本:
服务器版本:Apache/2.4.7 (Ubuntu)
服务器构建时间:2014年7月22日 14:36:38

当我输入命令 mod_wsgi-express start-server 来检查它是否运行时,似乎没有运行,并且出现了一个错误:

root@website:/home/website# mod_wsgi-express start-server
Server URL        : http://localhost:8000/
Server Root       : /tmp/mod_wsgi-localhost:8000:0
Server Conf       : /tmp/mod_wsgi-localhost:8000:0/httpd.conf
Error Log File    : /tmp/mod_wsgi-localhost:8000:0/error_log
AH00526: Syntax error on line 16 of /tmp/mod_wsgi-localhost:8000:0/httpd.conf:
Error:\tApache has not been designed to serve pages while\n\trunning as root.  There are known race conditions that\n\twill allow any local user to read any file on the system.\n\tIf you still desire to serve pages as root then\n\tadd -DBIG_SECURITY_HOLE to the CFLAGS env variable\n\tand then rebuild the server.\n\tIt is strongly suggested that you instead modify the User\n\tdirective in your httpd.conf file to list a non-root\n\tuser.\n

在安装 doom 时,我也遇到了同样的问题。欢迎任何建议!

更多信息:

Apache中使用的模块:

Compiled in modules:
  core.c
  mod_so.c
  mod_watchdog.c
  http_core.c
  mod_log_config.c
  mod_logio.c
  mod_version.c
  mod_unixd.c

Python版本:

>>> print (sys.version) 
2.7.6 (default, Mar 22 2014, 22:59:56) 
[GCC 4.8.2]
暂无标签

1 个回答

1

我之前也遇到过类似的问题,想要启动一个TurboGears的Python应用。最后我通过在启动服务器的命令中加上用户选项,成功启动了它。我把用户选项设置成了运行Apache的用户。在我的情况下,这个用户是“apache”。下面是相关的代码。

[root@localhost ~]# mod_wsgi-express start-server --user=apache <path_to_my_wsgi_file>

撰写回答