2

centos6搭建在线web代理

 2 years ago
source link: https://www.hi-roy.com/posts/centos6%E6%90%AD%E5%BB%BA%E5%9C%A8%E7%BA%BFweb%E4%BB%A3%E7%90%86/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

centos6搭建在线web代理

2015-05-17

最近有个需求需要搭建一个在线web代理,懒得自己写就找到两个php程序:

  1. knProxy:https://github.com/jabbany/knProxy
  2. glype:https://www.glype.com/download.php

从部署角度来讲这两个都很简单,功能上也很类似,这里我就以第二个为例吧,使用nginx来部署。先来安装nginx和php-fpm

yum install nginx
yum install php-fpm</pre>

下载glype后解压到/var/www/html/glype目录,并在/etc/nginx/conf.d/中创建配置文件如下:

server {
        listen  8000;
        server_name     192.168.2.46;
        access_log      /var/log/nginx-proxy-access.log;
        error_log       /var/log/nginx-proxy-error.log;
        charset         utf-8;
        default_type    text/html;
        root /var/www/html/glype;
        location / {
            index index.php;
        }
        location ~* \.php$ {
            fastcgi_index   index.php;
            fastcgi_pass    127.0.0.1:9000;
            fastcgi_param   SCRIPT_FILENAME     $document_root$fastcgi_script_name;
            include         fastcgi_params;
        }
}

当然了,防火墙什么的根据具体情况开放。之后启动php-fpm以及nginx

service php-fpm start
service nginx start

这样一个简单地web在线代理就完成了,如果服务器在国外,你懂得。

Roy avatar
About Roy
野生程序猿,略懂Python,略懂Golang,略懂云计算,略懂大数据,略懂拳击游泳钓鱼,略懂钢琴吉他摄影。

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK