January
13th
2007

Apache2, SSL, Mysql, PHP and OpenLDAP Installation Guide

电脑技术 3条评论

1次评分, 平均分: 1 vote, average: 5.00 out of 51 vote, average: 5.00 out of 51 vote, average: 5.00 out of 51 vote, average: 5.00 out of 51 vote, average: 5.00 out of 5
评分: 很差劲不怎样还可以还不错太棒了
Loading ... Loading ...

1. Install Mysql

  1. #groupadd mysql
  2. #adduser mysql -g mysql -s /nologin
  3. #cd mysql-VERSION/
  4. #./configure --prefix=/usr/local/mysql
  5. #make && make install
  6. #scripts/mysql_install_db
  7. #chown -R root:mysql /usr/local/mysql
  8. #chown -R mysql /usr/local/mysql/var
  9. #/usr/local/mysql/bin/mysqld_safe --user=mysql
  10. #mysql -uroot
  11. >use mysql;
  12. >update user set password=password('XXX') where user='root';
  13. >flush priviledges;

2. Install Apache

  1. #cd apache-VERSION/
  2. #./configure --prefix=/usr/local/apache2 --enable-module=so --enable-ssl --enable-rewrite
  3. #make && make install

configure httpd.conf

  1. # vi /usr/local/apache2/conf/httpd.conf
  2. enable ssl in httpd.conf file

3. Generate keys use Openssl
3.1 Generate rootCA private key

  1. #openssl genrsa -des3 -out ca.key 1024

3.1.1 Generate rootCA certificate

  1. #openssl req -new -x509 -days 365 -key ca.key -out ca.crt

3.1.2 Generate PKCS12 certificate (which can be installed in the browsers)

  1. #openssl pkcs12 -export -in ca.crt -inkey ca.key -out ca.pfx

3.2 Generate server keys and certificate by rootCA

  1. #openssl genrsa -des3 -out server.key
  2. #openssl req -new -key server.key -out server.csr
  3. #openssl x509 -req -in server.csr -out server.crt -CA ca.crt -CAkey ca.key -CAcreateserial -days 365

3.3 Generate client keys and certificate by rootCA (for mutual certifate)

  1. #openssl req -new > client.csr
  2. #openssl x509 -req -in client.csr -out client.crt -signkey ca.key -CA ca.crt -CAkey ca.key -CAcreateserial -days 365
  3. #openssl pkcs12 -export -in client.crt -inkey ca.key -out client.pfx

4. Install Berkeley DB (for OpenLDAP)

  1. #cd db_VERSION
  2. #cd build_unix
  3. #../dist/configure --prefix=/usr/local/bdb
  4. #make && make install

add /usr/local/bdb/lib into /etc/ld.so.conf

  1. #/sbin/ldconfig

5. Install OpenLDAP

  1. #cd openldap-VERSION
  2. #./configure --prefix=/usr/local/openldap --with-wrappers
  3. #make depend && make && make test && make install

6. Install PHP

  1. #cd php-VERSION
  2. #./configure --with-mysql=/usr/local/mysql --with-gettext --with-ldap=/usr/local/openldap --with-apxs2=/usr/local/apache2/bin/apxs --with-openssl=/usr/local/openssl
  3. #make && make install
  4. #cp ./php.ini-dist /usr/local/lib/php.ini
  5. #vi /usr/local/lib/php.ini
  6. register_globals=on
  7. magic_quotes_gps=on
  8. #vi /usr/local/apache2/conf/httpd.conf
  9. AddType application /x-httpd-php .php
  10. #/usr/local/apache2/bin/apachectl restart

  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Twitter
  • Live
  • LinkedIn
  • Yahoo! Bookmarks
  • RSS
  • email
  • Print
  • PDF

相关文章阅读

喜欢这篇文章?订阅我的RSS,就可以自动获取最新内容了!

Tags:, , , .
评论数量: 3条评论
引用: http://www.i4wei.com/2007/01/11/


  1. July 6th, 2009 at 18:27 | #1

    I think I will try to recommend this post to my friends and family, cuz it’s really helpful.

  2. June 20th, 2009 at 22:45 | #2

    不错哈!留着!

  3. August 17th, 2008 at 23:08 | #3

    Your blog is interesting!

    Keep up the good work!

  1. 还没有trackbacks.