Cenos System, chkconfig Setup program boot--mysql, Tomcat, Redis, fastdfs--nginx/fdfs_trackerd/fdfs_storaged

Source: Internet
Author: User

The Setup program starts by adding the program's startup script to the/ETC/INIT.D directory, or writing the startup path to the/etc/rc.d/rc.local file.

set MySQL boot up
Cp/usr/local/mysql/support-files/mysql.server  /etc/init.d/mysql   --add MySQL  chkconfig  MySQL   on
set Fdfs_tracker boot up
cp/usr/local/src/fastdfs/init.d/fdfs_trackerd/etc/init.d/--add Fdfs_trackerdchkconfig fdfs_ Trackerd on
set fdfs_storafed boot up
cp/usr/local/src/fastdfs/init.d/fdfs_storaged/etc/init.d/--add Fdfs_storagedchkconfig fdfs_storaged on
set up Redis boot up
CP  /usr/local/src/redis-stable/utils.

Specific configuration can be described in http://www.open-open.com/lib/view/open1355055890117.html

Set up tomcat boot up

In the startup.sh file, add the following:

Vim  /usr/local/tomcat/bin/startup.shi            // representative enters the document input mode #!/bin/sh                 // #不能少 2345  the xx   # description:tomcat auto start# processname:tomcat

Add the following in the catalina.sh file

 vim/usr/local/tomcat/bin/catalina.shi  //  Enter input mode  export catalina_base=/ Usr/local/tomcat //  fill in the path according to the actual situation  export CA Talina_home=/usr/local/tomcat //  fill in the path according to the actual situation 
    export catalina_tmpdir=/usr/local/tomcat/temp //  export JRE_HOME=/USR/JAVA/JDK1 According to the actual situation. 7  .0_55  //  press ESC : Wq // Save and exit  

Creating a soft connection

Ln-s/USR/LOCAL/TOMCAT/BIN/STARTUP.SH/ETC/INIT.D

Set Startup

Chkconfig--add tomcatchkconfig tomcat on
set Nginx boot up

Create a new Nginx document in the/ETC/INIT.D directory

Write the command and save

#!/bin/bash# nginx Startup script forThe Nginx HTTP server# it isV.0.0.2version.# chkconfig:- -  the# Description:nginx isA high-performance Web and proxy server.# It has a lot of features, but it's not for everyone.# processname:nginx# Pidfile:/usr/local/nginx/logs/nginx.pid//Modify according to the actual situation# config:/usr/local/nginx/conf/nginx.conf//Modify according to the actual situationNginxd=/usr/local/nginx/sbin/nginx//Modify according to the actual situationNginx_config=/usr/local/nginx/conf/nginx.conf//Modify according to the actual situationNginx_pid=/usr/local/nginx/logs/nginx.pid//Modify according to the actual situationRetval=0Prog="Nginx"# Source Function library:/etc/rc.d/init.d/functions# Source Networking configuration:/etc/sysconfig/network# Check that networking isUp . [${networking}="No"] && exit0[ -X $nginxd] | | Exit0# Start Nginx daemons Functions.start () {if[ -e $nginx _pid];then echo"Nginx already running ...."Exit1fi echo-N $"starting $prog:"Daemon $nginxd-c ${nginx_config} RETVAL=$?Echo [$RETVAL=0] && Touch/var/Lock/subsys/Nginxreturn$RETVAL}# Stop nginx daemons functions.stop () {echo-N $"stopping $prog:"Killproc $nginxd RETVAL=$?Echo [$RETVAL=0] && rm-f/var/Lock/subsys/nginx/usr/local/nginx/logs/nginx.pid//Modify according to the actual situation}# Reload Nginx Service Functions.reload () {echo-N $"Reloading $prog:"#kill-HUP ' cat ${nginx_pid} ' Killproc $nginxd-HUP RETVAL=$?echo}# See how we were called. Case " $" inchstart) Start; stop) stop;; reload) reload;; restart) stop start;; Status) status $prog RETVAL=$?        ;;*) echo $"Usage: $prog {start|stop|restart|reload|status|help}"Exit1esacexit $RETVAL

Set on Start

Chkconfig--add  nginxchkconfig nginx on

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.