<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://dikapediav2.com/wiki/index.php?action=history&amp;feed=atom&amp;title=Proxy</id>
	<title>Proxy - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://dikapediav2.com/wiki/index.php?action=history&amp;feed=atom&amp;title=Proxy"/>
	<link rel="alternate" type="text/html" href="https://dikapediav2.com/wiki/index.php?title=Proxy&amp;action=history"/>
	<updated>2026-05-15T09:11:16Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://dikapediav2.com/wiki/index.php?title=Proxy&amp;diff=155&amp;oldid=prev</id>
		<title>Ardika Sulistija: Created page with &quot; What is Proxy Server?  A proxy server is a dedicated computer or a software system running on a computer that acts as an intermediary between an endpoint device, such as a computer, and another server from which a user or client is requesting a service. The proxy server may exist in the same machine as a firewall server or it may be on a separate server, which forwards requests through the firewall.   ====How to configure proxy environment variable in Linux using http_p...&quot;</title>
		<link rel="alternate" type="text/html" href="https://dikapediav2.com/wiki/index.php?title=Proxy&amp;diff=155&amp;oldid=prev"/>
		<updated>2024-09-11T14:22:17Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot; What is Proxy Server?  A proxy server is a dedicated computer or a software system running on a computer that acts as an intermediary between an endpoint device, such as a computer, and another server from which a user or client is requesting a service. The proxy server may exist in the same machine as a firewall server or it may be on a separate server, which forwards requests through the firewall.   ====How to configure proxy environment variable in Linux using http_p...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;
What is Proxy Server?&lt;br /&gt;
&lt;br /&gt;
A proxy server is a dedicated computer or a software system running on a computer that acts as an intermediary between an endpoint device, such as a computer, and another server from which a user or client is requesting a service. The proxy server may exist in the same machine as a firewall server or it may be on a separate server, which forwards requests through the firewall.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====How to configure proxy environment variable in Linux using http_proxy &amp;amp; https_proxy====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
To use a proxy, the following environment variables need to be configured on the Source machines:&lt;br /&gt;
For https_proxy – use - https://server-ip:port/&lt;br /&gt;
&lt;br /&gt;
Check current proxy configuration status (https_proxy/https_proxy)/ This variable will show if there is a proxy server configured on the system:&lt;br /&gt;
 # echo $http_proxy&lt;br /&gt;
 # echo $https_proxy&lt;br /&gt;
&lt;br /&gt;
Set up proxy without username and password&lt;br /&gt;
 # export http_proxy=http://SERVER:PORT/&lt;br /&gt;
 # export https_proxy=https://SERVER:PORT/&lt;br /&gt;
 # export no_proxy=localhost,127.0.0.1,169.254.169.254,.amazonaws.com&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Set up proxy with username and password&lt;br /&gt;
 # export http_proxy=http://USERNAME:PASSWORD@SERVER:PORT/&lt;br /&gt;
&lt;br /&gt;
Set up proxy permanently using /etc/environment. &amp;lt;b&amp;gt;Persistent&amp;lt;/b&amp;gt; across all reboots and users:&lt;br /&gt;
 # echo &amp;quot;https_proxy=https://proxy.example.com:3111/&amp;quot; &amp;gt;&amp;gt; /etc/environment&lt;br /&gt;
 # echo &amp;quot;http_proxy=http://proxy.example.com:3222/&amp;quot; &amp;gt;&amp;gt; /etc/environment&lt;br /&gt;
&lt;br /&gt;
References&lt;br /&gt;
https://www.golinuxcloud.com/set-up-proxy-http-proxy-environment-variable/&amp;lt;/br&amp;gt;&lt;br /&gt;
https://www.thegeekdiary.com/how-to-configure-proxy-server-in-centos-rhel-fedora/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====[[Environment Variables|About /etc/environment and /etc/profile]]====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Basically /etc/profile and  works little bit differently, please check out below documents. /etc/environment is not a shell script unlike /etc/profile, it applies to all processes without shell.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Note that unlike a shell script in /etc/profile.d described in the next section, the /etc/environment file is NOT a shell script and applies to all processes without a shell.&amp;lt;/b&amp;gt; &lt;br /&gt;
* In other words, you need &amp;quot;export&amp;quot; in /etc/profile, but &amp;lt;b&amp;gt;NOT&amp;lt;/b&amp;gt; in /etc/environment.&lt;br /&gt;
&lt;br /&gt;
https://www.serverlab.ca/tutorials/linux/administration-linux/how-to-configure-proxy-on-ubuntu-18-04/&amp;lt;/br&amp;gt;&lt;br /&gt;
https://www.golinuxcloud.com/set-up-proxy-http-proxy-environment-variable/&amp;lt;/br&amp;gt;&lt;br /&gt;
https://www.thegeekdiary.com/how-to-configure-proxy-server-in-centos-rhel-fedora/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====How to Set Up a Squid Proxy====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Spin up another EC2 in public subnet to act as the Squid Proxy (bastion) and another EC2 in a Private Subnet (Upgrade tool). You know the routine - configure ssh keys, set hostnames, etc. NO NAT GATEWAY. &lt;br /&gt;
&lt;br /&gt;
    Squid proxy set up: &lt;br /&gt;
