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

centos搭建代理服务器

发布时间: 2022-07-07 00:42:30

Ⅰ centos局域网服务器怎么搭建

步骤如下:
打开终端(Ctrl+Alt+T)
键入#netconfig。
进去之后,选择IP
V4。
在里面选择自动获取ip。或者固定ip,填写你自己想要的ip就行。
配好后还没完
健入#service
network
restart。
重启下服务就好了。

Ⅱ 如何为CentOS配置snmp代理

切换到系统管理员帐户
安装snmp
确认snmp代理已安装
rpm -q net-snmp
如果未安装,安装snmp
yum install net-snmp
设置开机自动运行snmp
/sbin/chkconfig snmpd on

配置snmp
编辑/etc/snmp/snmpd.conf
更改团体名
查找如下行
# sec.name source community
com2sec notConfigUser default public
将团体名public改为其它任意字段,例:
com2sec notConfigUser default monit
给予可读权限
查找如下行
# group context sec.model sec.level prefix read write notif
access notConfigGroup “” any noauth exact systemview none none
将read权限systemview改为all,例:
access notConfigGroup “” any noauth exact all none none
查找如下行
## incl/excl subtree mask
#view all included .1 80
去掉#view all前面的#,例:
view all included .1 80
启动snmp
/etc/init.d/snmpd start
如果已启动则重启snmp服务
/etc/init.d/snmpd restart
测试snmp
查看端口是否打开
netstat -ln | grep 161
安装snmp测试工具
yum install net-snmp-utils
本机测试snmp数据(修改monit为配置的团体名)
snmpwalk -v 2c -c monit localhost system
远程测试snmp数据(修改ip为服务器ip,snmpwalk命令需要安装net-snmp)
snmpwalk -v 2c -c monit ip system
错误排除
防火墙禁止访问
如果本地测试snmp有数据,远程测试snmp无数据则由于服务器防火墙禁止了外部访问服务器udp 161端口,则:
修改 /etc/sysconfig/iptables (或者:/etc/sysconfig/iptables-config ) ,增加如下规则:
-A RH-Firewall-1-INPUT -p udp -m state –state NEW -m udp –dport 161 -j ACCEPT

重启iptables
/etc/init.d/iptables restart

Ⅲ centos怎么设置代理服务器

CentOS-6.3-i386-bin-DVD1.iso这个就可以的。 下载好以后,在虚拟机中将光驱设为这个iso文件,就可以开始安装了。

Ⅳ centos怎么搭建服务器

服务器是一个硬件,就是说,类似于放置在机房的电脑主机,不过配置比之电脑主机强太多了。
而centos是服务器所安装众多系统中的一种,一般的服务器操作系统则主要分为:Windowsserver、UNIX、Linux、NetWare这四大阵容。centos是其中一个分支。
centos系统的操作是英文命令式操作,需要有一定的操作水平。
海腾数据服务器租用,可以帮你安装你要求的系统,可以参考下

Ⅳ centos6.3 怎么搭建代理服务

实验环境:
系统 centos6.3
内网 eth0:192.168.223.163
外网 eth1:192.168.22.78
Squid Cache: Version squid-3.1.10
网卡配置如下:
内网:
centos6.3(x64) squid透明代理服务器(详细安装步骤) - Only - Only
外网:
centos6.3(x64) squid透明代理服务器(详细安装步骤) - Only - Only
安装
[root@only ~]# yum -y install squid
Installing : 7:squid-3.1.10-18.el6_4.x86_64
Verifying : 7:squid-3.1.10-18.el6_4.x86_64
Installed:
squid.x86_64 7:3.1.10-18.el6_4
Complete!
配置文件如下(更改地方用红色)
[root@only ~]# vim /etc/squid/squid.conf
#
# Recommended minimum configuration:
#
acl manager proto cache_object
acl localhost src 127.0.0.1/32 ::1
acl to_localhost dst 127.0.0.0/8 0.0.0.0/32 ::1

# Example rule allowing access from your local networks.
# Adapt to list your (internal) IP networks from where browsing
# should be allowed
acl localnet src 10.0.0.0/8 # RFC1918 possible internal network
acl localnet src 172.16.0.0/12 # RFC1918 possible internal network
acl localnet src 192.168.0.0/16 # RFC1918 possible internal network
acl localnet src fc00::/7 # RFC 4193 local private network range
acl localnet src fe80::/10 # RFC 4291 link-local (directly plugged) machines

acl SSL_ports port 443
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 # https
acl Safe_ports port 70 # gopher
acl Safe_ports port 210 # wais
acl Safe_ports port 1025-65535 # unregistered ports
acl Safe_ports port 280 # http-mgmt
acl Safe_ports port 488 # gss-http
acl Safe_ports port 591 # filemaker
acl Safe_ports port 777 # multiling http
acl CONNECT method CONNECT
#acl worktime time 8:00-23:59 //定义工作时间
#acl worktime time 00:00-5:59
#http_access allow mynetwork !worktime //只允许非工作时间上网

#
# Recommended minimum Access Permission configuration:
#
# Only allow cachemgr access from localhost
http_access allow manager localhost
http_access deny manager

