centos开机自动启动Apache,Mysql,Samba、Svn等服务的方法
来源:互联网 发布:python数据处理代码 编辑:程序博客网 时间:2024/06/08 19:52
作者:chtdsl
转自:http://blog.csdn.net/chtdsl/article/details/8644788
方法一:使用vi编辑器修改配置文件
1、编辑rc.local文件
#vi /etc/rc.d/rc.local
2、加入如下启动命令
/usr/sbin/apachectl start
/etc/rc.d/init.d/mysqld start
/etc/rc.d/init.d/smb start
/usr/local/subversion/bin/svnserve -d
3、注意:我的这个路径是yum安装这些服务得到的路径,填写时要根据自己的安装路径,找不到可以借助whereis命令,主要是找到apachectl 、mysqld 、smb 这三个启动文件。
方法二:使用chkconfig命令实现
例如要开机后自动启动mysql,apache,vsftpd服务,用以下命令即可:
chkconfig mysqld on
chkconfig httpd on
chkconfig vsftpd on
要关闭自动启动的话,把on改为off就行了。
chkconfig mysqld off
不过要注意的是,如果某个服务尚未被添加到chkconfig列表中,则现需要使用–add参数将其添加进去:
chkconfig –add postfix
如果要查询当前所有自动启动的服务,可以输入:
chkconfig –list
但是这样显示东西太多了,看起来很晕。如果只想看指定的服务怎么办呢?这个时候只需要在“–list”之后加上服务名就好了,比如查看httpd服务是否为自动启动,就输入:
chkconfig –list httpd
这个时候输出的结果:
httpd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
此时0~6均为off,则说明httpd服务不会在系统启动的时候自动启动。我们输入chkconfig httpd on后,再次检查输出结果变为:
httpd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
这个时候2~5都是on,就表明会自动启动了。转载网址:http://blog.163.com/yuang_yu_ping/blog/static/46932876201152544625888/
- centos开机自动启动Apache,Mysql,Samba、Svn等服务的方法
- centos开机自动启动Apache,Mysql,Samba、Svn等服务的方法
- centos开机自动启动Apache,Mysql,Samba、Svn等服务的方法
- centOS下开机自启动apache、mysql、samba、svn等服务的最简单方法
- centos开机自动启动Apache,Mysql等服务的方法
- centos开机自动启动SVN服务的方法
- centos开机自动启动SVN服务的方法
- centos开机自动启动SVN服务的方法
- centos开机自动启动SVN服务的方法
- centos开机自动启动SVN服务的方法1、编辑rc.local文件
- 讲解启动CentOS Samba 服务的方法
- CentOS设置服务开机启动的方法
- CentOS设置服务开机启动的方法
- CentOS设置服务开机启动的方法
- CentOS设置服务开机启动的方法
- CentOS设置服务开机启动的方法
- CentOS设置服务开机启动的方法
- CentOS设置服务开机启动的方法
- 建立调试环境
- Android SystemProperties设置/取得系统属性的用法总结
- Android进程间通信(IPC)机制Binder简要介绍和学习计划
- POJ 2240 Arbitrage
- executeQuery、executeUpdate 和 execute返回值
- centos开机自动启动Apache,Mysql,Samba、Svn等服务的方法
- Python: sorted
- AutoExcuteJob Framework(二)再谈Windows Service:SC 和 InstallUtil 区别
- git的使用
- IE下载文件时自动变为zip扩展名
- 搭建你的嵌入式Vxworks开发环境
- CentOS开启samba服务(附smb.conf手册)
- sqlserver 2008 备份 导入功能
- IOS 中view 添加阴影