当前位置:首页 » 云服务器 » linux搭建http代理服务器

linux搭建http代理服务器

发布时间: 2022-04-21 01:21:01

① 如何在linux系统搭建http服务

1、安装ftp服务端,方便你从客户端上传文件。linux上一般安装vsftp.VSFTP的软件安装包是: vsftpd-2.2.2-12.el6_5.1.i686.rpm
查询:#rpm -q vsftpd
安装:#rpm -ivh vsftpd-2.2.2-12.el6_5.1.i686.rpm或者直接yum install vsftpd
启动、停止及重启VSFTP的命令: #service vsftpd start/stop/restart
配置文件:
/etc/vsftpd/vsftpd.conf //主配置文件
/etc/vsftpd.ftpusers //被禁止登录FTP的用户文件
/etc/vsftpd.user_list //允许登录FTP的用户文件
a、将登录后的用户限制在本地家目录下:
#vi /etc/vsftpd/vsftpd.conf
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd.chroot_list
新建受限用户的列表文件并加入受限用户名
#vi /etc/vsftpd.chroot_list
raykeso
重启ftp服务
#service vsftpd restart
2、安装apache,开启目录索引,这样你就可以浏览和下载文件。
apache配置文件
<Directory "I:/build/dist"> #设置浏览文件的目录
Options Indexes #开启目录列表索引模式Order allow,deny
Allow from all
</Directory>

② 如何在linux环境下搭建Tor代理服务器

以下的安装在是centos6.5_64x系统上进行的。
centos系统默认yum源是找不到tor安装包的,若yum install tor提示未找到安装包,需要添加epel yum外部源。EPEL (Extra Packages for Enterprise Linux) 是Fedora小组维护的一个软件仓库项目,为RHEL/CentOS提供他们默认不提供的软件包。这个源兼容RHEL及像CentOS和Scientific Linux这样的衍生版本。
安装步骤如下:
yum install tor 若是提示未找到tor安装包,查看 /etc/yum.repos.d/下是否有epel.repo文件,若没有,说明系统未添加epel yum外部源,需要手动添加,若已经添加epel外部源,可直接安装tor,则跳过2-6步骤。
根据你的操作系统,从网站获取对应的epel 的安装包,centos6.5_64位系统获取的安装包如下 (查看系统版本指令lsb_release -a && uname -a)wgethttp://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
sudo rpm -ivh epel-release-6-5.noarch.rpm
安装成功后可看到 /etc/yum.repos.d/目录下多了epel.repo 与epel-testing.repo文件
yum clean all
yum makecache
yum install tor

③ linux 如何设置代理

linux设置代理linux系统设置yum,wget,rpm命令使用代理:1.Using
yum
with
a
proxyserver---------------------------------------To
enable
yum
operations
to
use
aproxy
server
you
should
first
add
the
following
parameter
to
/etc/yum.conf
proxy=http://yourproxy:8080/
where
yourproxy
is
the
name
of
the
proxy
server
you
want
to
access
and
8080
isthe
proxy
port.
If
the
server
requires
authentication
you
can
specify
the
logincredentials
like:proxy=http://username:password@yourproxy:8080/---------------------------------------2.
The
rpm
package
manager
makesuse
of
the
proxy
environment
variable.
This
can
be
set
system
wide
in
/etc/profile
or
user
specific
in
~/.bash_profile:export
http_proxy=http://yourproxy:8080/export
ftp_proxy=http://yourproxy:8080/---------------------------------------3.
To
use
wget
throug
a
proxy
serveradd
the
following
lines
to
/etc/wgetrc
http_proxy
=
http://yourproxy:8080/
ftp_proxy
=
http://yourproxy:8080/

④ 如何在linux上用squid搭建代理服务器

