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;
}
}
本文来自博客园,作者:ヾ(o◕∀◕)ノヾ,转载请注明原文链接:https://www.cnblogs.com/Jupiter-blog/p/17953926
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构