Apache2, SSL, Mysql, PHP and OpenLDAP Installation Guide
1. Install Mysql
- #groupadd mysql
- #adduser mysql -g mysql -s /nologin
- #cd mysql-VERSION/
- #./configure --prefix=/usr/local/mysql
- #make && make install
- #scripts/mysql_install_db
- #chown -R root:mysql /usr/local/mysql
- #chown -R mysql /usr/local/mysql/var
- #/usr/local/mysql/bin/mysqld_safe --user=mysql
- #mysql -uroot
- >use mysql;
- >update user set password=password('XXX') where user='root';
- >flush priviledges;
2. Install Apache
- #cd apache-VERSION/
- #./configure --prefix=/usr/local/apache2 --enable-module=so --enable-ssl --enable-rewrite
- #make && make install
configure httpd.conf
- # vi /usr/local/apache2/conf/httpd.conf
- enable ssl in httpd.conf file
3. Generate keys use Openssl
3.1 Generate rootCA private key
- #openssl genrsa -des3 -out ca.key 1024
3.1.1 Generate rootCA certificate
- #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)
- #openssl pkcs12 -export -in ca.crt -inkey ca.key -out ca.pfx
3.2 Generate server keys and certificate by rootCA
- #openssl genrsa -des3 -out server.key
- #openssl req -new -key server.key -out server.csr
- #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)
- #openssl req -new > client.csr
- #openssl x509 -req -in client.csr -out client.crt -signkey ca.key -CA ca.crt -CAkey ca.key -CAcreateserial -days 365
- #openssl pkcs12 -export -in client.crt -inkey ca.key -out client.pfx
4. Install Berkeley DB (for OpenLDAP)
- #cd db_VERSION
- #cd build_unix
- #../dist/configure --prefix=/usr/local/bdb
- #make && make install
add /usr/local/bdb/lib into /etc/ld.so.conf
- #/sbin/ldconfig
5. Install OpenLDAP
- #cd openldap-VERSION
- #./configure --prefix=/usr/local/openldap --with-wrappers
- #make depend && make && make test && make install
6. Install PHP
- #cd php-VERSION
- #./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
- #make && make install
- #cp ./php.ini-dist /usr/local/lib/php.ini
- #vi /usr/local/lib/php.ini
- register_globals=on
- magic_quotes_gps=on
- #vi /usr/local/apache2/conf/httpd.conf
- AddType application /x-httpd-php .php
- #/usr/local/apache2/bin/apachectl restart
相关文章阅读
喜欢这篇文章?
订阅我的RSS,就可以自动获取最新内容了!
Tags:Linux, Mysql, PHP, Security.
评论数量: 3条评论
引用: http://www.i4wei.com/2007/01/11/

Like





I think I will try to recommend this post to my friends and family, cuz it’s really helpful.
不错哈!留着!
Your blog is interesting!
Keep up the good work!