# Deny requests to certain unsafe ports
http_access deny !Safe_ports

# Deny CONNECT to other than secure SSL ports
http_access deny CONNECT !SSL_ports

# We strongly recommend the following be uncommented to protect innocent
# web applications running on the proxy server who think the only
# one who can access services on "localhost" is a local user
#http_access deny to_localhost

#
# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS
#

# Example rule allowing access from your local networks.
# Adapt localnet in the ACL section to list your (internal) IP networks
# from where browsing should be allowed
http_access allow localnet
http_access allow localhost

# And finally deny all other access to this proxy
http_access allow all

# Squid normally listens to port 3128
http_port 192.168.223.163:3128 transparent

# We recommend you to use at least the following line.
hierarchy_stoplist cgi-bin ?

# Uncomment and adjust the following to add a disk cache directory.
cache_dir ufs /var/spool/squid 2000 16 256

# Leave coremps in the first cache dir
coremp_dir /var/spool/squid

# Add any of your own refresh_pattern entries above these.
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern -i (/cgi-bin/|\?) 0 0% 0
refresh_pattern . 0 20% 4320
visible_hostname 192.168.223.163
cache_mem 256 MB //squid服务器占用内存大小
forwarded_for off //不传递被代理地址
via off //不传递代理服务器信息
初始化squid代理服务器
[root@only ~]# squid -z
2013/08/14 10:06:24| Creating Swap Directories
2013/08/14 10:06:24| /var/spool/squid exists
2013/08/14 10:06:24| Making directories in /var/spool/squid/00
2013/08/14 10:06:24| Making directories in /var/spool/squid/01
2013/08/14 10:06:24| Making directories in /var/spool/squid/02
2013/08/14 10:06:24| Making directories in /var/spool/squid/03
2013/08/14 10:06:24| Making directories in /var/spool/squid/04
2013/08/14 10:06:24| Making directories in /var/spool/squid/05
2013/08/14 10:06:24| Making directories in /var/spool/squid/06
2013/08/14 10:06:24| Making directories in /var/spool/squid/07
2013/08/14 10:06:24| Making directories in /var/spool/squid/08
2013/08/14 10:06:24| Making directories in /var/spool/squid/09
2013/08/14 10:06:24| Making directories in /var/spool/squid/0A
2013/08/14 10:06:24| Making directories in /var/spool/squid/0B
2013/08/14 10:06:24| Making directories in /var/spool/squid/0C
2013/08/14 10:06:24| Making directories in /var/spool/squid/0D
2013/08/14 10:06:24| Making directories in /var/spool/squid/0E
2013/08/14 10:06:24| Making directories in /var/spool/squid/0F
开启路由功能,并将下面的命令写入/etc/rc.d/rc.local 文件,使其开机自动开启路由功能
[root@only ~]# echo '1'>/proc/sys/net/ipv4/ip_forward
或者如下 vi /etc/sysctl.conf文件 将 net.ipv4.ip_forward = 0 改成 =1
[root@only ~]# sysctl -p
net.ipv4.ip_forward = 1
配置iptables防火墙
自动将http请求转发到代理服务器上
[root@only ~]# iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-ports 3128
设置源地址映射
[root@only ~]# iptables -t nat -A POSTROUTING -j SNAT --to-source 192.168.22.78
[root@only ~]# iptables -P INPUT ACCEPT
启动squid代理服务
[root@only ~]# service squid restart
Stopping squid: [FAILED]
Starting squid: . [ OK ]
查看squid代理服务器缓存日志
[root@only ~]# tail -f /var/log/squid/access.log
将squid加入开机启动项
[root@only ~]# chkconfig squid --level 235 on
搞定。

Ⅵ centos7操作系统下如果把本机作为代理服务器

已经有很成熟的经验centos7操作系统下把本机作为代理服务器,希望对你有帮助:
http://jingyan..com/article/a24b33cd51f0b619ff002b7e.html
其实主要还是如下操作:
1.全局的代理设置:
vi /etc/profile
添加下面内容
http_proxy = http://username:password@yourproxy:8080/
ftp_proxy = http://username:password@yourproxy:8080/
export http_proxy
export ftp_proxy
2.yum的代理设置:
vi /etc/yum.conf

热点内容
安卓手机如何清除应用记录 发布:2024-05-18 17:31:37 浏览:639
查看存储过程权限 发布:2024-05-18 17:18:33 浏览:191
php类self 发布:2024-05-18 17:15:03 浏览:894
手机2b2t的服务器地址是多少 发布:2024-05-18 17:14:56 浏览:188
戴尔8490哪个配置比较合理 发布:2024-05-18 17:14:51 浏览:168
删除sqlserver服务 发布:2024-05-18 16:47:06 浏览:323
密码盒的密码是多少钱 发布:2024-05-18 16:43:52 浏览:95
linux哪个c语言编译器好用 发布:2024-05-18 16:30:03 浏览:469
搜狐视频无法缓存 发布:2024-05-18 16:30:03 浏览:310
小鸟云服务器值不值得买 发布:2024-05-18 16:30:01 浏览:899