Faster, Higher, Stronger
更快,更高,更强

Centos7开机自启动nginx, php-fpm

今天收到邮件才发现VPS到期被停用了o(╯□╰)o,赶紧地,去把费用续了,ssh到服务器发现,还好还好,文件都还在,不用重新装软件,不用重新clone仓库代码。不过发现我的wordpress博客没法用了(nginx + php-fpm + mysql),service nginx restart 没用,service mysqld restart 也没用,后来发现可能是php-fpm模块的问题。解决方案如下:

使用以下命令开启相关服务:

systemctl start nginx.service
systemctl start php-fpm.service

然后让这两个服务开机自启:

systemctl enable nginx.service
systemctl enable php-fpm.service

重启服务器,确认是否生效:

shutdown -r now

重新ssh登陆服务器后,systemctl list-units –type=service 查看运行的服务:

UNIT                               LOAD   ACTIVE SUB     DESCRIPTION
acpid.service                      loaded active running ACPI Event Daemon
atd.service                        loaded active running Job spooling tools
auditd.service                     loaded active running Security Auditing Service
crond.service                      loaded active running Command Scheduler
dbus.service                       loaded active running D-Bus System Message Bus
getty@tty1.service                 loaded active running Getty on tty1
httpd.service                      loaded failed failed  The Apache HTTP Server
kmod-static-nodes.service          loaded active exited  Create list of required static device nodes for the current kernel
mysqld.service                     loaded active running MySQL Server
network.service                    loaded active exited  LSB: Bring up/down networking
nginx.service                      loaded active running nginx - high performance web server
ntpdate.service                    loaded active exited  Set time via NTP
php-fpm.service                    loaded active running The PHP FastCGI Process Manager
postfix.service                    loaded active running Postfix Mail Transport Agent
rhel-dmesg.service                 loaded active exited  Dump dmesg to /var/log/dmesg
rhel-readonly.service              loaded active exited  Configure read-only root support
rsyslog.service                    loaded active running System Logging Service
serial-getty@hvc0.service          loaded active running Serial Getty on hvc0
sshd.service                       loaded active running OpenSSH server daemon
systemd-fsck-root.service          loaded active exited  File System Check on Root Device
systemd-journal-flush.service      loaded active exited  Flush Journal to Persistent Storage
systemd-journald.service           loaded active running Journal Service
systemd-logind.service             loaded active running Login Service
systemd-random-seed.service        loaded active exited  Load/Save Random Seed
systemd-remount-fs.service         loaded active exited  Remount Root and Kernel File Systems
systemd-sysctl.service             loaded active exited  Apply Kernel Variables
systemd-tmpfiles-setup-dev.service loaded active exited  Create Static Device Nodes in /dev
systemd-tmpfiles-setup.service     loaded active exited  Create Volatile Files and Directories
systemd-udev-trigger.service       loaded active exited  udev Coldplug all Devices
systemd-udevd.service              loaded active running udev Kernel Device Manager
systemd-update-utmp.service        loaded active exited  Update UTMP about System Boot/Shutdown
systemd-user-sessions.service      loaded active exited  Permit User Sessions

*注:请忽略上面启动失败的httpd.service服务,这个服务我暂时是不用的。

赞(0) 打赏
未经允许不得转载:峰间的云 » Centos7开机自启动nginx, php-fpm

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