<b>RedHat EL5 布置Trac 编译Apache mod_python mod_ldap</b>[服务器安全]
本文“<b>RedHat EL5 布置Trac 编译Apache mod_python mod_ldap</b>[服务器安全]”是由七道奇为您精心收集,来源于网络转载,文章版权归文章作者所有,本站不对其观点以及内容做任何评价,请读者自行判断,以下是其具体内容:
需求布置一套Trac做为WIKI来利用,同时为告终合LDAP认证,决意采取以下组件:
1. Apache
2. Python
3. mod_python
4. mod_ldap
5. apr
6. apr-util
7. Trac 0.12
编译安装步骤以下
1. apr
wget http://www.linuxidc.com/system/systemfiles/2011/01/apr-1.4.2.tar.gz
tar xzvfapr-1.4.2.tar.gz
cd apr-1.4.2
./configure --prefix=/usr/local/apr && make && make install
2. apr-util
wget http://labs.renren.com/apache-mirror/apr/apr-util-1.3.10.tar.gz
tar xzvfapr-util-1.3.10.tar.gz
cd apr-util-1.3.10
./configure --with-apr=/usr/local/apr/bin/ --with-ldap && make && make install
3. Apache
wget http://labs.renren.com/apache-mirror//httpd/httpd-2.2.17.tar.gz
tar xzvfhttpd-2.2.17.tar.gz
cdhttpd-2.2.17
./configure --prefix=/usr/local/apache --enable-track-vars --enable-cgi --enable-modules=all --enable-mods-shared=all --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 --enable-so --enable-authnz-ldap --enable-ldap --with-par=/usr/local/apr --with-apr-util=/usr/local/apr-util/ && make && make install
上面有很多是不需求的,可酌情删减
4. python
tar xjvfPython-2.7.tar.bz2
cd Python-2.7
./configure --enable-shared && make && make install
--enable-shared一定要有,要不然背面编译mod_python会出问题.
下面三部替换系统默许Python为Python2.7,谨严!大概惹起某些软件不能运行,如yum
rm -f /usr/local/bin/python
rm -f /usr/bin/python
ln -s /usr/local/bin/python2.7 /usr/local/bin/python
针对yum不能运行:
vim /usr/bin/yum
替换第一行为: #!/usr/bin/python2.4
即拟定以python2.4运行yum
5. mod_python
wget http://archive.apache.org/dist/httpd/modpython/mod_python-3.3.1.tgz
tar xzvfmod_python-3.3.1.tgz
cd mod_python-3.3.1
./configure --with-apxs=/usr/local/apache/bin/apxs --with-python=/usr/local/bin/python && make && make install
编译历程钟大概呈现下面错误
错误1:
connobject.c: 在函数‘_conn_read’中:
connobject.c:142: 错误: 在非构造或结合中恳求成员‘next’
apxs:Error: Command failed with rc=65536
办理筹划:
改正src/connobject.c第142行
把!(b == APR_BRIGADE_SENTINEL(b) || 改成!(b == APR_BRIGADE_SENTINEL(bb) ||
错误2:
/usr/local/lib/python2.5/config/libpython2.5.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
apxs:Error: Command failed with rc=65536
办理筹划:
首先,确认编译Python的时刻有没有加上--enable-shared,假如没有,加上重新编译
此时行Python大概呈现以错误
错误2.1
python: error while loading shared libraries: libpython2.7.so.1.0:
cannot open shared object file: No such file or
错误2.1办理筹划:
新建下面文件
vim /etc/ld.so.conf.d/python2.7.conf
加入内容:
/usr/local/lib
保存退出后运行:
ldconfig
每次编译mod_python都是一次痛楚的阅历,上面办理筹划参考:
http://agiletesting.blogspot.com/2007/10/compiling-modpython-on-rhel-64-bit.html
6. Trac
安装:
假如装了easy_install,很简单
easy_install Trac=0.12.1
不然
wget http://ftp.edgewall.com/pub/trac/Trac-0.12.1.tar.gz
tar xzvfTrac-0.12.1.tar.gz
cdTrac-0.12.1
python setup.py install
配置运行:
成立项目目录
mkdir -p /opt/trac/myproject
成立项目
trac-admin /opt/trac/myproject
按照提醒:
1. 填入项目名称
2. 填入数据库衔接
假如用sqlite默许的就行了
假如是mysql
首先在mysql里面成立数据
create database myproject
赋权限
grant all privileges on myproject.* to 'myuser'@'localhost' identified by 'mypassword';
数据库衔接填
mysql://mypassword:myuser@localhost/myproject
测试运行:
tracd --port 8000 /opt/trac/myproject
翻开浏览器拜候: http://[HOST_IP]:8000 便可, [HOST_IP]是服务器的IP
可选,给用Trac户加管理员权限
trac-admin /opt/trac/myproject permission add username TRAC_ADMIN
配置在Apache运行:
vim /usr/local/apace/conf/httpd
加上以下内容
LoadModule ldap_module modules/mod_ldap.so
LoadModule authnz_ldap_module modules/mod_authnz_ldap.so
以上是“<b>RedHat EL5 布置Trac 编译Apache mod_python mod_ldap</b>[服务器安全]”的内容,如果你对以上该文章内容感兴趣,你可以看看七道奇为您推荐以下文章:
本文地址: | 与您的QQ/BBS好友分享! |