Skip to content

[Linux] Proxy 서버 설정하기

조회 수 17097 추천 수 0 2014.06.17 06:55:44

서버중 외부로 나가는 트래픽이 막혀있는 서버가 있다면 프록시를 통해 외부로 나가는 요청을 할수가 있습니다.

 

 

1. 로그인 세션 동안만 유지되는 방법


텔넷이나 ssh에 로그인 되어있는동안만 프록시를 사용하고 있다면 다음과 같이 사용하면 됩니다.

 


# 프록시 서버 설정
export http_proxy=http://www.yourproxyserver.com:port
export https_proxy=http://www.yourproxyserver.com:port
#프록시서버 해제
unset http_proxy
unset https_proxy
 

 

2. 로그인 세션이 종료된 후에도 프록시를 유지시키는 방법

 

 


 
여기서는 .bashrc에 작업했지만 .profile, .bash_profile, .bashrc_profile 어디에 설정해도 동일합니다.
vi ~/.bashrc
 
아래내용 추가
export http_proxy=http://www.yourproxyserver.com:port
export https_proxy=http://www.yourproxyserver.com:port
저장후
 
source ~/.bashrc
 


이후 wget이나 curl로 외부로 요청이 되었을때 데이터를 제대로 가져오면 프록시 설정이 제대로 된것입니다.

 

 
wget www.daum.net
혹은
curl -0 www.daum.net
 

profile

일요일은 짜빠게뤼~ 먹는날~^^

엮인글 :
http://adminplay.com/327922/6c3/trackback
List of Articles
번호 제목 글쓴이 날짜 조회 수

Copyright ADMINPLAY corp. All rights reserved.

abcXYZ, 세종대왕,1234

abcXYZ, 세종대왕,1234