全部とは言わないけどかなりいろいろ自分で入れるはめに。
デフォルトのCentOSだとここまでは必要なかった。とくにaptitudeで入れてるあたり。
自分が欲しいのは以下
- Nginx
- Emacs
- MongoDB
- Python
- php
- Erlang
- RabbitMQ
いれなきゃいけなさそうなアレコレ
apacheは外します
aptitude remove httpd -y aptitude install gcc -y aptitude install curl-devel -y aptitude install glibc -y aptitude install zlib-devel -y aptitude install libjpeg-devel -y aptitude install sqlite-devel -y aptitude install ncurses-devel -y aptitude install readline-devel -y aptitude install php -y aptitude install bzip2-devel -y aptitude install libxml2-devel -y aptitude install mercurial -y aptitude install vim -y aptitude install libpcre++-dev -y aptitude install rabbitmq-server -y # ちょっとこのへん自信ない。どれかはいるんだけど。 # EmacsやNginxのインストールでコケた際にいろいろ追加したもの。 aptitude install libpcap-dev -y aptitude install libsoci-core-gcc-dev -y aptitude install pcre-devel -y aptitude install lib32gcc1 aptitude install zlibc -y aptitude install zlib1g-dev -y aptitude install libssl-dev -y # require emacs aptitude install libncursesw5-dev -y aptitude install libncurses5-dev aptitude install libtool -y
Nginxのconfigure
./configure \ --conf-path=/etc/nginx/nginx.conf \ --error-log-path=/var/log/nginx/error.log \ --pid-path=/var/run/nginx/nginx.pid \ --lock-path=/var/lock/nginx.lock \ --user=nginx \ --group=nginx \ --with-http_stub_status_module \ --with-http_ssl_module \ --with-http_gzip_static_module \ --with-http_realip_module \ --with-http_dav_module \ --http-log-path=/var/log/nginx/access.log \ --http-client-body-temp-path=/var/tmp/nginx/client/ \ --http-proxy-temp-path=/var/tmp/nginx/proxy/ \ --http-fastcgi-temp-path=/var/tmp/nginx/fcgi/ \ --with-debug
/etc/init.d/nginxの中身
11/22編集:
http://wata-jp.ldblog.jp/archives/1674163.html
こちらを参考にNginxのinitスクリプトを書き換え。
#!/bin/sh
#
# nginx - this script starts and stops the nginx daemon
#
# chkconfig: - 85 15
# description: Nginx is an HTTP(S) server, HTTP(S) reverse \
# proxy and IMAP/POP3 proxy server
# processname: nginx
# config: /etc/nginx/nginx.conf
# pidfile: /var/run/nginx/nginx.pid
# Source function library.
. /etc/rc.d/init.d/functions
nginx="/usr/local/nginx/sbin/nginx"
prog=$(basename $nginx)
NGINX_CONF_FILE="/etc/nginx/nginx.conf"
start() {
[ -x $nginx ] || exit 5
[ -f $NGINX_CONF_FILE ] || exit 6
echo -n $"Starting $prog: "
daemon $nginx -c $NGINX_CONF_FILE
retval=$?
echo
return $retval
}
stop() {
echo -n $"Stopping $prog: "
killproc $prog -QUIT
retval=$?
echo
return $retval
}
restart() {
configtest || return $?
stop
sleep 1
start
}
reload() {
configtest || return $?
echo -n $"Reloading $prog: "
killproc $nginx -HUP
RETVAL=$?
echo
}
force_reload() {
restart
}
configtest() {
$nginx -t -c $NGINX_CONF_FILE
}
rh_status() {
status $prog
}
rh_status_q() {
rh_status >/dev/null 2>&1
}
case "$1" in
start)
rh_status_q && exit 0
$1
;;
stop)
rh_status_q || exit 0
$1
;;
restart|configtest|-t|t)
$1
;;
reload)
rh_status_q || exit 7
$1
;;
force-reload)
force_reload
;;
status)
rh_status
;;
condrestart|try-restart)
rh_status_q || exit 0
;;
*)
echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload|configtest}"
exit 2
esac
/etc/init.d/nginxとか初めて書いたわ!
RabbitMQはaptitudeから入れたところ、Erlangも勝手に引っ張ってくれてたみたい。
そもそも、CentOSのときにRabbitMQのインストールでこけまして、それでubuntuをいれたという経緯がございます。
今気づいたけどsendmailも入ってない。まいったなさすがに敷居高い。
さんざんやっといてアレだけどCentOSに戻そうかな(-_-;
こういうのをサラサラやってるサーバ屋さんとかほんとすごいと思います。
実際はpythonとかもソースから入れてるんだけど割愛。
