Apacheでは芸がないので、流行の?nginxにする。
|
|
|
|
|
|
|
|
|
|
|
|
|
|
tce-load -wi nginx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sudo su
|
|
|
|
|
|
|
|
|
mkdir /opt/env/srv/nginx
|
|
|
|
|
|
|
cp /usr/local/nginx.conf.default /opt/env/srv/nginx/nginx.conf
|
|
|
sed -i 's/logs/\/home\/log\/nginx/g' /opt/env/srv/nginx/nginx.conf
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
起動
|
|
|
|
|
|
|
|
|
nginx -c /usr/local/nginx.conf
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
停止
|
|
|
|
|
|
|
|
|
sudo kill `cat /home/log/nginx/nginx.pid`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
コンテンツは/home/htmlにする
|
|
|
|
|
|
sudo su
|
|
|
|
|
|
|
|
|
mkdir /home/html
|
|
|
|
|
|
|
|
chmod 777 /home/html
|
|
|
|
|
|
|
ログは/home/log/nginxにする
|
|
|
|
|
|
|
mkdir -p /home/log/nginx
|
|
|
|
|
|
|
chmod -R 777 /home/log/nginx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
起動スクリプト
|
|
|
|
|
|
|
|
cd /opt/env/srv
|
|
|
|
|
|
|
|
echo \#!/bin/sh>nginx.sh
|
|
|
|
|
|
|
echo while \[ ! -e /usr/local/nginx.conf.default \]>>nginx.sh
|
|
|
echo do>>nginx.sh
|
|
|
|
|
|
|
|
echo cat /dev/null>>nginx.sh
|
|
|
|
|
|
echo done>>nginx.sh
|
|
|
|
|
|
|
echo ln -s /opt/env/srv/nginx/nginx.conf /usr/local/nginx.conf>>nginx.sh
|
echo mv /usr/local/html /usr/local/html__>>nginx.sh
|
|
|
|
echo ln -s /home/html /usr/local/html>>nginx.sh
|
|
|
|
echo ln -s /home/html /usr/local/html>>nginx.sh
|
|
|
|
echo /usr/local/sbin/nginx -c /usr/local/nginx.conf>>nginx.sh
|
|
|
chmod 775 nginx.sh
|
|
|
|
|
|
|
永続化する
|
|
|
|
|
|
|
|
echo sh /opt/env/srv/nginx.sh >>bootlocal.sh
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo hello>/home/html/index.html
|
|
|
|
|
|
reboot
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
確認
|
|
|
|
|
|
|
|
|
telnet localhost 80
|
|
|
|
|
|
|
GET
/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
helloが出てきたらOK
|
|
|
|
|
|
|
|
![IF>
|
|
|
|
|
|
|
|
|
![ENDIF]>