将wordpress部署到安装有nginx的centOS中

直接进入主题

 

1.在centOS中部署nginx环境以及mysql,还有其他部署信息等

202944_P1LR_2481244.png

启动nginx   ↑

 

2.将wordpress.tar.gz复制到一个目录,然后解压:

3.在  /usr/local/nginx/conf/下修改nginx.conf

内容修改如下:

默认网站根目录为/usr/local/nginx/html,要将它改成/homw/www

vi /usr/local/nginx/conf/nginx.conf

将其中的

 

        location / {

            root   html;

            index  index.php index.html index.htm;

        }

改为

 

        location / {

            root   /home/www;

            index  index.php index.html index.htm;

        }

然后再将

location ~ \.php$ {

            root           html;

            fastcgi_pass   127.0.0.1:9000;

            fastcgi_index  index.php;

            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;

            include        fastcgi_params;

        }

改为

location ~ \.php$ {

            root           /home/www;

            fastcgi_pass   127.0.0.1:9000;

            fastcgi_index  index.php;

            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;

            include        fastcgi_params;

        }

然后重启nginx

已经安装了samba,所以要将vi /etc/samba/smb.conf中的[public]下的path值改为

path = /home/www/

转载于:https://my.oschina.net/qkmc/blog/906919

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
要在CentOS 7上部署WordPress,您可以按照以下步骤进行操作: 1. 安装LNMP(Linux、Nginx、MySQL、PHP)环境。您可以使用以下命令安装Nginx: ``` rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm ``` 2. 设置文件权限。请使用以下命令设置WordPress文件夹的权限: ``` cd [WordPress路径的上一级文件夹] sudo chown -R nginx:nginx [WordPress最后一级文件夹] sudo chmod 0755 [WordPress最后一级文件夹] ``` 3. 创建WordPress数据库。首先登录到MySQL数据库: ``` mysql -u root -p ``` 然后创建一个新的数据库并为其分配一个用户。 4. 下载和安装WordPress。您可以从WordPress官方网站下载最新的WordPress版本,并将其解压到Nginx的默认网站根目录。 5. 配置WordPress。进入WordPress目录,将wp-config.php.sample文件复制为wp-config.php,并使用vim编辑器进行编辑: ``` vim [WordPress路径]/wp-config.php ``` 在此文件,您需要提供之前创建的数据库的名称、用户名和密码。 6. 配置Nginx。创建一个新的Nginx配置文件并将以下内容添加到该文件: ``` server { listen 80; server_name your_domain; root /path/to/wordpress; index index.php; location / { try_files $uri $uri/ /index.php?$args; } location ~ \.php$ { fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } } ``` 请将"your_domain"替换为您的域名或IP地址,并将"/path/to/wordpress"替换为您WordPress实际安装的路径。 7. 重启NginxPHP-FPM服务。使用以下命令重启服务: ``` sudo systemctl restart nginx sudo systemctl restart php-fpm ``` 现在,您应该能够通过浏览器访问您的域名或IP地址,然后按照WordPress安装向导完成安装过程。<span class="em">1</span><span class="em">2</span><span class="em">3</span><span class="em">4</span>

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值