软件需求:
操作系统 CentOS5.5_x64 |
Apache httpd-2.2.19.tar.bz2 |
SubVersion subversion-1.5.5.tar.gz |
Ssl ssl.ca-0.1.tar.gz |
安装依赖包
yum install openldap-devel.x86_64 expat-devel.x86_64 openldap-servers openldap-clients openssl-devel apr apr-devel apr-util apr-util-devel |
安装apache
[root@localhost src]# tar jxf httpd-2.2.19.tar.bz2 [root@localhost src]# cd httpd-2.2.19 [root@localhost httpd-2.2.19]# ./configure --prefix=/usr/local/apache2 --with-included-apr --with-ldap --enable-mods-static="deflate expires" --enable-mods-shared=" ssl ldap authnz-ldap dav dav-fs dav-lock headers rewrite " [root@localhost httpd-2.2.19]# make && make install |
安装SubVersion
[root@localhost src]# tar zxf subversion-1.5.5.tar.gz [root@localhost src]# cd subversion-1.5.5 [root@localhost subversion-1.5.5]# ./configure --prefix=/usr/local/subversion --with-apxs=/usr/local/apache2/bin/apxs [root@localhost subversion-1.5.5]# make && make install |
创建svn目录
[root@localhost ~]# cd /usr/local/subversion/bin/ [root@localhost bin]# ./svnadmin create --fs-type fsfs /opt/svn |
创建svn用户
[root@localhost bin]# cd /usr/local/apache2/bin/ [root@localhost bin]# ./htpasswd -c -m /opt/svn/.passwd admin |
修改权限
[root@localhost bin]# chown –R www:www /opt/svn/ [root@localhost bin]# vim /opt/svn/conf/authz admin = rw #添加此配置 [root@localhost bin]# vim /usr/local/apache2/conf/httpd.conf #在文件中添加下面配置 <Location /svn> DAV svn SVNPath /opt/svn AuthType Basic AuthName "ismole" AuthUserFile /opt/svn/.passwd Require valid-user </Location> |
生成证书
[root@localhost src]# tar zxf ssl.ca-0.1.tar.gz [root@localhost src]# mv ./ssl.ca-0.1 /usr/local/apache2/conf [root@localhost src]# cd /usr/local/apache2/conf/ssl.ca-0.1/ [root@localhost ssl.ca-0.1]# ./new-root-ca.sh #根据提示输入信息 Enter pass phrase for ca.key #输入密码 Verifying - Enter pass phrase for ca.key #再次输入密码 Enter pass phrase for ca.key #还是输入密码 Country Name (2 letter code) #国家名称? State or Province Name (full name) [Perak] #全称 Locality Name (eg, city) [Sitiawan] #地区名称 Organization Name (eg, company) #组织公司名称 Organizational Unit Name (eg, section) #组织单位名称 Common Name (eg, MD Root CA) #通用名称 Email Address #邮件地址 [root@localhost ssl.ca-0.1]# ./new-server-cert.sh server #输入和上面差不多信息,但是要和上面填写一样 Enter pass phrase for ./ca.key #输入密码,与制作证书时的密码要一致,信息填写完成后都选择y [root@localhost ssl.ca-0.1]# mv ./server.* ../ #Include conf/extra/httpd-ssl.conf #大约411行,去掉注释 [root@localhost ssl.ca-0.1]# ../../bin/apachectl -k restart #此时用https访问网站就会加密,如提示证书错误,那么申请个证书就好了,因为不是权威机构颁发的,所以会这样 |
安装php
[root@localhost src]# tar zxf php-5.2.14.tar.gz [root@localhost src]# cd php-5.2.14 [root@localhost ~]# yum –y install ntp vim-enhanced gcc gcc-c++ gcc-g77 flex bison autoconf automake bzip2-devel zlib-devel libjpeg-devel libpng-devel libtiff-devel freetype-devel libXpm-devel gettext-devel pam-devel kernel libxml2-devel libxml2 #上面的包并不是全都需要,为了方便一会测试LAMP,我就都装上了 [ [root@localhost php-5.2.6]# cp /usr/lib64/libjpeg.* /usr/lib [root@localhost php-5.2.14]# cp -frp /usr/lib64/libldap* /usr/lib/ [root@localhost php-5.2.14]# ./configure --prefix=/usr/local/php --with-gd --enable-gd-native-ttf --with-png-dir --with-jpeg-dir --with-iconv-dir --with-zlib-dir --with-bz2 --enable-mbstring --with-libxml-dir --enable-sockets --without-pdo-sqlite --disable-ipv6 --with-apxs2=/usr/local/apach2/bin/apxs --with-ldap --with-gettext [root@localhost php-5.2.14]# make && make install [root@localhost php-5.2.14]# cp php.ini-dist /etc/php.ini |
修改apache配置
[root@localhost ~]# cd /usr/local/apache2/conf/ [root@localhost conf]# vim httpd.conf AddType application/x-gzip .gz .tgz #在此行后面添加下行内容 AddType application/x-httpd-php .php DirectoryIndex index.html #在此行后面添加index.php [root@localhost apache2]# /usr/local/apache2/bin/apachectl start |
安装ldapphpadmin
[root@localhost src]# tar zxf phpldapadmin-1.2.0.5.tgz [root@localhost src]# cd phpldapadmin-1.2.0.5 [root@localhost phpldapadmin-1.2.0.5]# cd config/ [root@localhost config]# cp config.php.example config.php [root@localhost src]# cd /usr/local/apache2/htdocs/ [root@localhost htdocs]# mv /usr/src/phpldapadmin-1.2.0.5 ./phpldapadmin [root@localhost htdocs]# ../bin/apachectl -k restart #然后用 #登录DN:cn=Manager,dc=ismole,dc=com #密码 : slappasswd设置的密码 #登陆后就可以进行管理了,OK!!! |