WordPress一般都安装在OS系统,宝塔面板一键安装非常简单,一般windows server 系统也不建议使用,但有时一些政府单位或者大的企业基本都用得到WIN服务器,很多服务器都是一个站点比较闲置,今天安WordPress 6.8.1装整个过程顺利,但还是有很多小问题,比如安装速度慢(通过插件禁用一些接口提升速度),超级缓存插件是基础应用,但在WIN服务器上问题很多,将整个安装与大家分享一下。
为了解决WUN服务器支持多域名SSL多证书支持,首先得用windows server 2012以上版本才行,几个版本都支持在线升级,如2012在线升级至2016或者2019,如果配置不高不建议升级到高版本。
安装宝塔面板,主要目的可在线申请免费SSL证书。WordPress插件并不是越多越好,有些插件有冲突时会导致速度慢各种小问题,今天分享一下常用几个基础插件优化就能完全满足站点的需求。
方法一:宝塔WIN面板在线一键部署
增加站点找到一键部署,填写域名,其他可默认,这里注意默认是PHP8.0,安装后可换回PHP7.4(较稳定),部署过程中会自建数据库,安装过程中填写对应数据库信息和管理员账号即可完成安装
二、下载源码安装部署
下载上述地址源码,上传至新建站点目录,绑定域名,新建数据库,申请SSL证书,打开网址按提示输入填写对应数据库信息和管理员账号,提示完成即可进入后台。
三、WordPress编辑器替换
默认的编辑器估计没几个喜欢,插件打到经典编辑器安装,启用即可
启用后文章编辑页即可显示
四、安装WPJAM BASIC插件
WPJAM 常用的函数和接口,屏蔽所有 WordPress 不常用的功能。启用后打开速度得到明显的提升,基本把一些国外的接口屏弊
五、云存储插件
比如牛七云,如果用到阿里云、腾讯云搜索对应安装,图片的速度决定了网站打开的速度,使用对象存储体验更好
六、超级缓存插件安装
个人觉得这插件非常重要,使用后速度体验非常好,WIN系统安装会提示各种权限问题,设置后也不管用的情况 ,这时候就需要手动增加
根目录下wp-config.php文件增加缓存目录,只需要改下前段部分
1 2 3 |
进入目录/wp-content新建两个文件内容如下
advanced-cache.php wp-cache-config.php 可以从其他建好的网站搬至过来
advanced-cache.php代码下载
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | <!--?php <br ?--> // WP SUPER CACHE 1.2 function wpcache_broken_message() { global $wp_cache_config_file; if ( isset( $wp_cache_config_file ) == false ) { return ''; } $doing_ajax = defined( 'DOING_AJAX' ) && DOING_AJAX; $xmlrpc_request = defined( 'XMLRPC_REQUEST' ) && XMLRPC_REQUEST; $rest_request = defined( 'REST_REQUEST' ) && REST_REQUEST; $robots_request = strpos( $_SERVER['REQUEST_URI'], 'robots.txt' ) != false; $skip_output = ( $doing_ajax || $xmlrpc_request || $rest_request || $robots_request ); if ( false == strpos( $_SERVER['REQUEST_URI'], 'wp-admin' ) && ! $skip_output ) { echo '<!-- WP Super Cache is installed but broken. The constant WPCACHEHOME must be set in the file wp-config.php and point at the WP Super Cache plugin directory. -->'; } } if ( false == defined( 'WPCACHEHOME' ) ) { define( 'ADVANCEDCACHEPROBLEM', 1 ); } elseif ( ! include_once WPCACHEHOME . 'wp-cache-phase1.php' ) { if ( ! @is_file( WPCACHEHOME . 'wp-cache-phase1.php' ) ) { define( 'ADVANCEDCACHEPROBLEM', 1 ); } } if ( defined( 'ADVANCEDCACHEPROBLEM' ) ) { register_shutdown_function( 'wpcache_broken_message' ); } |
wp-cache-config.php代码下载
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 | <?php /* WP-Cache Config Sample File See wp-cache.php for author details. */ $dismiss_readable_warning = 1; $wp_cache_debug_username = 'eb19e7a6726a2c0d73aaaa1a55b3b781'; $wp_cache_home_path = '/'; $wp_cache_slash_check = 0; $cache_page_secret = '8763c920a1d32fe1d4003d06a36034f2'; $cache_time_interval = 600; if ( ! defined('WPCACHEHOME') ) define( 'WPCACHEHOME', WP_CONTENT_DIR . "/plugins/wp-super-cache/" ); $cache_compression = 1; $cache_enabled = true; $super_cache_enabled = true; $cache_max_time = 1800; //$use_flock = true; // Set it true or false if you know what to use $cache_path = 'E:\\wwwroot\\cxsee.com\\wp-content/cache/'; $file_prefix = 'wp-cache-'; $ossdlcdn = 0; // Array of files that have 'wp-' but should still be cached $cache_acceptable_files = array( 'wp-comments-popup.php', 'wp-links-opml.php', 'wp-locations.php' ); $cache_rejected_uri = array('wp-.*\\.php', 'index\\.php'); $cache_rejected_user_agent = array(); $cache_rebuild_files = 1; // Disable the file locking system. // If you are experiencing problems with clearing or creating cache files // uncommenting this may help. $wp_cache_mutex_disabled = 1; // Just modify it if you have conflicts with semaphores $sem_id = 1633722315; if ( '/' != substr($cache_path, -1)) { $cache_path .= '/'; } $wp_cache_mobile = 0; $wp_cache_mobile_whitelist = 'Stand Alone/QNws'; $wp_cache_mobile_browsers = 'Android, 2.0 MMP, 240x320, AvantGo, BlackBerry, Blazer, Cellphone, Danger, DoCoMo, Elaine/3.0, EudoraWeb, hiptop, IEMobile, iPhone, iPod, KYOCERA/WX310K, LG/U990, MIDP-2.0, MMEF20, MOT-V, NetFront, Newt, Nintendo Wii, Nitro, Nokia, Opera Mini, Palm, Playstation Portable, portalmmm, Proxinet, ProxiNet, SHARP-TQ-GX10, Small, SonyEricsson, Symbian OS, SymbianOS, TS21i-10, UP.Browser, UP.Link, Windows CE, WinWAP'; // change to relocate the supercache plugins directory $wp_cache_plugins_dir = WPCACHEHOME . 'plugins'; // set to 1 to do garbage collection during normal process shutdown instead of wp-cron $wp_cache_shutdown_gc = 0; $wp_super_cache_late_init = 0; // uncomment the next line to enable advanced debugging features $wp_super_cache_advanced_debug = 0; $wp_super_cache_front_page_text = ''; $wp_super_cache_front_page_clear = 0; $wp_super_cache_front_page_check = 0; $wp_super_cache_front_page_notification = '0'; $wp_cache_anon_only = 0; $wp_supercache_cache_list = 1; $wp_cache_debug_to_file = 0; $wp_super_cache_debug = 0; $wp_cache_debug_level = 5; $wp_cache_debug_ip = ''; $wp_cache_debug_log = 'fff317ef21f5e69fe14571e6219a8e84.php'; $wp_cache_debug_email = ''; $wp_cache_pages[ "search" ] = 0; $wp_cache_pages[ "feed" ] = 0; $wp_cache_pages[ "category" ] = 0; $wp_cache_pages[ "home" ] = 0; $wp_cache_pages[ "frontpage" ] = 0; $wp_cache_pages[ "tag" ] = 0; $wp_cache_pages[ "archives" ] = 0; $wp_cache_pages[ "pages" ] = 0; $wp_cache_pages[ "single" ] = 0; $wp_cache_pages[ "author" ] = 0; $wp_cache_hide_donation = 0; $wp_cache_not_logged_in = 2; $wp_cache_clear_on_post_edit = 0; $wp_cache_hello_world = 0; $wp_cache_mobile_enabled = 0; $wp_cache_cron_check = 1; $wp_cache_mfunc_enabled = 1; $wp_cache_make_known_anon = 0; $wp_cache_refresh_single_only = 1; $wp_cache_mod_rewrite = 0; $wp_supercache_304 = 1; $wp_cache_front_page_checks = 1; $wp_cache_disable_utf8 = 0; $wp_cache_no_cache_for_get = 0; $cache_scheduled_time = "00:00"; $wp_cache_preload_interval = 600; $cache_schedule_type = 'interval'; $wp_cache_preload_posts = 0; $wp_cache_preload_on = 0; $wp_cache_preload_taxonomies = 0; $wp_cache_preload_email_me = 0; $wp_cache_preload_email_volume = 'none'; $wp_cache_mobile_prefixes = ''; $cached_direct_pages = array( ); $wpsc_served_header = false; $cache_gc_email_me = 0; $wpsc_save_headers = 0; $cache_schedule_interval = 'hourly'; $wp_super_cache_comments = 1; $wpsc_version = 169; ?> |
上成再启用超级缓存即可正常
如果要显示https://网址/10.html 样式,在固定链接设置自定义下结构
评论(0)