`
Callan
  • 浏览: 731194 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

Linux 设置apache,mysql开机启动

阅读更多

mysql设为linux服务

cp /usr/local/mysql5/share/mysql/mysql.server /etc/init.d/mysqld
chkconfig --add mysqld
chkconfig --level 2345 mysqld on
chown mysql:mysql -R /usr/local/mysql5/
service mysqld start

apache设为linux服务

cp /usr/local/apache2/bin/apachectl /etc/init.d/httpd
vi /etc/init.d/httpd

在在#!/bin/sh后面加入下面两行
#chkconfig:345 85 15
#description: Start and stops the Apache HTTP Server.

然后
chmod +x /etc/rc.d/init.d/httpd
chkconfig --add httpd
然后可以用setup命令进入服务设置,设置为开机启动

 

第二种方法:

在/etc/rc.d/rc.local中增加启动apache的命令,例如:/usr/local/httpd/bin/apachectl start

 

分享到:
评论
1 楼 cmzx3444 2011-07-19  
chown mysql:mysql -R /usr/local/mysql5/
请问这里问什么要把mysql的目录拥有者设为 mysql用户,root用户不行吗??

相关推荐

Global site tag (gtag.js) - Google Analytics