Debian-9-安装wordpress-install-wordpress

apt install -y mariadb-server nginx php php7.0-fpm php-pdo php-mysql php-curl php-zip mycli

mkdir -p /run/php-fpm/ /var/log/php-fpm/ /var/lib/php/session /var/lib/php/wsdlcache

chown -R www-data:www-data /var/log/php-fpm/ /run/php-fpm/


vim /etc/php/7.0/fpm/pool.d/wordpress.conf
[wordpress]
user = www-data
group = www-data
listen = /run/php/wordpress.sock
;listen.acl_users = apache,nginx
listen.owner=www-data
listen.group=www-data
isten.mode = 0666
listen.allowed_clients = 127.0.0.1
pm = dynamic
pm.max_children = 50
pm.start_servers = 5
pm.min_spare_servers = 5
pm.max_spare_servers = 35
slowlog = /var/log/php-fpm/wordpress-slow.log
php_admin_value[error_log] = /var/log/php-fpm/wordpress-error.log
php_admin_flag[log_errors] = on
php_value[session.save_handler] = files
php_value[session.save_path]    = /var/lib/php/session
php_value[soap.wsdl_cache_dir]  = /var/lib/php/wsdlcache
php_value[upload_max_filesize] = 10G
php_value[post_max_size] = 10G
env[HOSTNAME] = $HOSTNAME
env[PATH] = /usr/local/bin:/usr/bin:/bin
env[TMP] = /tmp
env[TMPDIR] = /tmp
env[TEMP] = /tmp


mkdir -p /home/nextcloud/public_html /home/nextcloud/logs/

vim /etc/nginx/conf.d/wordpress.conf

upstream wordpress {
    server unix:/run/php/wordpress.sock;
}

server {
    listen       80;
    server_name  ********;
    add_header   X-Frame-Options SAMEORIGIN;
    add_header   X-Content-Type-Options nosniff;
    root         /home/nextcloud/public_html;
    #access_log   /home/nextcloud/logs/access.log main;
    #error_log    /home/nextcloud/logs/error.log;

    client_max_body_size 200M;
    gzip on;
    gzip_min_length 1k;
    gzip_buffers 4 16k;
    gzip_comp_level 5;
    gzip_types text/plain application/x-javascript text/css application/xml text/javascript application/x-httpd-php;


    ## This should be in your http block and if it is, it's not needed here.
    index index.php;

    location = /favicon.ico {
        log_not_found off;
        access_log off;
    }

    location = /robots.txt {
            allow all;
            log_not_found off;
            access_log off;
    }

    location / {
            # This is cool because no php is touched for static content.
            # include the "?$args" part so non-default permalinks doesn't break when using query string
            try_files $uri $uri/ /index.php?$args;
    }

    location ~ \.php$ {
            #NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
            include fastcgi.conf;
            fastcgi_intercept_errors on;
            fastcgi_pass wordpress;
            fastcgi_buffers 16 16k;
            fastcgi_buffer_size 32k;
    }

    location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
            expires max;
            log_not_found off;
    }

    location ^~ /.git/ {
        return 404;
    }
    location ~* \.(log)$ {
        return 404;
    }
}

systemctl start php7.0-fpm nginx mairadb


mysql_secure_installation

mysql -u root -p

create database wordpress;
create user 'wordpress'@'localhost' identified by 'wordpress';
grant all privileges on wordpress.* to wordpress@localhost inentified by 'wordpress';
flush privileges;

cd /home/

wget https://cn.wordpress.org/wordpress-5.0.2-zh_CN.tar.gz

tar -zxvf wordpress-5.0.2-zh_CN.tar.gz

chown -R www-data:www-data wordpress

curl http://***/

#