redhat/ubuntu 配置apache, mysql自启动
2013-10-21 11:26
309 查看
redhat
A, mysql
chkconfig --level 3 mysqld on
B, apache
1、将apachectl文件拷贝到/etc/rc.d/init.d 中,然后在/etc/rc.d/rc3.d/下加入链接即可。
命令如下:
cp /usr/local/apache/bin/apachectl /etc/rc.d/init.d/httpd //如果有其他的版本的Apache存在,也可以直接覆盖掉
ln -s /etc/rc.d/init.d/httpd /etc/rc.d/rc5.d/S85httpd //建立链接
2、 运行chkconfig –list,发现没有linux服务列表中httpd,通过chkconfig –add httpd来添加,但是提示:httpd服务不支持 chkconfig。需要编辑/etc/rc.d/init.d/httpd,添加以下注释信息:
# chkconfig: 345 85 15
# description: Activates/Deactivates Apache Web Server
第一行3个数字参数意义分别为:哪些Linux级别需要启动httpd(3,4,5);启动序号(85);关闭序号(15)。
保存后执行:chkconfig –add httpd,成功添加。
在rc3.d、rc4.d、rc5.d路径中会出现S85httpd的链接文件,其他运行级别路径中会出现K61httpd的链接文件。
3、运行chkconfig –list httpd
此时Apache就可以自动启动了。
ubuntu
apache
让Ubuntu开机自动启动apache.
1). 复制 /usr/server/apache2/bin/apachectl到/etc/init.d
2). 加载为服务
sudo update-rc.d apachectl defaults
mysql
sudo update-rc.d mysqld defaults
A, mysql
chkconfig --level 3 mysqld on
B, apache
1、将apachectl文件拷贝到/etc/rc.d/init.d 中,然后在/etc/rc.d/rc3.d/下加入链接即可。
命令如下:
cp /usr/local/apache/bin/apachectl /etc/rc.d/init.d/httpd //如果有其他的版本的Apache存在,也可以直接覆盖掉
ln -s /etc/rc.d/init.d/httpd /etc/rc.d/rc5.d/S85httpd //建立链接
2、 运行chkconfig –list,发现没有linux服务列表中httpd,通过chkconfig –add httpd来添加,但是提示:httpd服务不支持 chkconfig。需要编辑/etc/rc.d/init.d/httpd,添加以下注释信息:
# chkconfig: 345 85 15
# description: Activates/Deactivates Apache Web Server
第一行3个数字参数意义分别为:哪些Linux级别需要启动httpd(3,4,5);启动序号(85);关闭序号(15)。
保存后执行:chkconfig –add httpd,成功添加。
在rc3.d、rc4.d、rc5.d路径中会出现S85httpd的链接文件,其他运行级别路径中会出现K61httpd的链接文件。
3、运行chkconfig –list httpd
此时Apache就可以自动启动了。
ubuntu
apache
让Ubuntu开机自动启动apache.
1). 复制 /usr/server/apache2/bin/apachectl到/etc/init.d
2). 加载为服务
sudo update-rc.d apachectl defaults
mysql
sudo update-rc.d mysqld defaults
相关文章推荐
- Ubuntu 16.04 LAMP server 指南 - 配置 Apache2.4,PHP7,和MariaDB(而不是MySQL)
- 阿里云Ubuntu系统从0搭建LAMP(Apache+MySQL+PHP)以及服务器生产环境常用配置
- Ubuntu搭建LAMP服务器(apache+mysql+php),Ubuntu配置php环境
- ubuntu16.04配置Lamp环境(搭建linux+apache+mysql+php7环境
- ubuntu10.04下配置Apache+PHP+MySQL
- Ubuntu 11.10下 apache2.4.1+php5.3.10+mysql的配置
- ubuntu下apache+mysql+php的安装与配置
- Ubuntu配置apache+php+mysql+phpmyadmin环境
- Ubuntu安装配置PHP,Apache,MySQL
- RedHat Enterprise Linux 5下配置Apache+Mysql+Php
- ubuntu+Mysql+jdk+tomcat+apache环境配置
- ubuntu下apache+php+mysql环境配置
- 阿里云Ubuntu系统从0搭建LAMP(Apache+MySQL+PHP)以及服务器生产环境常用配置
- ubuntu+Mysql+jdk+tomcat+apache环境配置
- Ubuntu 9.04下配置Apache+PHP+Mysql+phpmyadmin
- ubuntu12.10 配置LAMP架构(linux+apache+mysql+php)
- Ubuntu 14.04 mysql-apache-php 的安装和配置
- ubuntu16.04配置Lamp环境(搭建linux+apache+mysql+php7环境
- Ubuntu 取消 Apache及MySQL等自启动
- Ubuntu下LAMP_服务器安装配置(Linux+Apache+Mysql+Perl/PHP/Python)