首页 > 代码库 > CentOS设置开机启动

CentOS设置开机启动

# 1编辑启动文件
vi /etc/rc.d/rc.local

export JAVA_HOME=/usr/local/java/jdk1.7.0_55

# start fastDFS
/usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf
/usr/bin/fdfs_storaged /etc/fdfs/storage.conf
/usr/local/nginx/sbin/nginx

# start redis
cd /redis/6379
./bin/redis-server redis.conf

# start solr
/solr/apache-tomcat-7.0.47/bin/startup.sh start

# 2重启
reboot

# 3查看服务有没有开机启动
ps -ef | grep fdfs
ps -ef | grep redis
ps -ef | grep solr

CentOS设置开机启动