據說 Apache 2.0 的效能較好, 一些常用的 Module, 已經內含, 很方便.
準備檔案
wget http://ftp.cis.nctu.edu.tw/data/UNIX/apache/httpd/httpd-2.0.54.tar.gz
wget http://tw.php.net/get/php-5.0.5.tar.bz2/from/tw.php.net/mirror
安裝
tar zxf httpd-2.0.54.tar.gz
tar jxf php-5.0.5.tar.bz2
cd httpd-2.0.54 (Apache2)
./configure --prefix=/usr/local/apache --sysconfdir=/usr/local/apache/conf \
--enable-module=so \
--enable-ssl --enable-rewrite --enable-proxy
make
make install
cd ../php-5.0.5 (PHP5)
./configure --with-mysql --with-apxs2=/usr/local/apache/bin/apxs \
--enable-module=so --with-config-file-path=/usr/local/etc \
--libexecdir=/usr/local/apache/libexec --with-iconv \
--with-gd --with-zlib --with-jpeg-dir
make
cp .libs/libphp5.so /usr/local/apache/modules (把 PHP5 modules copy 到 Apache modules 目錄下)
SSL
參考 How can I create and use my own Certificate Authority (CA)?
cd /usr/local/apache/conf
openssl genrsa -out server.key
(若要 Apache 啟動時不需密碼, 就不要加 -des3, 若有加 -des3 後, 最後要調整為不要密碼, 可參考 How to remove a pass phrase?)
openssl req -new -key server.key -out server.csr
openssl genrsa -out ca.key
openssl req -new -x509 -days 3650 -key ca.key -out ca.crt
./sign.sh server.csr (sign.sh 在 modssl tar ball 內 pkg.contrib 目錄可以找到)
chmod 400 server.*
mv server.crt ssl.crt
mv server.key ssl.key
若覺得上述步驟太麻煩, 也可以這樣來產生自簽 Key
openssl req -new -x509 -nodes -out ssl.crt/server.crt -keyout ssl.key/server.key -days 3650
設定 httpd.conf
LoadModule php5_module modules/libphp5.so
DirectoryIndex index.html index.htm index.php (在 DirectoryIndex 該行後加上 index.php)
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
啟動 /usr/local/apache/bin/apachectl startssl
Apache2 + SSL + PHP5
Categories:
Categories
Monthly Archives
- January 2010 (7)
- December 2009 (10)
- November 2009 (18)
- October 2009 (11)
- September 2009 (14)
- August 2009 (10)
- July 2009 (6)
- June 2009 (5)
- May 2009 (3)
- April 2009 (12)
- March 2009 (18)
- February 2009 (7)
- January 2009 (14)
- December 2008 (15)
- November 2008 (12)
- October 2008 (9)
- September 2008 (10)
- August 2008 (13)
- July 2008 (28)
- June 2008 (17)
- May 2008 (13)
- April 2008 (15)
- March 2008 (7)
- February 2008 (5)
- January 2008 (2)
- November 2007 (4)
- October 2007 (8)
- September 2007 (7)
- August 2007 (3)
- July 2007 (10)
- June 2007 (4)
- May 2007 (5)
- April 2007 (9)
- March 2007 (11)
- February 2007 (7)
- January 2007 (4)
- December 2006 (9)
- November 2006 (14)
- October 2006 (10)
- September 2006 (9)
- August 2006 (6)
- July 2006 (15)
- June 2006 (22)
- May 2006 (17)
- April 2006 (13)
- March 2006 (18)
- February 2006 (10)
- January 2006 (28)
- December 2005 (17)
- November 2005 (15)
- October 2005 (18)
- September 2005 (24)
- August 2005 (39)
- July 2005 (14)
- June 2005 (22)
- May 2005 (32)
- April 2005 (27)
- March 2005 (32)
- February 2005 (20)
- January 2005 (38)
- December 2004 (49)
- November 2004 (38)
- October 2004 (24)
- September 2004 (23)
- August 2004 (38)
- July 2004 (39)
- June 2004 (38)
- May 2004 (17)
- April 2004 (32)
- March 2004 (15)
- February 2004 (6)
- January 2004 (19)
- December 2003 (19)
- November 2003 (15)
- October 2003 (15)
- September 2003 (12)
- August 2003 (20)
- July 2003 (26)
Search
凱莉手工坊
January 2010
About this Entry
This page contains a single entry by Pank published on September 12, 2005 11:55 AM.
HiNet 連不上 Google was the previous entry in this blog.
PDF to DOC by using Microsoft Office Document Image Writer is the next entry in this blog.
Find recent content on the main index or look in the archives to find all content.
Powered by Movable Type Pro
Leave a comment