參考鏈接:在centos上建個google鏡像站 | 技術拉近你我!

(個人在http://yunlifang.cn上購買的香港的vps)

一、首先用xshell鏈接vps:(有個人免" />

国产成人精品无码青草_亚洲国产美女精品久久久久∴_欧美人与鲁交大毛片免费_国产果冻豆传媒麻婆精东

15158846557 在線咨詢 在線咨詢
15158846557 在線咨詢
所在位置: 首頁 > 營銷資訊 > 網站運營 > centos 7.1下制作google鏡像站

centos 7.1下制作google鏡像站

時間:2023-06-22 01:15:01 | 來源:網站運營

時間:2023-06-22 01:15:01 來源:網站運營

centos 7.1下制作google鏡像站:參考鏈接: cuber/ngx_http_google_filter_module

參考鏈接:在centos上建個google鏡像站 | 技術拉近你我!

(個人在http://yunlifang.cn上購買的香港的vps)

一、首先用xshell鏈接vps:(有個人免費版的,到官網注冊即可下載)







聯(lián)網后輸入命令:

ifconfig查看本機外網ip,記錄后備用:




二、下面進行配置




1.下載文件:

yum install -y gcc gcc-c++ git makewget "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_modulegit clone https://github.com/yaoweibin/ngx_http_substitutions_filter_module


2.解壓文件:

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


3.進入nginx源碼文件夾:

cd nginx-1.7.8


4.設置編譯選項:

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


5.編譯、安裝:

makesudo make install


6.接下來啟動, 測試安裝是否成功:

/opt/nginx-1.7.8/sbin/nginx -t7.進入conf文件編輯:

vi /opt/nginx-1.7.8/conf/nginx.conf按a鍵可以進行編輯,坐下角會出現(xiàn)insert標志,這是linux基本的命令。按ESC后,輸入:wq是保存并退出,輸入:q!是不保存退出。




8.將conf文件中server部分修改如下:

server { listen 80; server_name www.abc.com;#此處換成該vps的外網ip(前一步得到的那個),或者自己的網址 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"; } }ESC后輸入保存并退出文件的命令:




9.啟動nginx

/opt/nginx-1.7.8/sbin/nginx -c /opt/nginx-1.7.8/conf/nginx.conf如果此時nginx已經啟動,得重新加載一次

/opt/nginx-1.7.8/sbin/nginx -s reload至此在本地瀏覽器輸入vps的ip地址,已經可以訪問google了



關鍵詞:

74
73
25
news

版權所有? 億企邦 1997-2025 保留一切法律許可權利。

為了最佳展示效果,本站不支持IE9及以下版本的瀏覽器,建議您使用谷歌Chrome瀏覽器。 點擊下載Chrome瀏覽器
關閉