當前位置:首頁 » 雲伺服器 » 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-09 02:33:00 瀏覽:149
遼事通登記需要的密碼是什麼 發布:2024-05-09 02:25:45 瀏覽:283
雲伺服器選擇什麼系統 發布:2024-05-09 01:55:51 瀏覽:968
mel腳本編程全攻略 發布:2024-05-09 01:54:43 瀏覽:479
如何在機房安裝ntp伺服器 發布:2024-05-09 01:13:57 瀏覽:206
ideajavaidea 發布:2024-05-09 01:02:14 瀏覽:965
oas存儲 發布:2024-05-09 00:57:49 瀏覽:801
android點擊彈出菜單 發布:2024-05-09 00:56:52 瀏覽:99
大家對雲伺服器認知度 發布:2024-05-09 00:46:00 瀏覽:659
思科視頻會議如何配置 發布:2024-05-09 00:45:59 瀏覽:669