千家信息网

Centos7怎么安装LNMP+wordpress

发表于:2025-02-20 作者:千家信息网编辑
千家信息网最后更新 2025年02月20日,本篇内容主要讲解"Centos7怎么安装LNMP+wordpress",感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习"Centos7怎么安装LNMP+word
千家信息网最后更新 2025年02月20日Centos7怎么安装LNMP+wordpress

本篇内容主要讲解"Centos7怎么安装LNMP+wordpress",感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习"Centos7怎么安装LNMP+wordpress"吧!

1. 安装nginx

#yum install nginx      #配置文件处于/etc/nginx#systemctl start nginx   #启动nginx#systemctl enable nginx.service  # 设置为开机启动#systemctl status firewalld  #检查防火墙,如果为active (running),则#vim /etc/firewalld/zones/public.xml   # 在zone#systemctl reload firewalld

测试: 114.215.172.90为外网ip地址

2. 安装mysql(not mariadb)

#rpm -uvh http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm#yum repolist enabled | grep "mysql.*-community.*"#yum -y install mysql-community-server#yum -y install mysql-community-server   #安装社区版#systemctl start mysqld                  # 启动mysql#mysql_secure_installation              # mysql安全安装,输入root密码,一路y

3. 安装php

#yum install php-fpm php-mysql#systemctl start php-fpm        # 启动php-fpm#systemctl enable php-fpm      # 设置开机启动#mkdir /var/www#chown -r apache:apache /var/www

修改nginx的配置文件:在 /etc/nginx/conf.d 目录下新建 wordpress.conf

server {listen 8000;# pass the php scripts to fastcgi server listening on 127.0.0.1:9000location ~ \.php$ {root /usr/www;fastcgi_pass 127.0.0.1:9000;fastcgi_index index.php;fastcgi_param script_filename $document_root$fastcgi_script_name;include fastcgi_params;}}
#systemctl reload nginx

在/usr/www 目录中创建 phpinfo.php

外部访问:

4. 安装wordpress

从下载 wordpress-4.4.2-zh_cn.tar.gz, 解压到/usr/www
创建wordpress数据库

#mysql -uroot -p#create database wordpress

通过访问,并安装提示进行安装,中间需要添加mysql用户名和密码,并制定wordpress相关的用户名和密码,然后创建成功。

访问既可,也可以点击页面中的登陆进行页面设置等相关管理工作。

到此,相信大家对"Centos7怎么安装LNMP+wordpress"有了更深的了解,不妨来实际操作一番吧!这里是网站,更多相关内容可以进入相关频道进行查询,关注我们,继续学习!

0