zoukankan      html  css  js  c++  java
  • 编译安装的 mysql apache 用 service mysqld start 来启动

    先我们把mysql增加到linux的系统服务中去

    mysql:

     代码如下 复制代码

    cd /usr/local/mysql/share/mysql

    cp mysql.server /etc/init.d/mysqld

    chkconfig --add mysqld

    chkconfig mysqld on

    service mysqld restart

    现在你就可以使用:service mysqld start来启动mysql了

    apache:

     代码如下 复制代码

    cp /usr/local/apache2/bin/apachectl /etc/rc.d/init.d/httpd 增加httpd服务
    vi /etc/rc.d/init.d/httpd

    在第2行加入

    # chkconfig: - 85 15

    # description: Apache is a World Wide Web server. It is used to serve

    # HTML files and CGI.

    然后执行

     代码如下 复制代码
    chkconfig –add httpd

    这样就可以使用service httpd start来启动apache了。

    另一篇相关教程

    Apache加入到系统服务里面:

    cp /安装目录下/apache/bin/apachectl /etc/rc.d/init.d/httpd

    修改httpd

    在文件头部加入如下内容:
     
     

     代码如下 复制代码
     ### 
      # Comments to support chkconfig on RedHat Linux 
      # chkconfig: 2345 90 90 
      # description:http server 
      ### 
      保存 
      在打入 
      #chkconfig --add httpd 
      #chkconfig --level 345 httpd on

    MySQL加入到系统服务里面 
      

     代码如下 复制代码
    cp /usr/local/mysql/share/mysql/mysql.server /etc/init.d/mysqld 
      #把msql的脚本文件拷到系统的启动目录下 
      cd /etc/init.d/ 
      chkconfig --add mysqld #将mysql加到启动服务列表里 
      chkconfig mysqld on #让系统启动时自动打开mysql服务 
      Apache加入启动项里面: 
      echo '/usr/local/apache2/bin/apachectl start ' >> /etc/rc.local


    总结,上面的方法都差不多,只是两篇文章的写法不一样了,这里大家可自行选择加入系统服务的命令了。

  • 相关阅读:
    SqlServer 查看数据库中所有存储过程
    SqlServer 查看数据库中所有视图
    SqlServer 查询表的详细信息
    SqlServer 遍历修改字段长度
    net core 操作Redis
    Tuning SharePoint Workflow Engine
    Open With Explorer
    Download language packs for SharePoint 2013
    Change Maximum Size For SharePoint List Template when Saving
    Six ways to store settings in SharePoint
  • 原文地址:https://www.cnblogs.com/cocoliu/p/5071440.html
Copyright © 2011-2022 走看看