0

在centos上建个google镜像站

Posted by 撒得一地 on 2016年7月31日 in 杂谈

有时候只是想用google搜索下,如果又vpn,又ss的,很是麻烦,google镜像站就很方便,打开即用。

链接 https://github.com/cuber/ngx_http_google_filter_module/blob/master/README.zh-CN.md

步骤如下

#准备必要工具

yum install -y gcc gcc-c++ git make 

#下载最新版源码

http://nginx.org/en/download.html

wget "http://nginx.org/download/nginx-1.7.8.tar.gz"

#下载最新版 pcre

wget "ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.38.tar.gz"

#下载最新版 openssl

	wget "https://www.openssl.org/source/openssl-1.0.1j.tar.gz"

#下载最新版 zlib

	wget "http://zlib.net/zlib-1.2.11.tar.gz"

#下载本扩展

	git clone https://github.com/cuber/ngx_http_google_filter_module

#下载 substitutions 扩展

	git clone https://github.com/yaoweibin/ngx_http_substitutions_filter_module

#解压缩

	tar xzvf nginx-1.7.8.tar.gz 

	tar xzvf pcre-8.38.tar.gz 

	tar xzvf openssl-1.0.1j.tar.gz 

	tar xzvf zlib-1.2.8.tar.gz

#进入 nginx 源码目录

cd nginx-1.7.8

#设置编译选项

	./configure \ 
	–prefix=/opt/nginx-1.7.8 \ 
	–with-pcre=../pcre-8.38 \ 
	–with-openssl=../openssl-1.0.1j \ 
	–with-zlib=../zlib-1.2.8 \ 
	–with-http_ssl_module \ 
	–add-module=../ngx_http_google_filter_module \ 
	–add-module=../ngx_http_substitutions_filter_module

#编译, 安装

如果扩展有报错, 请发 issue 到

https://github.com/cuber/ngx_http_google_filter_module/issues

	make 
	sudo make install

#启动, 安装过程到此结束

	  /opt/nginx-1.7.8/sbin/nginx

#配置修改后, 需要 reload nginx 来让配置生效,

	/opt/nginx-1.7.8/sbin/nginx -s reload

安装完成后,配置下即可

http配置方式

	server { 
	server_name <你的域名>; 
	listen 80;

	resolver 8.8.8.8; 
	location / { 
	google on; 
	} 
	}

来源:blog.csdn.net 

安装前确保你对 nginx 和 linux 有所了解。

上一篇:

下一篇:

相关推荐

发表评论

电子邮件地址不会被公开。 必填项已用*标注

1 + 7 = ?

网站地图|XML地图

Copyright © 2015-2024 技术拉近你我! All rights reserved.
闽ICP备15015576号-1 版权所有©psz.