Use foreign VPS with centos7 system to create google mirror

888u

Last update at :2024-02-08,Edit by888u

At present, there are many search engines in mainland China, such as Baidu, 360, Sogou, etc. Baidu is basically the only one, but there are too many content advertisements in Baidu searches, and some junk merchants use bidding rankings to push their services to the top First of all, it is very difficult for us to find an official website. At this point, we think of Google search. Google search is very conscientious. The things you search are basically what you want. I heard that Google is going to return to China. Mainland China, I believe that Google will not let go of the market in mainland China, but it is currently impossible to access Google. However, we can use a foreign VPS to create a Google mirror to use Google search. Today I will share with you a production tutorial. We use It is a production method on github.

VPS selection suggestions

Ranking Merchant Package Purchase link
1 virmach $10.5/year 512M memory 500G traffic KVM Click to buy
2 vultr $3.5/month 512M memory 500G traffic KVM IP can be changed at any time Click to buy
3 Tiler mover $48.6/year 1G memory 1T traffic KVM CN2 line Click to buy

Author address

https://github.com/cuber/ngx_http_google_filter_module

How to make

Use Xshell to connect to your VPS and enter the following script:

yum install -y gcc gcc-c++ git make wget "http://nginx.org/download/nginx-1.7.8.tar.gz" wget "ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.38.tar.gz" wget "https://www.openssl.org/source/openssl-1.0.1j.tar.gz" wget "https://www.openssl.org/source/openssl-1.0.1j.tar.gz" wget "http://zlib.net/zlib-1.2.11.tar.gz" git clone https://github.com/cuber/ngx_http_google_filter_module git clone https://github.com/yaoweibin/ngx_http_substitutions_filter_module

Extract the downloaded compressed package and use the decompression command:

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.11.tar.gz

First we need to install nginx and enter the nginx source code folder:

cd nginx-1.7.8

Set the compilation options:

./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

Start compilation and installation:

make sudo make install

After the installation is complete, let’s check whether it was successful

/opt/nginx-1.7.8/sbin/nginx -t

It is successful if the following interface is displayed

Edit conf file, edit command:

vi /opt/nginx-1.7.8/conf/nginx.conf

How to use the editor

Press the a key to edit, and the insert sign will appear in the lower corner. This is a basic Linux command. After pressing ESC, enter: wq to save and exit, enter: q! to exit without saving.

Change the server part to the following

server { listen 80; server_name www.123.com;#Change to your domain name, which needs to be resolved to the VPS location/{ proxy_pass https://www.google.com; proxy_connect_timeout 120; proxy_read_timeout 600; proxy_send_timeout 600; send_timeout 600; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; google on; google_language "zh-CN"; } }

You can also change it to the following content

server { server_name www.123.com;#Change to your domain name listen 80; resolver 8.8.8.8; location/{ google on; } }

After ESC, enter the command to save and exit the file: If you don't know how to use the vi command, you can download a WinSCP software. This software can manage files on the VPS very easily. Start nginx

/opt/nginx-1.7.8/sbin/nginx -c /opt/nginx-1.7.8/conf/nginx.conf

If nginx is already running and needs to be restarted, the new configuration will be loaded. The restart command is as follows:

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

In this way, when you open your domain name, the Google page will appear, and you can search happily. You will no longer have to look at advertisements from other search engines.

Recommended site search: domain name service provider, Wanwang domain name space, China domain name trading center, Chinese domain name query, overseas virtual host, free website space, US domain name website, website registration number query, php host space, foreign vps server rental ,

Use foreign VPS with centos7 system to create google mirror

All copyrights belong to 888u unless special state
取消
微信二维码
微信二维码
支付宝二维码