zoukankan      html  css  js  c++  java
  • nginx动态网站

    第一步:下载相关的软件包
    [root@zxw html]# yum install nginx php php-mysql
    mariadb-server php-fpm -y
    第二步:编辑php匹配规则
    [root@zxw html]# vim /etc/nginx/nginx.conf

    server {
    listen 80 default_server;
    listen [::]:80 default_server;
    server_name _;
    root /usr/share/nginx/html;
    index index.php index.html;
    # Load configuration files for the default server block.
    include /etc/nginx/default.d/*.conf;

    location ~ php$ {
    fastcgi_pass 127.0.0.1:9000;
    include fastcgi.conf;
    }
    第四步:检查并重启
    [root@zxw html]# nginx -t
    nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
    nginx: configuration file /etc/nginx/nginx.conf test is successful
    [root@zxw html]# systemctl restart nginx
    第五步:启动php-fpm
    [root@zxw html]# systemctl restart php-fpm
    [root@zxw html]# ss -tnl
    第五步;上传包。配置数据库文件
    [root@zxw html]# cd /usr/share/nginx/html/
    [root@zxw html]# rz
    [root@zxw html]# unzip wordpress-3.3.1-zh_CN.zip
    [root@zxw wordpress]# cp wp-config-sample.php wp-config.php
    [root@zxw wordpress]# vim wp-config.php

    define('DB_NAME', 'zxw');

    /** MySQL 数据库用户名 */
    define('DB_USER', 'zxw');

    /** MySQL 数据库密码 */
    define('DB_PASSWORD', 'zxw');

    /** MySQL 主机 */
    define('DB_HOST', 'localhost');
    第六步:重启数据库
    [root@zxw wordpress]# systemctl restart mariadb
    第七步;创建数据库用户密码
    [root@zxw wordpress]# mysql -uroot
    MariaDB [(none)]> create database zxw;
    Query OK, 1 row affected (0.00 sec)
    MariaDB [(none)]> grant all on zxw.* to zxw@'localhost' identified by '123'
    Query OK, 0 rows affected (0.00 sec)

  • 相关阅读:
    Flutter Platform Channels
    catch socket error
    global position
    aria2 添加任务后一直在等待,不进行下载是什么情况?
    通知
    rename file
    长按弹菜单
    Linux命令行下如何终止当前程序?
    IOWebSocketChannel.connect handle errors
    writeAsBytes writeAsString
  • 原文地址:https://www.cnblogs.com/itzhao/p/11249954.html
Copyright © 2011-2022 走看看