django 튜토리얼과 mod_wsgi 설치 안내서에 따라 Apache와 mod_wsg를 LinuxMint18.1에서 사용하고 있지만 apache2ctl start를 실행하면 오류가 발생합니다.Linux에서 mod_wsgi를 사용할 때 왜 오류가 발생 했습니까?
Current thread 0x00007f88c10c7780 (most recent call first):
[Mon Mar 20 21:23:28.781270 2017] [core:notice] [pid 32458:tid 140225331099520] AH00052: child pid 7962 exit signal Aborted (6)
Fatal Python error: Py_Initialize: can't initialize sys
나에게 무슨 문제가 있습니까?
나는 다음 단계는 아파치와 mod_wsgi에 설치하기 위해 수행 :
이- apt-get을 아파치 설치
- 있는 apt-get-dev에 아파치를 설치를
- apt-get을 설치 python3.5-dev에
- wget을 https://github.com/GrahamDumpleton/mod_wsgi/archive/4.5.15.tar.gz
- 타르 -zxvf mod_wsgi에-4.5.15.tar.gz
- CD mod_wsgi에-4.5.15 ,
- ./configure를 --with-파이썬 =는/usr/빈/python3.5
- 는
- 설치 할 수 있도록
ls /usr/bin/ -aoh |grep python
의 출력은 다음과 같습니다
lrwxrwxrwx 1 root 26 3月 18 09:40 dh_pypy -> ../share/dh-python/dh_pypy
-rwxr-xr-x 1 root 1.1K 12月 10 2015 dh_python2
lrwxrwxrwx 1 root 29 3月 18 09:40 dh_python3 -> ../share/dh-python/dh_python3
lrwxrwxrwx 1 root 23 3月 18 09:40 pdb2.7 -> ../lib/python2.7/pdb.py
lrwxrwxrwx 1 root 23 3月 18 09:40 pdb3.5 -> ../lib/python3.5/pdb.py
lrwxrwxrwx 1 root 31 3月 18 09:40 py3versions -> ../share/python3/py3versions.py
lrwxrwxrwx 1 root 26 3月 18 09:40 pybuild -> ../share/dh-python/pybuild
lrwxrwxrwx 1 root 18 3月 20 18:36 python -> /usr/bin/python2.7
lrwxrwxrwx 1 root 9 3月 18 09:40 python2 -> python2.7
-rwxr-xr-x 1 root 3.4M 11月 19 17:35 python2.7
lrwxrwxrwx 1 root 9 3月 18 09:40 python3 -> python3.5
-rwxr-xr-x 1 root 4.3M 11月 18 03:23 python3.5
lrwxrwxrwx 1 root 33 11月 18 03:23 python3.5-config -> x86_64-linux-gnu-python3.5-config
-rwxr-xr-x 1 root 4.3M 11月 18 03:23 python3.5m
lrwxrwxrwx 1 root 34 11月 18 03:23 python3.5m-config -> x86_64-linux-gnu-python3.5m-config
lrwxrwxrwx 1 root 10 3月 18 09:40 python3m -> python3.5m
lrwxrwxrwx 1 root 29 3月 18 09:40 pyversions -> ../share/python/pyversions.py
lrwxrwxrwx 1 root 34 11月 18 03:23 x86_64-linux-gnu-python3.5-config -> x86_64-linux-gnu-python3.5m-config
-rwxr-xr-x 1 root 3.2K 11月 18 03:20 x86_64-linux-gnu-python3.5m-config
/etc/apache2/apache2.conf
:
LoadModule wsgi_module /usr/lib/apache2/modules/mod_wsgi.so
WSGIScriptAlias//home/jeffrey/桌面/Workspace/django-env/hello_django/hello_django/wsgi.py
WSGIPythonHome /home/jeffrey/桌面/Workspace/django-env
WSGIPythonPath /home/jeffrey/桌面/Workspace/django-env/hello_django
<Directory /home/jeffrey/桌面/Workspace/django-env/hello_django/hello_django>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
프로젝트 파일 구조 :
django-env
├── hello_django
│ ├── hello_django
│ │ └── wsgi.py
virtualenv를 사용하고 있습니까? httpd.conf와 wsgi 파일의 적절한 부분은 무엇입니까? –
이것은 일반적으로 비표준 위치에 파이썬 설치를 사용하여 소스 코드에서 mod_wsgi를 빌드했지만 동일한 메이저/마이너 버전으로 시스템 전체에 설치된 파이썬 버전이 있고 잘못된 파이썬 공유 라이브러리를 선택하고 있음을 나타냅니다. 사용중인 Python 버전과 설치 위치를 상세하게 설명합니다. –
@GrahamDumpleton 질문에 자세히 설명했습니다. 한번보세요. – Jeffery