关于wordpress的安装

本文详细介绍了如何在CentOS 7环境下部署并配置WordPress,包括安装MySQL、spawn-fcgi、Nginx及关联操作,最终实现WordPress的基础搭建。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

2017年补充

export PHP_FCGI_MAX_REQUESTS=0
/usr/local/spawn/bin/spawn-fcgi -a 127.0.0.1 -p 9000 -u haoning -g haoning -f /usr/bin/php5-cgi -P /var/run/fastcgi-php.pid


PHP_FCGI_MAX_REQUESTS设置php的最大连接数,防止挂掉

2014重新建立wordpress
2014年10月26日centos7的mysql要这样装
wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
# rpm -ivh mysql-community-release-el7-5.noarch.rpm
# yum install mysql-community-server

wget http://www.lighttpd.net/download/spawn-fcgi-1.6.3.tar.bz2
安装 spawn-fcgi


1.启动fastcgi
2.nginx关联fastcgi,运行php
3.nginx连接wordpress,php建立mysql的基础库,

centos6.5上安装
Java代码

yum install php-mysql php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc mysql mysql-server mysql-devel php-devel php
启动fastcgi

view plaincopy to clipboardprint?
# cat fast.sh
#!/bin/sh
/usr/bin/spawn-fcgi -a 127.0.0.1 -p 9000 -u haoning -g haoning -f /usr/bin/php-cgi -P /var/run/fastcgi-php.pid
#
建立用户
useradd haoning -G haoning
启动nginx和web的用户
nginx的配置文件
指定log目录和wordpress的目录为

view plaincopy to clipboardprint?
user haoning;    
worker_processes 4;
events {
worker_connections 1024;
}
http {
include mime.types;
server {
listen 80;
server_name 203.195.183.79;
access_log /home/haoning/log/access.log;
location / {
root /home/haoning/www;
index index.html index.htm index.php;
}

location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
set $path_info "/";
set $real_script_name $fastcgi_script_name;
if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") {
set $real_script_name $1;
set $path_info $2;
}
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /home/haoning/www;
}
fastcgi_param SCRIPT_FILENAME /home/haoning/www/$real_script_name;
fastcgi_param script_name $real_script_name;
fastcgi_param path_info $path_info;
include /usr/local/nginx_wordpress/conf/fastcgi_params;
}
}

下载

view plaincopy to clipboardprint?
cd /data/wordpress    
wget http://cn.wordpress.org/wordpress-3.5.2-zh_CN.tar.gz
tar zxvf wordpress-3.5.2-zh_CN.tar.gz
ln -s /data/wordpress/wordpress /home/haoning/www
mysql:

view plaincopy to clipboardprint?
mysql -uroot -h203.195.183.79 -p
create database haowordpress;
grant all on *.* to root@'%' identified by "mima" WITH GRANT OPTION;
flush privileges;

配置文件
cp wp-config-sample.php wp-config.php
vim wp-config.php
修改数据库连接,尽量不要用localhost,用实际ip

启动fastcgi,启动nginx
访问
如果403就是路径问题,严格检查下,最好复制上面的稍作改动
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值