本站即日起正式部署SSL证书启用https安全连接, 联系站长:416326801#qq.com(#改成@)

Latest from the blog

emlog设置https后边栏日期不能显示

标签: PHP

修改/include/lib/function.base.php


/**
 * 获取站点地址(仅限根目录脚本使用,目前仅用于首页ajax请求)
 */
function getBlogUrl() {
	$phpself = isset($_SERVER['SCRIPT_NAME']) ? $_SERVER['SCRIPT_NAME'] : '';
        // 增加https端口判断
        $protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) ? "https://" : "http://";
	if (preg_match("/^.*\//", $phpself, $matches)) {
		return $protocol . $_SERVER['HTTP_HOST'] . $matches[0];
		// return 'http://' . $_SERVER['HTTP_HOST'] . $matches[0];
	} else {
		return BLOG_URL;
	}
}


Apache部署SSL证书配置https

标签: Apache

<VirtualHost *:443>
    DocumentRoot "/var/www/html"
    ServerName jishu8.net
    SSLEngine on
    SSLCertificateFile /usr/local/apache/conf/2_jishu8.net_cert.crt
    SSLCertificateKeyFile /usr/local/apache/conf/3_jishu8.net.key
    SSLCertificateChainFile /usr/local/apache/conf/1_root_bundle.crt
</VirtualHost>
1 2 3 4 5 6 ... Next »... Last »