# xmodmap -e "keycode 166 = Prior"
# xmodmap -e "keycode 167 = Next"
相關的修改可參考keyboard/mouse mapping
# xmodmap -e "keycode 166 = Prior"
# xmodmap -e "keycode 167 = Next"
# yum install libtool
$ sudo apt-get install libtool
# yum install libtool-ltdl
# yum install libtool-ltdl-devel
$ sudo apt-get install libltdl-dev
# yum install gnutls
# yum install gnutls-devel
# yum install gnutls-utils
$ sudo apt-get install libgnutls-dev
# yum install openssl
$ sudo apt-get install openssl
$ sudo apt-get install libssl-dev
# cd {/path/to/subversion/src}/apr
# ./configure --prefix=/usr/local/apr
# make && make install && make clean
# cd {/path/to/subversion/src}/apr-util
# ./configure --prefix=/usr/local/apr --with-apr=/usr/local/apr
# make && make install && make clean
# ./configure --prefix=/usr/local/apr --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr
# make && make install && make clean
# ./configure --prefix=/usr/local/pcre --enable-utf8
# make && make install && make clean
# ./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動態編譯/靜態編譯問題
# tar zxvf neon.tar.gz
# mv neon {/path/to/subversion/src}
# ./configure
# make && make install && make clean
# ln -s /usr/local/lib/libexpat.la {/path/to/subversion/src}/apr-util/xml/expat/lib
# ./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
# 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>
# ./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
# ./configure
# make && make install && make clean
$ sudo apt-get install libgpg-error-dev libgpg-error0
# ./configure
# make && make install && make clean
$ sudo apt-get install libgcrypt11 libgcrypt11-dev
# ./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
# ./configure
# make && make install && make clean
$ sudo apt-get install libxml2 libxml2-dev
# ./configure
# make && make install make clean
$ sudo apt-get install libt1-5 libt1-dev
# ./configure --prefix=/usr/local
# make && make install && make clean
$ sudo apt-get install libfreetype6 libfreetype6-dev
# ./configure --prefix=/usr/local
# make && make install && make clean
$ sudo apt-get install libjpeg62 libjpeg62-dev
# ./configure --prefix=/usr/local
# make && make install && make clean
$ sudo apt-get install libxpm4
# ./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]
<?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
# /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
# /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!
# /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 做快取
# /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)
# ./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
Loaded plugins: presto, refresh-packagekit先kill所有正在執行的yum程序, 並且清掉所有cache的資料即可
Existing lock /var/run/yum.pid: another copy is running as pid XXXX
[root@localhost]# yum clean all
Error: Cannot retrieve repository metadata (repomd.xml) for repository: fedora. Please verify its path and try again則註解掉/etc/yum.repos.d/fedora.repo和/etc/yum.repos.d/fedora-updates.repo中的baseurl, 並且在/etc/hosts加上兩筆資料
80.239.156.215 mirrors.fedoraproject.org另外再安裝yum-fastestmirror套件, 未來在搜尋套件時, 可搜尋速度較快的mirror站台
213.129.242.84 mirrors.rpmfusion.org
PHP 5.x的環境
具有zlib的支援(可透過<?php gzopen(); ?>來檢查)
修改my_screw.h, 裡面的數字就是seed, 可視為密碼
$ phpize
$ ./configure –with-php-config=/path/to/php-config
$ make
/path/to/php_screw-1.5/php_screw.c:78: error: too few arguments to function 'org_compile_file'
/path/to/php_screw-1.5/php_screw.c:84: error: too few arguments to function 'org_compile_file'
/path/to/php_screw-1.5/php_screw.c:91: error: too few arguments to function 'org_compile_file'
/path/to/php_screw-1.5/php_screw.c:93: error: too few arguments to function 'org_compile_file'
從官方bug列表找到解決方法:
modify php_screw.c
org_compile_file(file_handle, type);
to
org_compile_file(file_handle, type TSRMLS_CC);
/path/to/php_screw-1.5/php_screw.c: In function 'zm_startup_php_screw':
/path/to/php_screw-1.5/php_screw.c:124: error: 'zend_compiler_globals' has no member named 'extended_info'
/path/to/php_screw-1.5/php_screw.c: In function 'zm_shutdown_php_screw':
/path/to/php_screw-1.5/php_screw.c:133: error: 'zend_compiler_globals' has no member named 'extended_info'
閱讀source後
modify php_screw.c
CG(extended_info) = 1;
to
// CG(extended_info) = 1;
[php_screw]
extension=php_screw.so
$ cd tools $ make )
$ ./tools/screw foo.php
$ Success Crypting(foo.php)
$ find . -name "*.php" -exec /path/to/tools/screw -exec {} \;
$ find . -name "*.screw" -exec rm -f {} ;