阿里云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

<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

<?php echo phpinfo(); ?>

外部访问:http://114.215.172.90:8000/phpinfo.php

阅读剩余部分

相关阅读 >>

wordpress插件和主题编写时cookie应如何设置

wordpress在安装使用中出现404、403、500及502问题的分析与解决方法

wordpress中使用php脚本来判断访客来自什么国家

wordpress中邮件的一些修改和自定义技巧

在centos系统上从零开始搭建wordpress博客的全流程记录

wordpress评论者链接在新窗口中打开的方法

wordpress增加返回顶部效果的方法

nginx+rsync+inotify实现负载均衡配置方法

wordpress如何设置文章置顶以及区分置顶文章与普通文章

wordpress实现登录或退出后直接跳转回首页的方法

更多相关阅读请进入《wordpress》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...