[Ubuntu] Autostart nginx, php-fpm and mysql in Ubuntu14.04

[nginx]

Step 1

Download the shell script

wget https://raw.github.com/JasonGiedymin/nginx-init-ubuntu/master/nginx -O /etc/init.d/nginx

Step 2

chmod +x /etc/init.d/nginx

Step 3

modify the code marked with red color to your configure

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/local/nginx/sbin/nginx

PS="nginx"
PIDNAME="nginx"                     #lets you do $PS-slave
PIDFILE=$PIDNAME.pid                #pid file
PIDSPATH=/usr/local/nginx/logs      #default pid location, you should change it

DESCRIPTION="Nginx Server..."

RUNAS=root                          #user to run as

SCRIPT_OK=0                         #ala error codes
SCRIPT_ERROR=1                      #ala error codes
TRUE=1                              #boolean
FALSE=0                             #boolean

lockfile=/var/lock/subsys/nginx
NGINX_CONF_FILE="/usr/local/nginx/conf/nginx.conf"

Step 4

vi /etc/rc.local

add the code 

service nginx start

 

 

[php-fpm]

Step 1

cp -f (php -5.4.x-source-dir)/sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm

Step 2

chmod +x /etc/init.d/php-fpm

Step 3

vi /etc/rc.local

add the code 

service php-fpm start

 

 

[mysql]

Step 1

cp /path/to/your/mysql/support-files/mysql.server /etc/init.d/mysql

Step 2

vi /etc/rc.local

add the code 

service mysql start

 

Have fun with Ubuntu!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值