&lt;br /&gt;
    A) Run: &lt;br /&gt;
        $ sudo yum -y install squid&lt;br /&gt;
        $ sudo systemctl enable squid; sudo systemctl start squid; sudo systemctl status squid&lt;br /&gt;
&lt;br /&gt;
    B) Add inbound port 3128 to the instance security group of the Squid Proxy (Bastion) instance. &lt;br /&gt;
&lt;br /&gt;
    C) SSH to the private instance (via the bastion instance), and configure the proxy environment variable using the private IP of the Squid/Bastion instance: &lt;br /&gt;
&lt;br /&gt;
        $ export http_proxy=http://172.31.44.117:3128/; export https_proxy=http://172.31.44.117:3128/; export no_proxy=localhost,127.0.0.1,169.254.169.254,.amazon.com&lt;br /&gt;
&lt;br /&gt;
        $ env | grep _proxy&lt;br /&gt;
        http_proxy=http://172.31.44.117:3128/&lt;br /&gt;
        https_proxy=http://172.31.44.117:3128/&lt;br /&gt;
        no_proxy=localhost,127.0.0.1,169.254.169.254&lt;br /&gt;
&lt;br /&gt;
D) Confirm that the connection to cloudendure.com or amazonaws.com goes through proxy:&lt;br /&gt;
        $ curl -IvkL cloudendure.com&lt;br /&gt;
        * Uses proxy env variable http_proxy == &amp;#039;http://172.31.44.117:3128/&amp;#039;&lt;br /&gt;
        *   Trying 172.31.44.117:3128...&lt;br /&gt;
        * Connected to 172.31.44.117 (172.31.44.117) port 3128 (#0)&lt;br /&gt;
        &amp;gt; HEAD http://cloudendure.com/ HTTP/1.1&lt;br /&gt;
        &amp;gt; Host: cloudendure.com&lt;br /&gt;
        &amp;gt; User-Agent: curl/7.88.1&lt;br /&gt;
        &amp;gt; Accept: */*&lt;br /&gt;
        &amp;gt; Proxy-Connection: Keep-Alive&lt;br /&gt;
        &amp;gt; &lt;br /&gt;
        &amp;lt; HTTP/1.1 301 Moved Permanently&lt;br /&gt;
        HTTP/1.1 301 Moved Permanently&lt;br /&gt;
        &amp;lt; Content-Length: 0&lt;br /&gt;
        Content-Length: 0&lt;br /&gt;
        &amp;lt; Server: CloudFront&lt;br /&gt;
        Server: CloudFront&lt;br /&gt;
        &amp;lt; Date: Fri, 26 May 2023 14:57:41 GMT&lt;br /&gt;
        Date: Fri, 26 May 2023 14:57:41 GMT&lt;br /&gt;
        &amp;lt; Location: https://www.cloudendure.com/&lt;br /&gt;
        Location: https://www.cloudendure.com/&lt;br /&gt;
        &amp;lt; X-Cache: LambdaGeneratedResponse from cloudfront&lt;br /&gt;
        X-Cache: LambdaGeneratedResponse from cloudfront&lt;br /&gt;
        &amp;lt; X-Amz-Cf-Pop: SYD1-C1&lt;br /&gt;
        X-Amz-Cf-Pop: SYD1-C1&lt;br /&gt;
        &amp;lt; X-Amz-Cf-Id: jOZDvUDxVB0Ma0JwPVNAEItc6Egz9-lRvky8RidEdyul0kPINBcoYQ==&lt;br /&gt;
        X-Amz-Cf-Id: jOZDvUDxVB0Ma0JwPVNAEItc6Egz9-lRvky8RidEdyul0kPINBcoYQ==&lt;br /&gt;
        &amp;lt; X-Cache: MISS from squidproxybastion&lt;br /&gt;
        X-Cache: MISS from squidproxybastion&lt;br /&gt;
        &amp;lt; X-Cache-Lookup: MISS from squidproxybastion:3128&lt;br /&gt;
        X-Cache-Lookup: MISS from squidproxybastion:3128&lt;br /&gt;
        &amp;lt; Via: 1.1 0b26d7ef0f265884570bdb3e6c3750b0.cloudfront.net (CloudFront), 1.1 squidproxybastion (squid/3.5.20)&lt;br /&gt;
        Via: 1.1 0b26d7ef0f265884570bdb3e6c3750b0.cloudfront.net (CloudFront), 1.1 squidproxybastion (squid/3.5.20)&lt;br /&gt;
        &amp;lt; Connection: keep-alive&lt;br /&gt;
        Connection: keep-alive&lt;br /&gt;
&lt;br /&gt;
        &amp;lt; &lt;br /&gt;
        * Connection #0 to host 172.31.44.117 left intact&lt;br /&gt;
        * Clear auth, redirects to port from 80 to 443&lt;br /&gt;
        * Issue another request to this URL: &amp;#039;https://www.cloudendure.com/&amp;#039;&lt;br /&gt;
        * Uses proxy env variable https_proxy == &amp;#039;https://172.31.44.117:3128/&amp;#039;&lt;br /&gt;
        * Hostname 172.31.44.117 was found in DNS cache&lt;br /&gt;
        *   Trying 172.31.44.117:3128...&lt;br /&gt;
        * Connected to 172.31.44.117 (172.31.44.117) port 3128 (#1)&lt;br /&gt;
        * ALPN: offers http/1.1&lt;br /&gt;
        * Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH&lt;br /&gt;
        * TLSv1.2 (OUT), TLS handshake, Client hello (1):&lt;br /&gt;
        *  CAfile: /etc/pki/tls/certs/ca-bundle.crt&lt;br /&gt;
        *  CApath: none&lt;br /&gt;
        * OpenSSL/1.0.2k-fips: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol&lt;br /&gt;
        * Closing connection 1&lt;br /&gt;
        curl: (35) OpenSSL/1.0.2k-fips: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol&lt;br /&gt;
&lt;br /&gt;
        # Each time you run the above curl command, you will see in `netstat -tulpna` as well: &lt;br /&gt;
        $ sudo netstat -tulpna | grep 3128&lt;br /&gt;
        tcp        0      0 172.31.28.98:49564      172.31.44.117:3128      TIME_WAIT   -                   &lt;br /&gt;
        tcp        0      0 172.31.28.98:49550      172.31.44.117:3128      TIME_WAIT   -                   &lt;br /&gt;
        tcp        0      0 172.31.28.98:52262      172.31.44.117:3128      TIME_WAIT   -                   &lt;br /&gt;
        tcp        0      0 172.31.28.98:57204      172.31.44.117:3128      TIME_WAIT   -  &lt;br /&gt;
&lt;br /&gt;
        ( TIME_WAIT indicates that local endpoint (this side) has closed the connection. Which makes sense because the `curl` command closes after it connects.)&lt;br /&gt;
&lt;br /&gt;
        # You can also confirm by running `wget` to the console.cloudendure.com on the private instance:&lt;br /&gt;
        $ wget console.cloudendure.com&lt;br /&gt;
        --2023-05-26 15:09:19--  http://console.cloudendure.com/&lt;br /&gt;
        Connecting to 172.31.44.117:3128... connected.&lt;br /&gt;
        Proxy request sent, awaiting response... 301 Moved Permanently&lt;br /&gt;
        Location: https://console.cloudendure.com/ [following]&lt;br /&gt;
        --2023-05-26 15:09:20--  https://console.cloudendure.com/&lt;br /&gt;
        Connecting to 172.31.44.117:3128... connected.&lt;br /&gt;
        Proxy request sent, awaiting response... 200 OK&lt;br /&gt;
&lt;br /&gt;
E) For DRS Agent installation do:&lt;br /&gt;
 $ chmod +x aws-replication-installer-init; sudo ./aws-replication-installer-init --proxy-address http://172.31.44.117:3128/&lt;br /&gt;
&lt;br /&gt;
=====How to Configure Yum to use Proxy====&lt;br /&gt;
Simply edit the &amp;lt;b&amp;gt;/etc/yum.conf&amp;lt;/b&amp;gt; file and add the line &amp;lt;b&amp;gt;proxy=http://[YOUR_PROXY_HOST]:[YOUR_PROXY_PORT]/&amp;lt;/b&amp;gt;&lt;br /&gt;
 $ sudo vi /etc/yum.conf&lt;br /&gt;
 .&lt;br /&gt;
 .&lt;br /&gt;
 .&lt;br /&gt;
 proxy=http://172.31.16.26:3128/&lt;/div&gt;</summary>
		<author><name>Ardika Sulistija</name></author>
	</entry>
</feed>