You are not authorized to view comments.

Server

การติดตั้ง Nginx, Passenger และ Rails 3 บน CentOS

1. ติดตั้ง Nginx

$ rvmsudo passenger-install-nginx-module

2. ติดตั้ง Rails

$ gem install rails

3. เนื่องจากต้องใช้คำสั่ง start-stop-daemon แต่ใน CentOS ไม่มีจึงต้องลงเพิ่ม

$ wget http://developer.axis.com/download/distribution/apps-sys-utils-start-stop-daemon-IR1_9_18-2.tar.gz
$ tar xvfz apps-sys-utils-start-stop-daemon-IR1_9_18-2.tar.gz
$ cd apps/sys-utils/start-stop-daemon-IR1_9_18-2/
$ gcc start-stop-daemon.c -o start-stop-daemon
$ cp start-stop-daemon /usr/sbin/

4. ติดตั้ง script สำหรับใช้งาน Nginx

$ cd /etc/init.d

การติดตั้ง RVM + Ruby บน CentOS 5.6

1. ติดตั้ง git และ curl โดย

$ sudo yum install git
$ sudo yum install curl

2. สร้าง group ชื่อ rvm และเพิ่ม root เข้าใน rvm

$ su -
$ groupadd rvm
$ usermod -a -G rvm root
$ logout

3. ติดตั้ง RVM เข้า system สำหรับใช้แบบผู้ใช้หลายคน

$ sudo bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer )
$ echo '[[ -s "/usr/local/lib/rvm" ]] && . "/usr/local/lib/rvm"  # This loads RVM into a shell session.' >> ~/.bash_profile
$ source ~/.bash_profile
$ type rvm | head -1 # should print 'rvm is a function'

การติดตั้ง Phusion Passenger และ Nginx พร้อม SSL

การติดตั้ง Phusion Passenger และ Nginx ทั่วไปจะยังไม่สามารถใช้งาน SSL ได้ ดังนั้นจึงจำเป็นต้องติดตั้งใหม่อีกครั้ง ดังนี้
1. ติดตั้ง Passenger

sudo gem install passenger

2. ดาวน์โหลด Nginx ไว้ที่ /tmp

cd /tmp
wget http://nginx.org/download/nginx-0.8.53.tar.gz
tar xzf nginx-0.8.53.tar.gz

การติดตั้ง VHCS2 บน Debian Lenny

เมื่อวันจันทร์ที่ผ่านมา ผมต้องทำเว็บเซิร์ฟเวอร์ให้กับคณะเภสัชศาสตร์ ศิลปากร (ไม่เคยทำมาก่อนด้วย ก็กลัวจะทำไมได้เหมือนกัน) โดยตอนแรกเลือกใช้ Ubuntu Server 8.04 LTS แล้วก็เปลี่ยนมาเป็น Debian Lenny แทน ขั้นตอนการลงก็ไม่ได้ยากอะไร หลังจากนั้นก็ลง VHCS (Virtual Hosting Control System) โดยใช้วิธีตามเว็บนี้ VHCS Installation script by Armadillo ซึ่งเราไม่จำเป็นต้องลง Apache2, PHP5, MySQL และ phpMyAdmin ก่อน