我正在尝试通过AWS在Elastic Beanstalk中部署Django应用。
我能够部署它,但是得到一个500 Internal Server Error
。
在日志中,我看到:
mod_wsgi (pid=3640):
Target WSGI script '/opt/python/current/app/locallibrary/wsgi.py' cannot be loaded as Python module.
mod_wsgi (pid=3640):
Exception occurred processing WSGI script '/opt/python/current/app/locallibrary/wsgi.py'.
按照以下说明进行操作: http://modwsgi.readthedocs.io/en/develop/user-guides/quick-installation-guide.html
我从以下位置下载最新的WSGI代码: https://github.com/GrahamDumpleton/mod_wsgi/releases
转到“下载”文件夹,解压缩文件,进入目录。
当我运行./configure时,得到以下响应:
checking for apxs2... no
checking for apxs... /usr/sbin/apxs
apxs:Error: /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.12.xctoolchain/usr/local/bin/apr-1-config not found!.
apxs:Error: /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.12.xctoolchain/usr/local/bin/apr-1-config not found!.
cat: /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.12.xctoolchain/usr/local/share/apr-1/build-1/libtool: No such file or directory
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `/Users/admin/downloads/mod_wsgi-4.6.4':
configure: error: C compiler cannot create executables
See `config.log' for more details
config.log是:
checking for apxs2... no
checking for apxs... /usr/sbin/apxs
apxs:Error: /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.12.xctoolchain/usr/local/bin/apr-1-config not found!.
apxs:Error: /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.12.xctoolchain/usr/local/bin/apr-1-config not found!.
cat: /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.12.xctoolchain/usr/local/share/apr-1/build-1/libtool: No such file or directory
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `/Users/admin/downloads/mod_wsgi-4.6.4':
configure: error: C compiler cannot create executables
See `config.log' for more details
(djangodev) Mac-Pro-de-admin-4:mod_wsgi-4.6.4 admin$ ls
CREDITS.rst Makefile apxs configure images src win32
LICENSE Makefile.in config.log configure.ac libtool tests
MANIFEST.in README.rst config.status docs setup.py tox.ini
(djangodev) Mac-Pro-de-admin-4:mod_wsgi-4.6.4 admin$ nano config.log
GNU nano 2.0.6 File: config.log
PACKAGE_TARNAME=''
PACKAGE_URL=''
PACKAGE_VERSION=''
PATH_SEPARATOR=':'
PYTHON=''
SHELL='/bin/sh'
ac_ct_CC='gcc'
bindir='${exec_prefix}/bin'
build_alias=''
datadir='${datarootdir}'
datarootdir='${prefix}/share'
docdir='${datarootdir}/doc/${PACKAGE}'
dvidir='${docdir}'
exec_prefix='NONE'
host_alias=''
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
mandir='${datarootdir}/man'
oldincludedir='/usr/include'
pdfdir='${docdir}'
prefix='NONE'
program_transform_name='s,x,x,'
psdir='${docdir}'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
sysconfdir='${prefix}/etc'
target_alias=''
## ----------- ##
## confdefs.h. ##
## ----------- ##
/* confdefs.h */
#define PACKAGE_NAME ""
#define PACKAGE_TARNAME ""
#define PACKAGE_VERSION ""
#define PACKAGE_STRING ""
#define PACKAGE_BUGREPORT ""
#define PACKAGE_URL ""
configure: exit 77