Accroding to some common knowledge, Google was banned by some Firewalls.
So if you don’t know how to use a special kind of “ladders”, but you have access to a server outside of somewhere, you can have set up a Google mirror site.
(That’s bullshit, if one already have a normal, no-firewall server, then setting up a proxy tunnel is more useful.)
首先我们需要一台能正常访问Google的服务器,以及你自己的域名。本文通过域名来访问服务器。
然后大致分为这么几个步骤:
- 安装nginx并添加附加模块
- 修改配置文件
- 测试使用效果
1.下载google反代模组
wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.39.tar.gz && tar zxf pcre-8.39.tar.gz
git clone https://github.com/cuber/ngx_http_google_filter_module
git clone https://github.com/yaoweibin/ngx_http_substitutions_filter_module
2.安装nginx
用lnmp一键包安装nginx
下载lnmp安装包
wget http://soft.vpser.net/lnmp/lnmp1.5.tar.gz -cO lnmp1.5.tar.gz
解压
tar zxf lnmp1.5.tar.gz
进入目录
cd lnmp1.5
修改安装参数文件
vi lnmp.conf
在Nginx_Modules_Options后面的单引号对里面添加
--with-pcre=../pcre-8.39 --add-module=../ngx_http_google_filter_module --add-module=../ngx_http_substitutions_filter_module
因为不需要sql数据库和php,选择只安装nginx
./install.sh nginx
然后等一会,喝口水
3.修改配置文件
vi /usr/local/nginx/conf/vhost/nginx.conf
在最后一个大括号里面添加一段配置
server {
server_name localhost;
listen 80;
resolver 8.8.8.8;
location / {
google on;
}
}
4.启动nginx
service nginx restart
然后访问你的域名应该就可以了
没有评论
你先离开吧:)