1、首先下载:squid-3.2.9.tar.bz2
2、上传到服务器后解压
解压: tar -vxjf squid-3.2.9.tar.bz2
解压后生成目录:squid-3.2.9
进入目录翻看文档INSTALL:
xxxx> more INSTALL
To build and install the Squid Cache, type:
% ./configure --prefix=/usr/local/squid
% make all
% make install
To run a Cache, you will need to:
1. customize the squid.conf configuration file:
% vi /usr/local/squid/etc/squid.conf
2. Initalise the cache:
% /usr/local/squid/sbin/squid -z
3. start the cache:
% /usr/local/squid/sbin/squid
If you want to use the WWW interface to the Cache Manager,
the cachemgr.cgi program into your httpd server's cgi-bin
directory.
3、安装步骤:
./configure --prefix=/usr/local/squid
make all
sudo make install(因为要拷贝到系统目录,需要root权限,所以sudo了,你也可以root登录执行,我是Ubuntu的系统,所以用sudo,有root权限就行)
检查配置文件:
sudo vi /usr/local/squid/etc/squid.conf
配置项1:
# Squid normally listens to port 3128
http_port 3128
配置项2:
acl localnet src 192.168.0.0/16
http_access allow localnet
配置项3:
# Uncomment and adjust the following to add a disk cache directory.
cache_dir ufs /usr/local/squid/var/cache/squid 100 16 128
cache_mem 32 MB (这一条必须配置)
否则就会遭遇报错: 2013/10/12 16:16:55 kid1| WARNING cache_mem is larger than total disk cache space!
安装好了以后,系统中新建了一个用户squid,在组中一查,发现属于nobody组的:
cat /etc/passwd|grep squid
cat /etc/group|grep 65534
安装squid的所在目录是:/usr/local/squid
直接改了所属用户为squid:nobody
sudo chown -Rf squid:nobody /usr/local/squid
建立cache的时候,对下面目录需要nobody用户权限:
sudo chown -Rf nobody /usr/local/squid/var/cache/
sudo chown -Rf nobody /usr/local/squid/var/logs/
否则会遭遇:
WARNING: Cannot write log file: /usr/local/squid/var/logs/cache.log
FATAL: Failed to make swap directory /usr/local/squid/var/cache/squid/00: (13) Permission denied
初始化squid.conf里配置的cache目录,就是建立了一堆的目录:
sudo /usr/local/squid/sbin/squid -z
在前台启动squid,并输出启动过程
sudo /usr/local/squid/sbin/squid -N -d1
显示ready to server reques,则启动成功。可以键入ctrl+c,停止squid,并以后台运行的方式启动。
没有在配置文件中配置DNS,而是在 /etc/resolv.conf 中配置:
domain site
nameserver x.x.x.x
所以打印出来的日志中就这样的:
2013/10/12 16:42:13| Adding nameserver x.x.x.x from /etc/resolv.conf
squid从这个配置文件中读取了dns配置来用。
启动squid后台运行
sudo /usr/local/squid/sbin/squid -s
检查一下进程是否存在:ps -ef|grep squid
通过squid客户端查看squid运行状态
/usr/local/squid/bin/squidclient -h 127.0.0.1 -p 3128 mgr:info
那台不能上网的机器配置如下:
export http_proxy=http://192.168.199.235:3128/
可以把这句写到启动文件中,比如什么.profile或者.bashrc,或者/etc/profile等等。
取消:unset http_proxy
最后测试一下能不能上网了。

⑤ 如何在Linux上用Squid搭建代理服务器

squid是所有服务里面最简单的我觉得
以RHEL7为例,它分成了正向代理和反向代理,正向代理里又分“标准正向代理”,“ACL访问控制”以及“透明正向代理”。下面是标准正向代理

16.3 正向代理

16.3.1 标准正向代理

Squid服务程序软件包在正确安装并启动后默认就已经可以为用户提供标准正向代理模式服务了,而不需要单独再去修改配置文件或者其他操作,咱们可以立即在Windows7系统的客户端主机上面打开任意一款浏览器,然后点击Internet选项标签,如图16-4所示:
[root@linuxprobe ~]# systemctl restart squid
[root@linuxprobe ~]# systemctl enable squid
ln -s '/usr/lib/systemd/system/squid.service' '/etc/systemd/system/multi-user.target.wants/squid.service'
用户要想使用Squid服务程序提供的标准正向代理模式服务就必须在浏览器中填写服务器的IP地址以及端口号信息,因此咱们还需要依次点击连接标签后点击局域网设置选项,如图16-5与图16-6所示填写服务器信息后保存退出配置向导。

用户只需要在浏览器中简单的填写配置信息就可以开始享用Squid服务程序提供的代理服务了,此时作为一个网卡为仅主机模式(Hostonly)的虚拟机,开始也奇迹般的能够上网浏览了,这一切都是托代理服务器转发的功劳哦~

