MySQL 5.5 on Debian

# aptitude install libaio-dev libaio1

# cd /usr/src
# wget http://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.21-debian5.0-x86_64.deb/from/http://mysql.oss.eznetsols.org/
# dpkg -i ysql-5.5.21-debian5.0-x86_64.deb
# ln -s /opt/mysql/server-5.5 /usr/local/mysql
# ln -s /opt/mysql/server-5.5/bin/* /usr/local/bin/
# cp /opt/mysql/server-5.5/support-files/my-medium.cnf /etc/mysql/my.cnf
# ln -s /etc/mysql/my.cnf /etc/my.cnf
# nano /etc/mysql/my.cnf

[client]
#password = your_password
port = 3306
socket = /var/run/mysqld/mysql.sock

# Here follows entries for some specific programs

# The MySQL server
[mysqld]
port = 3306
socket = /var/run/mysqld/mysql.sock
user = root
basedir = /usr/local/mysql
datadir = /var/lib/mysql
tmpdir = /tmp
log_error = /var/log/mysql.err
skip-external-locking
….

# cp /opt/mysql/server-5.5/support-files/mysql.server /etc/init.d/mysql
# chmod +x /etc/init.d/mysql
# update-rc.d mysql defaults
# mkdir /var/lib/mysql
# cd /opt/mysql/server-5.5/scripts/
# ./mysql_install_db –user=root –ldata=/var/lib/mysql/
# /etc/init.d/mysql start
# /usr/local/mysql/bin/mysqladmin -u root password ‘newpassword’

## test
# mysql -u root -p

## finalize
# mysql_upgrade -u root -p

source:
http://www.badllama.com/comment/1
https://wiki.archlinux.org/index.php/MySQL

apache 2.4.1

# aptitude install libapr1-dev uuid-dev libaprutil1-dev libmysqlclient15-dev libpq-dev libsqlite3-dev rcconf build-essential -y
# wget http://mirrors.issp.co.th/apache//httpd/httpd-2.4.1.tar.gz
tar -xvf httpd-2.4.1.tar.gz
# cd httpd-2.4.1/
# ./configure
# make
# make install

## Script start|stop|restart

#!/bin/bash
# description: apache2 httpd 2.4.1 server
# Start the service httpd
start() {
/usr/local/apache2/bin/httpd &
echo “Up and running”
}
# Restart the service httpd
stop() {
killall httpd
echo “Killing httpd”
}
### main logic ###
case “$1″ in
start)
start
;;
stop)
stop
;;
*)
echo $”Usage: $0 {start|stop}”
exit 1
esac
exit 0

แต่..​ถ้าเป็น lenny หรือ centos5 จะเจอเหตุการณ์แบบนี้!!

configure: error: APR version 1.3.0 or later is required

แก้โดยการ
CentOS
yum remove apr-util-devel apr apr-util-mysql apr-docs apr-devel apr-util apr-util-docs
yum install expat
yum remove apr-util-devel apr apr-util-mysql apr-docs apr-devel apr-u

Debian
aptitude install build-essential

Debian/CentOS
cd /usr/src
wget http://mirrors.issp.co.th/apache//apr/apr-1.4.6.tar.gz
tar xzvf apr-1.4.2.tar.gz
cd apr-1.4.2
./configure –prefix=/usr/local/apr
make
make install

cd /usr/src
wget http://mirrors.issp.co.th/apache//apr/apr-util-1.4.1.tar.gz
tar xzvf apr-util-1.4.1.tar.gz
cd apr-util-1.4.1
./configure –prefix=/usr/local/apr-util –with-apr=/usr/local/apr
make
make install

cd /usr/src
wget http://mirrors.issp.co.th/apache//apr/apr-iconv-1.2.1.tar.gz
tar xzvf apr-iconv-1.2.1.tar.gz
cd apr-iconv-1.2.1
./configure –with-apr=/usr/local/apr
make
make install

