IT博客汇
  • 首页
  • 精华
  • 技术
  • 设计
  • 资讯
  • 扯淡
  • 权利声明
  • 登录 注册

    ubuntu真让我伤心

    Christopher发表于 2017-01-12 15:18:00
    love 0

    在ubuntu 16.04中装了vestacp,恢复了备份,结果发现网站连接不了数据库,后来发现是没有恢复mysql用户的备份,我只好手动新建了用户,不过之后发现了解决方法,在这里 https://forum.vestacp.com/viewtopic.php?f=20&t=13239

    之后修改了vestacp的后台端口,重启了服务器,结果服务器不影响。。。
    检查发现是apache2和nginx没有运行。。。
    vestacp安装的包都是通过apt-get install安装的,安装好后这些应该都是默认开机启动的,然而这次就是没有自动启动。。。
    16.04用的systemd,所以可以通过systemctl start nginx 和systemctl start apache2来启动,然后

    systemctl enable nginx.service
    systemctl enable nginx
    

    来添加为服务,开机启动,然而我遇到了这样的情况

    systemctl enable apache2
    apache2.service is not a native service, redirecting to systemd-sysv-install
    Executing /lib/systemd/systemd-sysv-install enable apache2
    systemctl enable nginx
    nginx.service is not a native service, redirecting to systemd-sysv-install
    Executing /lib/systemd/systemd-sysv-install enable nginx
    

    中间试过自己创建nginx.service的方法没有成功
    搜索了好一会也没找到解决的办法,只好在/etc/rc.local里添加了

    service apache2 start
    service nginx start
    

    重启后好了



沪ICP备19023445号-2号
友情链接