分类:
2006-07-30 22:02:41
Apache+PHP+SSL 安装步骤准备工作:完成该种配置,需要如下软件包: httpd- openssl-0. tar xvfz openssl-0. cd openssl-0. ./config make make install tar xvfz httpd-2.0.55.tar.gz cd httpd-2.0.55 ./configure --enable-ssl --with-ssl=/usr/local/ssl/ --enable-suexec --with-suexec-docroot=/usr/local --enable-cgi --enable-rewrite --enable-so --enable-logio --prefix=/usr/local/apache --enable-module=most --enable-shared=max --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc/httpd make make install mkdir /etc/httpd/ssl.crt openssl genrsa -des3 -passout pass:asecretpassword -out /etc/httpd/ssl.crt/server.key.org 1024 openssl req -new -passin pass:asecretpassword -passout pass:asecretpassword -key /etc/httpd/ssl.crt/server.key.org -out /etc/httpd/ssl.crt/server.csr -days 3650 openssl req -x509 -passin pass:asecretpassword -passout pass:asecretpassword -key /etc/httpd/ssl.crt/server.key.org -in /etc/httpd/ssl.crt/server.csr -out /etc/httpd/ssl.crt/server.crt -days 3650 openssl rsa -passin pass:asecretpassword -in /etc/httpd/ssl.crt/server.key.org -out /etc/httpd/ssl.crt/server.key mkdir /etc/httpd/ssl.key mv /etc/httpd/ssl.crt/server.key /etc/httpd/ssl.key/server.key chmod 400 /etc/httpd/ssl.key/server.key tar jxvf php-5.0.4.tar.bz2 ./configure --with-apxs2=/usr/sbin/apxs --with-mysql=/var/lib/mysql --enable-track-vars --enable-sockets --with-config-file-path=/etc --enable-ftp --with-zlib --with-openssl=/usr/local/ssl --enable-force-cgi-redirect --enable-exif --with-gd --enable-memory-limit --disable-debug --disable-rpath --disable-static --with-pic --with-layout=GNU --enable-calendar --enable-sysvsem --enable-sysvshm --enable-s --enable-bcmath --with-bz2 --enable-ctype --with-db4 --with-iconv --enable-filepro --with-gettext --enable-mbstring --enable-shmop --enable-wddx --disable-xml --with-xmlrpc --enable-yp --with-zlib --without-pgsql --enable-dbx --enable-experimental-zts --without-mm --enable-gd-native-ttf --with-imap-ssl --enable-soap --enable-dbase make make install cp /tmp/php-5.0.4/php.ini-dist /etc/php.ini AddHandler cgi-script .cgi AddHandler cgi-script .pl AddType text/html .shtml AddOutputFilter INCLUDES .shtml AddType application/x-httpd-php .php .php5 .php4 .php3 #!/bin/sh case "$1" in start) /usr/sbin/apachectl startssl ;; stop) /usr/sbin/apachectl stop ;; restart) $0 stop && sleep 3 $0 start ;; reload) $0 stop $0 start ;; *) echo "Usage: $0 {start|stop|restart|reload}" exit 1 esac chmod 755 /etc/init.d/httpd ln -s /etc/init.d/httpd /etc/rc2.d/S20httpd ln -s /etc/init.d/httpd /etc/rc3.d/S20httpd ln -s /etc/init.d/httpd /etc/rc4.d/S20httpd ln -s /etc/init.d/httpd /etc/rc5.d/S20httpd ln -s /etc/init.d/httpd /etc/rc0.d/K20httpd ln -s /etc/init.d/httpd /etc/rc1.d/K20httpd ln -s /etc/init.d/httpd /etc/rc6.d/K20httpd Apache: 1 #vi /etc/httpd/httpd.conf ServerRoot "/etc/httpd" // PidFile run/httpd.pid //Apache Timeout 300 // MaxKeepAliveRequests 100 // KeepAliveTimeout 15 // StartServers 8// MinSpareServers 5// MaxSpareServers 20// MaxClinents 150// MaxRequestPerChild 1000// Listen 80// Include conf.d/*.conf // User apache //apache Group apache //apache ServerAdmin #ServerName_new.host.name:80// DocumentRoot "/var/www/html" //www DirectoryIndex index.html index.html.var // #cd conf.d// #cd /var/www/html// #service httpd restart ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ #~~~~~~~~~~~~~~~~~~~~~~// Authname "123abc" AuthType Basic AuthUserFile /etc/httpd/password // Require user aiai dupeng // #htpasswd -c /etc/httpd/passwd aiai New password:7777777 Re-type new password: 7777777 #chmod 644 password #ls -l -rw-r--r-- root password #htpasswd -c /etc/httpd/password dupeng New password:7777777 Re-type new password: 7777777 #cd /etc/httpd/passwd start -------------------------------------------------------
ysvmsg --enable-trans-sid
那么就自动断开。