簡體   English   中英

在適用於Django部署的AWS Elasticbeanstalk上構建/安裝mod_wsgi時出錯

[英]Error building/installing mod_wsgi on AWS elasticbeanstalk for Django deployment

我在嘗試部署Django應用時遇到以下錯誤。 我一直在http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create-deploy-python-django.html的文檔中關注該教程。 我目前的直覺是因為pip試圖從源代碼而不是使用.whl來構建mod_wsgi,但這就是我的故障排除專業知識的程度。 我該如何解決?

[2015-11-20T02:11:22.515Z] INFO  [23704] - [Application update/AppDeployStage0/AppDeployPreHook/03deploy.py] : Activity execution failed, because: Collecting Django==1.8.6 (from -r /opt/python/ondeck/app/requirements.txt (line 1))
    Using cached Django-1.8.6-py2.py3-none-any.whl
  Collecting mod-wsgi==4.4.7 (from -r /opt/python/ondeck/app/requirements.txt (line 2))
    Using cached mod_wsgi-4.4.7.tar.gz
      Complete output from command python setup.py egg_info:
      Traceback (most recent call last):
        File "<string>", line 20, in <module>
        File "/tmp/pip-build-EAwCnb/mod-wsgi/setup.py", line 140, in <module>
          'missing Apache httpd server packages.' % APXS)
      RuntimeError: The 'apxs' command appears not to be installed or is not executable. Please check the list of prerequisites in the documentation for this package and install any missing Apache httpd server packages.

      ----------------------------------------
  Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-EAwCnb/mod-wsgi
  2015-11-20 02:11:22,510 ERROR    Error installing dependencies: Command '/opt/python/run/venv/bin/pip install -r /opt/python/ondeck/app/requirements.txt' returned non-zero exit status 1
  Traceback (most recent call last):
    File "/opt/elasticbeanstalk/hooks/appdeploy/pre/03deploy.py", line 22, in main
      install_dependencies()
    File "/opt/elasticbeanstalk/hooks/appdeploy/pre/03deploy.py", line 18, in install_dependencies
      check_call('%s install -r %s' % (os.path.join(APP_VIRTUAL_ENV, 'bin', 'pip'), requirements_file), shell=True)
    File "/usr/lib64/python2.7/subprocess.py", line 540, in check_call
      raise CalledProcessError(retcode, cmd)
  CalledProcessError: Command '/opt/python/run/venv/bin/pip install -r /opt/python/ondeck/app/requirements.txt' returned non-zero exit status 1 (ElasticBeanstalk::ExternalInvocationError)
caused by: Collecting Django==1.8.6 (from -r /opt/python/ondeck/app/requirements.txt (line 1))
    Using cached Django-1.8.6-py2.py3-none-any.whl
  Collecting mod-wsgi==4.4.7 (from -r /opt/python/ondeck/app/requirements.txt (line 2))
    Using cached mod_wsgi-4.4.7.tar.gz
      Complete output from command python setup.py egg_info:
      Traceback (most recent call last):
        File "<string>", line 20, in <module>
        File "/tmp/pip-build-EAwCnb/mod-wsgi/setup.py", line 140, in <module>
          'missing Apache httpd server packages.' % APXS)
      RuntimeError: The 'apxs' command appears not to be installed or is not executable. Please check the list of prerequisites in the documentation for this package and install any missing Apache httpd server packages.

排序。

apsx由httpd-devel軟件包提供。 然后使用eb ssh進行連接

yum list installed|grep httpd

查看與環境匹配的httpd-devel版本。 用安裝

sudo yum install httpd24-devel

接着

sudo /opt/python/run/venv/bin/pip install -r /opt/python/ondeck/app/requirements.txt

檢查它是否固定。 如果可行,則創建或編輯(本地)文件

.ebextensions/01_packages.config

或類似的內容作為部署的一部分添加:

packages:
    yum:
        httpd24-devel: []

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM