Setting up Cyn.in to use a proxy server for Internet
Cyn.in will automatically use the proxy server that is setup on the server Linux environment. In Linux, the existence of a proxy server is determined by the presence of two environment variables:
These environment variables can be setup in various places depending on whether we want the proxy settings to apply system-wide or only for a particular user. Since we want to always have the proxy settings to be available, we recommend applying these two environment variables system-wide, but depending on your scenario you may choose to apply them only for your particular user login.
System-wide proxy settings
To apply proxy settings for the full linux system, the recommended place to apply the environment settings is in the /etc/profile file.
This file is loaded for all logins, interactive and non-interactive and this is where we will add the necessary environment variables.
- On the command line prompt of the Cyn.in ISO CD appliance, use the su command to get root command line access. (Your command line prompt will change from the $ sign to the # sign).
- nano /etc/profile
- Add the following 2 lines to the bottom of the file:
Replace the parts in the above 2 lines using the following legend:
- username: Replace this with the actual username you want to use the proxy server with.
- password: Replace this with your actual proxy server password
- proxyserverhostorip: Replace this with the hostname or IP address of your proxy server.
- port: Replace this with the port number of the proxy server. If your proxy server accepts http proxy connections at port 3128 then replace port with 3128. If you don't know what the port number is, or no number was supplied to you, then it is possible that the proxy server accepts connections at the default port, which means that you must supply 80 as the port for http or 443 as the port for https. Supplying a port number is required!
In case you don't have a proxy server for proxying HTTPS traffic, do not add the second line.
In case you don't have authenticated access, and proxy server access is available without a password, eliminate the entire username:password@ part. So your line will look something like this:
Once you have edited the /etc/profile file as above, you need to restart the system to bring the setting into effect.
You can do this while you're escalated to the # commandline with the reboot command, or follow whatever regular procedure you have for rebooting the server.Once the reboot has completed, you can test that the proxy server settings have "taken" by opening up a command line, and using the wget command, to get any URL of your choice. Example:
Proxy settings for a single user
Note that while this can cause inconsistencies with the way the Cyn.in init.d daemon or other system services "see" the environment variables, it is sometimes necessary to setup the proxy settings for only a particular user or to promote each linux user to have their own authenticated proxy server access. To be able to do this, instead of editing the system /etc/profile file, you can achieve the same effect for any user by editing the .profile file in their folder, or the .bashrc file as well. The same syntax and legend works, you just have to put the environment variable setting in the user's area instead of system-wide. You can refer to any of the following guides / posts to figure out how to set it up: