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

Python mod_wsgi-mod_wsgi-express错误AH00526:第16行出现语法错误,python,django,apache2,mod-wsgi,ubuntu-14.04,Python,Django,Apache2,Mod Wsgi,Ubuntu 14.04,这与我的问题有关 实际上,我在Ubuntu 14.04 LTS 64位上使用Apacha版本: 服务器版本:Apache/2.4.7 Ubuntu 服务器构建:2014年7月22日14:36:38 当我键入命令mod_wsgi-express启动服务器以检查它是否运行时。它似乎没有运行,我有一个错误: root@website:/home/website# mod_wsgi-express start-server Server URL : http://localhost:800

这与我的问题有关

实际上,我在Ubuntu 14.04 LTS 64位上使用Apacha版本: 服务器版本:Apache/2.4.7 Ubuntu 服务器构建:2014年7月22日14:36:38

当我键入命令mod_wsgi-express启动服务器以检查它是否运行时。它似乎没有运行,我有一个错误:

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
我在安装到的过程中遇到了相同的问题。欢迎任何建议

更多信息:

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]

我在尝试启动TurboGears python应用程序时遇到了类似的问题。我最终能够通过执行包含用户选项的start server命令来启动它。我将user选项设置为运行apache的用户。在我的例子中,用户是apache。见下文

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

错误似乎很明显:不要以root身份运行。你为什么要这么做?您永远不应该以root用户身份登录。是的,我稍后会注意到!谢谢