如此公开而没有密码验证的代理服务终归觉得不放心,万一有其他人也来“蹭网”咱们的代理服务怎么办呢?Squid服务程序默认的会占用3128、3401与4827等端口号,咱们可以将默认占用的端口号修改成其他值,这样应该能起到一定的保护作用吧~同学们都知道在Linux系统配置服务程序就是在修改该服务的配置文件,因此直接在/etc目录中找到和squid服务程序同名目录中的配置文件,把其中http_port参数后面原有3128修改为10000,这样即是将Squid服务程序的代理服务端口修改成了新值,当然最后不要忘记再重启下服务程序哦~:
[root@linuxprobe ~]# vim /etc/squid/squid.conf
………………省略部分输出信息………………
45 #
46 # INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS
47 #
48
49 # Example rule allowing access from your local networks.
50 # Adapt localnet in the ACL section to list your (internal) IP networks
51 # from where browsing should be allowed
52 http_access allow localnet
53 http_access allow localhost
54
55 # And finally deny all other access to this proxy
56 http_access deny all
57
58 # Squid normally listens to port 3128
59 http_port 10000
60
http_port 10000
………………省略部分输出信息………………
[root@linuxprobe ~]# systemctl restart squid
[root@linuxprobe ~]# systemctl enable squid
ln -s '/usr/lib/systemd/system/squid.service' '/etc/systemd/system/multi-user.target.wants/squid.service'

同学们有没有突然觉得这一幕似曾相识?在前面的第十章10.5.3小节咱们学习过基于端口号来部署httpd服务程序的虚拟主机功能,当时在编辑完配置文件后重启服务程序时被直接提示报错了,虽然现在重启服务程序并没有直接报错,但其实客户并不能使用代理服务呢,SElinux安全子系统认为Squid服务程序使用3128端口号是理所应当的,默认策略规则中也是允许的,但现在却在尝试使用新的10000端口号,这是原本并不属于Squid服务程序应该使用的系统资源,因此咱们需要手动把新的端口号添加到squid服务程序在SElinux域的允许列表中即可:
[root@linuxprobe ~]# semanage port -l | grep -w -i squid_port_t
squid_port_t tcp 3128, 3401, 4827
squid_port_t udp 3401, 4827
[root@linuxprobe ~]# semanage port -a -t squid_port_t -p tcp 10000
[root@linuxprobe ~]# semanage port -l | grep -w -i squid_port_t
squid_port_t tcp 10000, 3128, 3401, 4827
squid_port_t udp 3401, 4827

更多的图文信息以及其他的代理方式你可以看下http://www.linuxprobe.com/chapter-16.html#161这篇,讲的非常详细,相信能解决你的问题

⑥ 如何在Linux下使用代理服务器

linux自带firefox 打开FireFox,编辑->首选项->常规->连接 设置FF访问因特网的方式 连接设置 手动配置代理 然后输入代理服务器IP和端口号即可。

⑦ linux系统下怎么搭建网站服务器

具体方法如下:

1、使用putty或类似的SSH工具登录服务器(本地安装跳过);

⑧ 如何在linux配置http代理

可以在你的用户家目录下的.bashrc的最后加上:
export http_proxy=your_proxy_address:port
export https_proxy=your_proxy_address:port
export ftp_proxy=your_proxy_address:port

直接在terminal窗口输入这些也可以。

热点内容
用哪个软件配置华为企业路由器 发布:2024-05-09 04:23:58 浏览:520
简易脚本 发布:2024-05-09 04:17:30 浏览:801
返校vlog脚本 发布:2024-05-09 04:15:53 浏览:618
vps云服务器免费租用 发布:2024-05-09 04:10:42 浏览:208
空调压缩机排量 发布:2024-05-09 04:08:42 浏览:539
android使用静态库 发布:2024-05-09 04:05:40 浏览:213
原生安卓开机动画在哪里 发布:2024-05-09 03:52:19 浏览:394
微信收藏在哪个文件夹 发布:2024-05-09 03:47:03 浏览:826
ftp远程登录 发布:2024-05-09 03:44:40 浏览:227
linuxoracle配置环境变量配置 发布:2024-05-09 03:44:38 浏览:499