centos 6.5 搭建WordPress

CentOS6.5 搭建WordPress

由于公司有需要员工书写技术文章的想法,所以才有了在公司服务器上搭建WordPress的想法。

需要的软件&库

WebServer:Nginx
DataBase:MySQL
RunEnvoriment : php7.5
WordPress

mysql配置

//为WordPress创建对应的数据库即可
create database wordpress;

nginx配置

server {
    listen       80;
    server_name xxx.xxx.xxx;
    root   /var/www/html/wordpress;
    try_files $uri $uri/ /index.php?q=$uri&$args;
    error_log /imgData/nginx/wordpress/error.log;
    access_log  /imgData/nginx/wordpress/access.log;
    location / {
        index index.php  index.html index.htm;
    }

    location ~ \.php$ {
        root           /var/www/html/wordpress;
        fastcgi_pass   127.0.0.1:9905;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME   $document_root$fastcgi_script_name;
        include        fastcgi_params;
    }
}

php配置

[wordpress]
listen = 127.0.0.1:9905
listen.allowed_clients = 127.0.0.1

user = nginx
group = nginx

pm = dynamic
pm.max_children = 50
pm.start_servers = 1
pm.min_spare_servers = 1
pm.max_spare_servers = 35

slowlog = /var/log/php-fpm/www-slow.log

php_admin_value[error_log] = /var/log/php-fpm/www-error.log
php_admin_flag[log_errors] = on
php_value[session.save_handler] = files
php_value[session.save_path] = /var/lib/php/session

WordPress配置

/* 主要配置MySQL部分 */
define('DB_NAME', 'wordpress');

/** MySQL database username */
define('DB_USER', 'xxx');

/** MySQL database password */
define('DB_PASSWORD', 'xxx');

/** MySQL hostname */
define('DB_HOST', 'xxx.xxx.xxx.xxx');

/** Database Charset to use in creating database tables. */
define('DB_CHARSET', 'utf8');

/** The Database Collate type. Don't change this if in doubt. */
define('DB_COLLATE', '');

启动WordPress

chconfig add php-fpm
chconfig php-fpm on
service php-fpm start 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值