redhat下安装apache+python+mod_python+django
2013-02-04 12:39
471 查看
点击打开链接
用惯了ubuntu,才知道redhat有点坑爹哦,安装mod_python如此繁琐。
1、安装apache
(1)wget http://www.fayea.com/apache-mirror//httpd/httpd-2.2.22.tar.gz (2)tar -zvxf httpd-2.2.22.tar.gz
(3)cd httpd-2.2.22
(4) ./configure --prefix=/opt/apache --with-config-file-path=/opt/apache/conf --enable-mods-shared=most --enable-track-vars --enable-cgi --enable-so --enable-file-cache --enable-disk-cache
--enable-cache --enable-mem-cache --enable-dumpio --enable-logio --enable-mime-magic --enable-headers --enable-usertrack --enable-version --enable-ssl --enable-http --enable-rewrite --enable-proxy --enable-proxy-connect --enable-proxy-http --enable-proxy-ftp
--enable-proxy-ajp --enable-proxy-balancer
(5)make
(6)make install
成功安装后执行/opt/apache/bin/apachectl start然后curl "http://127.0.0.1" 或者在浏览器输入“[b]http://ip”,可以访问到<html><body><h1>It
works!</h1></body></html>内容。[/b]
2、安装python2.7
(1)wget http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tgz (2)tar -zvxf Python-2.7.3.tgz
(3)cd Python-2.7.3
(4)./configure --prefix=/opt/python/2.7 --enable-shared (--enable-shared是为了后面安装mod-python而设置的)
(5)make
(6)make install
成功安装后可以通过/opt/python/2.7/bin/python2.7进入python控制台。
【如果运行python程序时报以下错误/opt/python/2.7/bin/python: error while loading shared libraries: libpython2.7.so.1.0: cannot open shared object file: No such file or directory,需求做如下操作:vi /etc/ld.so.conf.d/python2.7.conf--》写入/opt/python/2.7/lib并保存--》ldconfig,然后重新运行/opt/python/2.7/bin/python2.7就可以了。】
3、安装 mod_python
(1)wget http://archive.apache.org/dist/httpd/modpython/mod_python-3.3.1.tgz (2)tar -zvxf mod_python-3.3.1.tgz
(3)cd mod_python-3.3.1
(4)./configure --with-apxs=/opt/apache/bin/apxs --with-python=/opt/python/2.7/bin/python2.7
(5)make
(6)make install_dso
(7)make install_py_lib
成功安装后会在/opt/apache/modules目录下生成mod_python.so,在/opt/python/2.7/lib/python2.7/site-packages目录下生成mod_python目录及mod_python-3.3.1-py2.7.egg-info文件。
【
如果make的时候报以下错误:
connobject.c: In function '_conn_read':
connobject.c:142: error: request for member 'next' in something not a structure or union
apxs:Error: Command failed with rc=65536
.
make[1]: *** [mod_python.so] Error 1
make[1]: Leaving directory `/usr/src/dev/mod_python-3.3.1/src'
make: *** [do_dso] Error 2
则需要修改一下src/
connobject.c将其中的
!(b == APR_BRIGADE_SENTINEL(b)改为!(b == APR_BRIGADE_SENTINEL(bb),保存后重新执行make就好了。
】
4、安装Django
(1)wget http://www.djangoproject.com/m/releases/1.3/Django-1.3.1.tar.gz (2)cd Django-1.3.1
(3)/opt/python/2.7/bin/python2.7 setup.py install
成功安装的话会在/opt/python/2.7/lib/python2.7/site-packages目录下生成django目录及Django-1.3.1-py2.7.egg-info文件。
用惯了ubuntu,才知道redhat有点坑爹哦,安装mod_python如此繁琐。
1、安装apache
(1)wget http://www.fayea.com/apache-mirror//httpd/httpd-2.2.22.tar.gz (2)tar -zvxf httpd-2.2.22.tar.gz
(3)cd httpd-2.2.22
(4) ./configure --prefix=/opt/apache --with-config-file-path=/opt/apache/conf --enable-mods-shared=most --enable-track-vars --enable-cgi --enable-so --enable-file-cache --enable-disk-cache
--enable-cache --enable-mem-cache --enable-dumpio --enable-logio --enable-mime-magic --enable-headers --enable-usertrack --enable-version --enable-ssl --enable-http --enable-rewrite --enable-proxy --enable-proxy-connect --enable-proxy-http --enable-proxy-ftp
--enable-proxy-ajp --enable-proxy-balancer
(5)make
(6)make install
成功安装后执行/opt/apache/bin/apachectl start然后curl "http://127.0.0.1" 或者在浏览器输入“[b]http://ip”,可以访问到<html><body><h1>It
works!</h1></body></html>内容。[/b]
2、安装python2.7
(1)wget http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tgz (2)tar -zvxf Python-2.7.3.tgz
(3)cd Python-2.7.3
(4)./configure --prefix=/opt/python/2.7 --enable-shared (--enable-shared是为了后面安装mod-python而设置的)
(5)make
(6)make install
成功安装后可以通过/opt/python/2.7/bin/python2.7进入python控制台。
【如果运行python程序时报以下错误/opt/python/2.7/bin/python: error while loading shared libraries: libpython2.7.so.1.0: cannot open shared object file: No such file or directory,需求做如下操作:vi /etc/ld.so.conf.d/python2.7.conf--》写入/opt/python/2.7/lib并保存--》ldconfig,然后重新运行/opt/python/2.7/bin/python2.7就可以了。】
3、安装 mod_python
(1)wget http://archive.apache.org/dist/httpd/modpython/mod_python-3.3.1.tgz (2)tar -zvxf mod_python-3.3.1.tgz
(3)cd mod_python-3.3.1
(4)./configure --with-apxs=/opt/apache/bin/apxs --with-python=/opt/python/2.7/bin/python2.7
(5)make
(6)make install_dso
(7)make install_py_lib
成功安装后会在/opt/apache/modules目录下生成mod_python.so,在/opt/python/2.7/lib/python2.7/site-packages目录下生成mod_python目录及mod_python-3.3.1-py2.7.egg-info文件。
【
如果make的时候报以下错误:
connobject.c: In function '_conn_read':
connobject.c:142: error: request for member 'next' in something not a structure or union
apxs:Error: Command failed with rc=65536
.
make[1]: *** [mod_python.so] Error 1
make[1]: Leaving directory `/usr/src/dev/mod_python-3.3.1/src'
make: *** [do_dso] Error 2
则需要修改一下src/
connobject.c将其中的
!(b == APR_BRIGADE_SENTINEL(b)改为!(b == APR_BRIGADE_SENTINEL(bb),保存后重新执行make就好了。
】
4、安装Django
(1)wget http://www.djangoproject.com/m/releases/1.3/Django-1.3.1.tar.gz (2)cd Django-1.3.1
(3)/opt/python/2.7/bin/python2.7 setup.py install
成功安装的话会在/opt/python/2.7/lib/python2.7/site-packages目录下生成django目录及Django-1.3.1-py2.7.egg-info文件。
相关文章推荐
- 转:apache+python+mod_python+django 编译安装指南
- windows下安装apache2.2 + python2.7 + django(mod_wsgi集成)
- apache+python+mod_python+django 编译安装指南
- linux下 Apache mysql python mod_python Django 配置安装说明,绝对可以安装上的说明
- Python3.3.0+apache2.4.4+django1.5.4+mod_wsgi3.4安装
- mysql+apache+python+mod_python+MySQLdb+django环境安装(转)
- apache,python,mod_wsgi,django,mysql在linux下的安装
- Django1.4 python2.7 apache mod_python 安装与部署实例
- python+apache+mod_python+django 编译安装指南[转]
- apache+python+mod_python+django 编译安装指南
- windows+apache+mod_python配置django运行环境
- 通过mod_python配置运行在Apache上的Django框架
- 最新版windows 2012R2、Apache24、mod_wsgi、Django1.9、python3.4项目部署(生产环境)
- windows+apache+mod_python配置django运行环境
- linux+apache+php+fastcgi+mod_python安装流水帐
- apache mod_python 安装
- ubuntu 安装 apache2.2+mod_wsgi+Django
- 用Apache和mod_python来部署Django
- windows2003+apache2.2+python2.7配置django mod_wsgi
- linux安装 apache2.2 django mod_wsgi