cd /usr/src/
wget http://mirrors.issp.co.th/apache//httpd/httpd-2.4.1.tar.gz
tar xzvf httpd-2.4.1.tar.gz
cd httpd-2.4.1
./configure \
–prefix=/usr/local/apache2 \
–enable-mods-shared=all \
–enable-so \
–enable-rewrite \
–enable-cache \
–enable-file-cache \
–enable-mem-cache \
–enable-disk-cache \
–enable-static-support \
–enable-static-htpasswd \
–enable-static-htdigest \
–enable-static-rotatelogs \
–enable-static-logresolve \
–enable-static-htdbm \
–enable-static-ab \
–enable-static-checkgid \
–enable-cgid \
–with-apr=/usr/local/apr/ \
–with-apr-util=/usr/local/apr/ \
–enable-cgi \
–with-expat=builtin \
–enable-ssl \

# make
# make install

# nano /etc/init.d/httpd

#!/bin/bash
# description: apache2 httpd 2.4.1 server
# Start the service httpd
start() {
/usr/local/apache2/bin/httpd &
echo “Up and running”
}
# Restart the service httpd
stop() {
killall httpd
echo “Killing httpd”
}
### main logic ###
case “$1″ in
start)
start
;;
stop)
stop
;;
*)
echo $”Usage: $0 {start|stop}”
exit 1
esac
exit 0

# /etc/init.d/httpd start

source:
http://hi.baidu.com/taiyangx/blog/item/944c9c583f730797810a18d5.html
http://verahill.blogspot.com/2012/02/debian-testing-wheezy-64-building_23.html
http://www.debian-tutorials.com/mysql/how-to-install-apache2-4-php5-and-mysql-from-source-on-debian-linux

lighttpd2 on debian

super easy!

# cd /usr/src
# wget http://download.opensuse.org/repositories/server:/http/Debian_5.0/amd64/libev4_4.04-1.1_amd64.deb
# wget http://download.opensuse.org/repositories/server:/http/Debian_5.0/amd64/liblighttpd2_2.0.0~snap-20111203-gdd4ed2-1_amd64.deb
# wget http://download.opensuse.org/repositories/server:/http/Debian_5.0/amd64/lighttpd2_2.0.0~snap-20111203-gdd4ed2-1_amd64.deb
# dpkg -i libev4_4.04-1.1_amd64.deb
# dpkg -i liblighttpd2_2.0.0~snap-20111203-gdd4ed2-1_amd64.deb
# dpkg -i lighttpd2_2.0.0~snap-20111203-gdd4ed2-1_amd64.deb

# cd /etc/init.d/
# wget http://redmine.lighttpd.net/attachments/1268/lighttpd2
# chmod 755 lighttpd2

try!
/usr/sbin/lighttpd2 -c /etc/lighttpd2/angel.conf

source:
http://redmine.lighttpd.net/projects/lighttpd2/wiki
http://download.opensuse.org/repositories/server:/http/Debian_5.0/amd64/

lighttpd mod-proxy-core from trunk

# aptitude install libpcre++-dev pkg-config build-essential libtool automake libglib2.0-dev zlib1g-dev -y
# cd /usr/src/
# svn checkout svn://svn.lighttpd.net/lighttpd/trunk/
# cd trunk
# ./autogen.sh
# ./configure –with-openssl –with-zlib –with-bzip2 –prefix=/opt/lighttpd
# make
# make install

## Startup script
# cd /etc/init.d/
# wget http://redmine.lighttpd.net/attachments/1268/lighttpd2
# nano lighttpd2
change
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
NAME=lighttpd2
DESC=lighttpd2
PIDFILE=/var/run/$NAME.pid
DAEMON=/usr/sbin/lighttpd2/lighttpd2
DAEMON_OPTS=”–config /etc/lighttpd2/angel.conf”
to
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/opt/lighttpd/sbin/
NAME=lighttpd2
DESC=lighttpd2
PIDFILE=/var/run/$NAME.pid
DAEMON=/opt/lighttpd/sbin/lighttpd
DAEMON_OPTS=”–config /etc/lighttpd/angel.conf”

# chmod 755 lighttpd2

source:
http://redmine.lighttpd.net/projects/lighttpd/wiki/InstallFromSource
http://www.cyberciti.biz/faq/lighttpd-checking-for-gthread-error-and-solution/
http://redmine.lighttpd.net/projects/1/wiki/ScriptsUbuntu