4、LNMP高并发服务博客平台搭建实战之wordpress博文伪静态实现

基于:LNMP高并发服务博客平台搭建实战

1、wordpress设置

2、blog网页配置文件

1)修改03_blog.conf

[root@web02 /application/nginx/html/blog]#cat /application/nginx/conf/extra/03_blog.conf
    server {
        listen       80;
        server_name  blog.etiantian.org;
        root html/blog;
        location / {
            index index.php index.html index.htm;
    if (-f $request_filename/index.html){
		rewrite (.*) $1/index.html break;
	 }
	if (-f $request_filename/index.php){
		rewrite (.*) $1/index.php;
	 }
	if (!-f $request_filename){
		rewrite (.*) /index.php;
	 }
    }
        location ~ .*\.(php|php5)?$ {
            fastcgi_pass  127.0.0.1:9000;
            fastcgi_index index.php;
            fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
            include fastcgi.conf;
        }
    }

2)在/application/nginx/html/blog目录下备份index.html

默认访问index.html,咋们做mv备份处理**

[root@web02 /application/nginx/html/blog]#cat index.html
blog.etiantian.org
[root@web02 /application/nginx/html/blog]#mv index.html  index.html_backup
[root@web02 /application/nginx/html/blog]#ls
index.html_backup  readme.html     wp-activate.php     wp-comments-post.php  wp-content   wp-links-opml.php  wp-mail.php      wp-trackback.php
index.php          test_info.php   wp-admin            wp-config.php         wp-cron.php  wp-load.php        wp-settings.php  xmlrpc.php
license.txt        test_mysql.php  wp-blog-header.php  wp-config-sample.php  wp-includes  wp-login.php       wp-signup.php

3)index.php配置文件

[root@web02 /application/nginx/html/blog]#cat index.php 
<?php
/**
 * Front to the WordPress application. This file doesn't do anything, but loads
 * wp-blog-header.php which does and tells WordPress to load the theme.
 *
 * @package WordPress
 */

/**
 * Tells WordPress to load the WordPress theme and output it.
 *
 * @var bool
 */
define( 'WP_USE_THEMES', true );

/** Loads the WordPress Environment and Template */
require __DIR__ . '/wp-blog-header.php';

4)浏览器操作

5)地址解析结果

3、数据库查看

#用户密码登录
[root@web02 ~]#mysql -uroot -poldboy123
#进入具体数据库
oldboy [(none)]>use wordpress;
#显示表
oldboy [wordpress]>show tables;
#查看数据
oldboy [wordpress]>select * from wp_posts\G;
#退出数据库
oldboy [wordpress]>quit;

4、总结

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Tony带水!

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值