軟件需求:
操作系統 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!!!
|