安裝libtool
# yum install libtool
$ sudo apt-get install libtool
安裝ltdl
# yum install libtool-ltdl
# yum install libtool-ltdl-devel
$ sudo apt-get install libltdl-dev
安裝gnutls
# yum install gnutls
# yum install gnutls-devel
# yum install gnutls-utils
$ sudo apt-get install libgnutls-dev
安裝openssl
# yum install openssl
$ sudo apt-get install openssl
$ sudo apt-get install libssl-dev
下載subversion-deps(ver. 1.6.12)
解壓縮subversion-deps到subversion目錄
安裝apr (with subversion source)
# cd {/path/to/subversion/src}/apr
# ./configure --prefix=/usr/local/apr
# make && make install && make clean
安裝apr-util (with subversion source)
# cd {/path/to/subversion/src}/apr-util
# ./configure --prefix=/usr/local/apr --with-apr=/usr/local/apr
# make && make install && make clean
安裝apr-iconv (ver. 1.2.1)
# ./configure --prefix=/usr/local/apr --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr
# make && make install && make clean
安裝pcre(配合httpd-2.3.x才需要)
# ./configure --prefix=/usr/local/pcre --enable-utf8
# make && make install && make clean
安裝httpd (ver. 2.2.16)
# ./configure --prefix=/usr/local/apache2 --enable-mods-shared=most --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr/bin/apu-1-config --enable-dav --enable-dav-fs --enable-dav-lock --enable-maintainer-mode --enable-unique-id --enable-speling --enable-deflate --enable-file-cache --enable-cache --enable-disk-cache --enable-mem-cache --enable-filter --enable-isapi --enable-mime-magic --enable-rewrite --enable-usertrack --enable-static-rotatelogs --enable-static-logresolve --enable-ssl --with-mpm=worker
# make && make install && make clean
# vim /usr/local/apache2/conf/httpd.conf
[add]
CustomLog "logs/access_log" combined
ServerTokens ProductOnly
ServerSignature Off
<Directory "/var/www/html">
AddDefaultCharset utf-8
Options FollowSymLinks
AllowOverride all
Order allow,deny
Allow from all
</Directory>
[/add]
note: 當要進行動態編譯modules時, 就不需要加上--enable-so
reference: apache動態編譯/靜態編譯問題
下載neon (ver. 0.29.3)
# tar zxvf neon.tar.gz
# mv neon {/path/to/subversion/src}
安裝libexpat (ver. 2.0.1)
# ./configure
# make && make install && make clean
# ln -s /usr/local/lib/libexpat.la {/path/to/subversion/src}/apr-util/xml/expat/lib
安裝subversion (ver. 1.6.12)
# ./configure --prefix=/usr/local/svn --with-apxs=/usr/local/apache2/bin/apxs --with-apr=/usr/local/apr/bin/apr-1-config --with-apr-util=/usr/local/apr/bin/apu-1-config --with-ssl
# make && make install & make clean
設定https(openssl已安裝)
# openssl x509 -req -days 7 -in my.demo.csr -signkey my.demo.key -out my.demo.crt
# openssl genrsa -out my.demo.key 1024
# openssl req -new -key my.demo.key -out my.demo.csr
# vim /usr/local/apache2/conf/httpd.conf
Listen 443
<VirtualHost _default_:443>
ServerName localhost
SSLEngine on
SSLCertificateFile /usr/local/apache2/conf/ca/my.demo.crt
SSLCertificateKeyFile /usr/local/apache2/conf/ca/my.demo.key
</VirtualHost>
安裝mysql (ver. 5.1.49)
# ./configure --prefix=/usr/local/mysql --datadir=/usr/local/mysql/data --with-unix-socket-path=/tmp/mysql.sock --enable-assembler --with-big-tables --with-readline --with-ssl --with-charset=utf8 --with-extra-charsets=all --enable-thread-safe-client
# make && make install && make clean
# useradd mysql
# /usr/local/mysql/bin/mysql_install_db --user=mysql --no-defaults
# cp support-files/my-medium.cnf.sh /etc/my.cnf
# chown mysql:mysql /etc/my.cnf
# vim /etc/my.cnf
[client]
port=3306
socket=/tmp/mysql.sock
[mysqld]
port=3306
socket=/tmp/mysql.sock
datadir=/usr/local/mysql/var
# chown -R mysql:mysql /usr/local/mysql/var
# cp /usr/local/mysql/data/mysql/mysql.server /etc/rc.d/init.d/mysqld
# chkconfig --add mysqld [Start As Service]
# service mysqld start
# /usr/local/mysql/bin/mysql -u root -p [ENTER]
mysql>UPDATE mysql.user SET password=PASSWORD('NEW_PASSWORD') WHERE user='root';
mysql>flush privileges;
mysql>exit
安裝libgpg-error (ver. 1.9)
# ./configure
# make && make install && make clean
$ sudo apt-get install libgpg-error-dev libgpg-error0
安裝libgcrypt (ver. 1.4.6)
# ./configure
# make && make install && make clean
$ sudo apt-get install libgcrypt11 libgcrypt11-dev
安裝libmcrypt (ver. 2.5.7)
# ./configure --enable-ltdl-install
# make && make install && make clean
$ sudo apt-get install libmcrypt4 libmcrypt-dev mcrypt
reference: http://bojack.pixnet.net/blog/post/3983596
安裝libxml (ver. 2.7.7)
# ./configure
# make && make install && make clean
$ sudo apt-get install libxml2 libxml2-dev
安裝curl (ver. 7.21)
# ./configure
# make && make install make clean
安裝t1lib
$ sudo apt-get install libt1-5 libt1-dev
安裝freetype (ver. 2.4.2)
# ./configure --prefix=/usr/local
# make && make install && make clean
$ sudo apt-get install libfreetype6 libfreetype6-dev
安裝libjpeg (ver. 8b)
# ./configure --prefix=/usr/local
# make && make install && make clean
$ sudo apt-get install libjpeg62 libjpeg62-dev
安裝libXpm (ver. 3.5.8)
# ./configure --prefix=/usr/local
# make && make install && make clean
$ sudo apt-get install libxpm4
安裝php (ver. 5.2.14)
# ./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs --enable-debug --enable-magic-quotes --enable-libgcc --enable-ftp --enable-mbstring --with-mysql=/usr/local/mysql --with-pdo-mysql=/usr/local/mysql --enable-sockets --with-gnu-ld --with-curl=/usr/local/lib --with-mcrypt=/usr/local/src/libmcrypt --with-zlib-dir=/usr/local/src/zlib --with-gd --with-t1lib --with-jpeg-dir=/usr/local --with-xpm-dir=/usr/local --with-freetype-dir=/usr/local --with-gettext
# make && make install && make clean
# cp php.ini-recommended /usr/local/php/lib/php.ini
# vim /usr/local/apache2/conf/httpd.conf
[add]
AddType application/x-httpd-php .php .phtml
DirectoryIndex index.php index.html
[/add]
測試gd
<?php
echo '<div style="margin: 10px;">';
echo '<p style="color: #444444; font-size: 130%;">GD is ';
if (function_exists("gd_info")) {
echo '<span style="color: #00AA00; font-weight: bold;">supported</span> by your server!</p>';
$gd = gd_info();
foreach ($gd as $k => $v) {
echo '<div style="width: 340px; border-bottom: 1px solid #DDDDDD; padding: 2px;">';
echo '<span style="float: left;width: 300px;">' . $k . '</span> ';
if ($v)
echo '<span style="color: #00AA00; font-weight: bold;">Yes</span>';
else
echo '<span style="color: #EE0000; font-weight: bold;">No</span>';
echo '<div style="clear:both;"><!-- --></div></div>';
}
} else {
echo '<span style="color: #EE0000; font-weight: bold;">not supported</span> by your server!</p>';
}
echo '<p>by <a href="http://www.dagondesign.com">dagondesign.com</a></p>';
echo '</div>';
?>
reference: Checking for GD support on your server
安裝xdebug
# /usr/local/php/bin/phpize
# ./configure --prefix=/usr/local/xdebug --enable-xdebug --with-php-config=/usr/local/php/bin/php-config
# make && make install && make clean
# vim /usr/local/php/lib/php.ini
[add]
zend_extension="/usr/local/php/lib/php/extensions/debug-zts-20060613/xdebug.so"
xdebug.profiler_enable=on
xdebug.trace_output_dir="/tmp/xdebug"
xdebug.profiler_output_dir="/tmp/xdebug"
[/add]
# required glibc
安裝suhosin
# /usr/local/php/bin/phpize
# ./configure --prefix=/usr/local/suhosin --with-php-config=/usr/local/php/bin/php-config
# make && make install && make clean
# cp /usr/local/php/lib/php/extensions/debug-zts-20060613/suhosin.so /usr/local/php/lib/php/extensions/
# vim php.ini
extension_dir = "/usr/local/php/lib/php/extensions"
reference:
How To Harden PHP5 With Suhosin On CentOS 5.3 | HowtoForge - Linux Howtos and Tutorials
Hardened-PHP Project - PHP Security - Installation!
安裝memcached (ver. 2.2.5)
# /usr/local/php/bin/phpize
# ./configure --enable-memcache --with-php-config=/usr/local/php/bin/php-conifg --with-zlib-dir
# make && make install && make clean
# cp /usr/local/php/lib/php/extensions/debug-zts-20060613/memcache.so /usr/local/php/lib/php/extensions/
# vim /usr/local/php/lib/php.ini
[add]
extension=memcache.so
[/add]
reference:
如何使用 memcached 做快取
安裝eaccelerator
# /usr/local/php/bin/phpize
# ./configure --with-php-config=/usr/local/php/bin/php-config
# make; make install
# cp /usr/local/php/lib/php/extensions/debug-zts-20060613/eaccelerator.so /usr/local/php/lib/php/extensions/
# vim /usr/local/php/lib/php.ini
[add]
extension=eaccelerator.so
eaccelerator.shm_size="512"
eaccelerator.cache_dir="/tmp/eaccelerator"
eaccelerator.enable="1"
eaccelerator.optimizer="0"
eaccelerator.check_mtime="1"
eaccelerator.debug="0"
eaccelerator.filter=""
eaccelerator.shm_max="0"
eaccelerator.shm_ttl="0"
eaccelerator.shm_prune_period="0"
eaccelerator.shm_only="0"
eaccelerator.compress="1"
eaccelerator.compress_level="9"
eaccelerator.cache_dir="/tmp/eaccelerator"
eaccelerator.log_file = "/var/log/eaccelerator_log"
[/add]
reference:
Installing from source
PHP - PHP 加速器的調校(php-eaccelerator)
特殊的php連結sql server需求
安裝freetds (ver. 0.82)
# ./configure --prefix=/usr/local/freetds --enable-msdblib --with-openssl=/usr/local src/openssl --with-gnutls需重新編譯PHP
# make && make install && make clean
# cd {/path/to/php/src}
# ./configure --with-mssql=/usr/local/freetds
# make && make install && make clean
reference:
* How To Install Apache 2 with SSL on Linux (with mod_ssl, openssl)
沒有留言:
張貼留言