码迷,mamicode.com
首页 > 数据库 > 详细

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

时间:2014-05-20 09:00:18      阅读:401      评论:0      收藏:0      [点我收藏+]

标签:des   style   blog   class   c   code   

[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

bubuko.com,布布扣
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"
bubuko.com,布布扣

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!

[Ubuntu] Autostart nginx, php-fpm and mysql in Ubuntu14.04,布布扣,bubuko.com

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

标签:des   style   blog   class   c   code   

原文地址:http://www.cnblogs.com/davidhhuan/p/3737887.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!