服务器 
首页 > 服务器 > 浏览文章

阿里云Centos7安装LNMP+wordpress

(编辑:jimmy 日期: 2024/9/21 浏览:3 次 )

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

<zone>
…
<service name=”nginx”/>
<zone>
#systemctl reload firewalld

测试:http://114.215.172.90/   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:9000

location ~ \.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

<"nofollow" href="http://114.215.172.90:8000/phpinfo.php">http://114.215.172.90:8000/phpinfo.php

4. 安装wordpress

从https://cn.wordpress.org/下载 wordpress-4.4.2-zh_CN.tar.gz, 解压到/usr/www
创建wordpress数据库

#mysql -uroot -p
#create database wordpress

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

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

上一篇:Redhat 6.5下MySQL5.6集群配置方法完整版
下一篇:Centos7 Mysql 5.6 多主一从 解决方案与详细配置
微软与英特尔等合作伙伴联合定义“AI PC”:键盘需配有Copilot物理按键
几个月来,英特尔、微软、AMD和其它厂商都在共同推动“AI PC”的想法,朝着更多的AI功能迈进。在近日,英特尔在台北举行的开发者活动中,也宣布了关于AI PC加速计划、新的PC开发者计划和独立硬件供应商计划。
在此次发布会上,英特尔还发布了全新的全新的酷睿Ultra Meteor Lake NUC开发套件,以及联合微软等合作伙伴联合定义“AI PC”的定义标准。
友情链接:杰晶网络 DDR爱好者之家 南强小屋 黑松山资源网 白云城资源网 SiteMap