[Ubuntu] Autostart Nginx, php-fpm and MySQL in Ubuntu14.04

Source: Internet
Author: User
Tags fpm nginx server

[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/binDAEMON =/usr/local/nginx/sbin/ nginxPS="Nginx"Pidname="Nginx"                     #lets do $PS-slavepidfile=$PIDNAME. pid#pid Filepidspath=/usr/local/nginx/logs #default PID location, your should change itDESCRIPTION="Nginx Server ..."RUNAS=root#user to run asSCRIPT_OK=0#ALA Error CodesScript_error=1#ALA Error CodesTRUE=1#BooleanFALSE=0#BooleanLockfile=/var/lock/subsys/nginxnginx_conf_file = "/usr/local/nginx/conf/nginx.conf"

Step 4

Vi/etc/rc.local

Add the Code

Service Nginx Start

[PHP-FPM]

Step 1

- 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

Has fun with ubuntu!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.