wordpress环境搭建与部署

PHP

cd /usr/local/src
wget http://39.108.186.19/download/php/remi-release-7.rpm
yum install -y php73-php-fpm php73-php-cli php73-php-bcmath php73-php-gd php73-php-json php73-php-mbstring php73-php-mcrypt php73-php-mysqlnd php73-php-opcache php73-php-pdo php73-php-pecl-crypto php73-php-pecl-mcrypt php73-php-pecl-geoip php73-php-recode php73-php-snmp php73-php-soap php73-php-xmll
rpm -qa | grep 'php-fpm'
find /etc/opt/remi/php73 -name php.ini
sed -i 's/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/' /etc/opt/remi/php73/php.ini
systemctl restart php73-php-fpm
php73 -v

Nginx

yum -y install nginx-all-modules.noarch

Mysql

cd /usr/local/src/
wget -i -c http://39.108.186.19/download/mysql/mysql57-community-release-el7-10.noarch.rpm
yum -y install mysql-community-server
systemctl start  mysqld.service
grep "password" /var/log/mysqld.log
mysql -uroot -p
ALTER USER 'root'@'localhost' IDENTIFIED BY 'new password';
SHOW VARIABLES LIKE 'validate_password%';
yum -y remove mysql57-community-release-el7-10.noarch

wordpress

server{
        server_name ;
        listen 80;
        rewrite ^(.*) https://$1 permanent;
}

server {
    listen 443 ssl;
    server_name   ;
    if ($host != '') {
        rewrite ^/(.*)$ https:///$1 permanent;}
    ssl_certificate ;
    ssl_certificate_key  ;
    autoindex off;
    index index.html index.htm index.php;
    root wordpress解压路径;
    access_log /var/log/nginx/ main;
    client_max_body_size 100m;
    add_header X-Frame-Options SAMEORIGIN;
    add_header Strict-Transport-Security "max-age=31536000";
    add_header X-Content-Type-Options nosniff;
    add_header X-XSS-Protection "1; mode=block";

    location / {
        index index.html index.htm index.php;
        try_files $uri $uri/ /index.php?$args;
        if (!-e $request_filename) {
            rewrite . /index.php last;
        }
    }

    location ~ \.php?.*$ {
        include fastcgi.conf;
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_index index.php;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_param PATH_INFO $fastcgi_path_info;
        fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    }

}

posted @   ヾ(o◕∀◕)ノヾ  阅读(12)  评论(0编辑  收藏  举报
(评论功能已被禁用)
相关博文:
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
点击右上角即可分享
微信分享提示