How-to setup a proxy in the cloud…
Transcription
How-to setup a proxy in the cloud…
How-to setup a proxy in the cloud… This article describes the setup of a proxy-server in a cloud. You can use a proxy like this from everywhere through the internet. Reasons to do this could be: Your internet access is filtered but you need access to sites which are filtered. You want to have a log of all sites and files you’ve visited from different browsers. You need to speed up your internet connection through caching. You want to filter the internet access of your kids. prerequisites: virtual machine with public ip in a cloud (e.g. Amazon EC2) contents: 1. Setup a virtual machine in Amazon‘s cloud 2. Connect to the virtual machine in the cloud 3. Install FreeProxy 4. Open tcp-ports in the cloud 5. Change your browsers proxy-settings 6. Install Techlogica http-Server and change log-settings (optional) 7. Change DNS-Servers in the virtual machine (optional) 8. Change your proxy-authentication (highly recommended) 1. Setup a virtual machine in Amazon‘s cloud a. Go to http://aws.amazon.com/ec2/ and Sign Up for Amazon EC2 b. Go to https://console.aws.amazon.com/ec2/home which is called AWS Management Console c. Launch a new instance by clicking on „Launch Instances“ -1- 1 6 9 15 17 20 25 27 How-to setup a proxy in the cloud… d. Choose „Basic Microsoft Windows Server 2003 (32 bit)“ e. Click on Key Pair Name „Create“ to create a Key Pair (you will need to generate Admin-Login) -2- How-to setup a proxy in the cloud… f. Give it a name and click on „Create and Download your Key Pair“ g. Save the pem-File to your important documents and click „Continue“ -3- How-to setup a proxy in the cloud… h. Choose 1 as a number of instances, your new Key Pair and click „Launch“ i. Click on „View your instances on the Instance page“ for viewing your new VM -4- How-to setup a proxy in the cloud… j. Check your new VM and click on „More Actions“ >> „Get Windows Password“ k. Follow the instructions and paste the content of your pem-file (open it with an editor) into the text-field and click „Decrypt Password“ l. Note your password and click „Close“ -5- How-to setup a proxy in the cloud… 2. Connect to the virtual machine in the cloud a. Check your VM in the AWS Management Console and click „Connect“ b. Click on „Download shortcut file“ and open it (your RDP-Session should start immediately) -6- How-to setup a proxy in the cloud… c. Enter your Administrator-Password from Step 1l d. Now you should change the Administrator-Password to something you can remember ;-) Right-Click the MyComputer-Symbol in the Start-Menu and choose „Manage“ -7- How-to setup a proxy in the cloud… e. Go to „Local Users and Groups“, Right-Click the Administrator and choose „Set Password f. Click „Proceed“ -8- How-to setup a proxy in the cloud… g. Enter the new password twice 3. Install FreeProxy a. Connect to your virtual machine through a RDP-Session (see point 2) b. Download FreeProxy from http://www.handcraftedsoftware.org/index.php?page=4&action=file&file_id=5 c. Open the zip-file and launch setup.exe d. Click „Next“ on the Welcome-Screen -9- How-to setup a proxy in the cloud… e. Accept the license agreement and click „Next“ f. Click „Next“ for Default Location - 10 - How-to setup a proxy in the cloud… g. Click „Yes“ h. Click „Next“ - 11 - How-to setup a proxy in the cloud… i. Click „Install“ j. Click „Next“ - 12 - How-to setup a proxy in the cloud… k. Click „Finish“ l. Launch the „FreeProxy Control Center“ - 13 - How-to setup a proxy in the cloud… m. Click on „Start/Stop“ n. Click on „Start“ in Service-Mode Your proxy is running now – Go on to the next step… - 14 - How-to setup a proxy in the cloud… 4. Open tcp-Ports in the cloud a. Go to the AWS Management Console and go to „security groups“ b. Click on „Create Security Group“ - 15 - How-to setup a proxy in the cloud… c. Give it a name and description d. Check your new Security Group and choose the following values: i. Connection Method = Custom… ii. Protocol = tcp iii. From Port = 8080 iv. To Port = 8080 v. Source (IP or group) = 0.0.0.0/0 e. Click „Save“ under Actions - 16 - How-to setup a proxy in the cloud… 5. Change your browsers proxy-settings a. Go to the AWS Management Center and click on Instances to see your VM b. Check your VM and copy the „Public DNS“ value - 17 - How-to setup a proxy in the cloud… c. Go to your browsers proxy-settings (e.g. Firefox) d. Click on Network >> Connection >> settings - 18 - How-to setup a proxy in the cloud… e. Click on „Manual proxy configuration“ and fill the „Public DNS“ of your VM in the „http Proxy“ field Set the Port to 8080 and click „OK“ Your Browser is now set to use your new proxy in the cloud - 19 - How-to setup a proxy in the cloud… 6. Install Techlogica http-Server and change log-settings (optional) If you want to check the sites and files which were opened through your proxy, you have to change the log-settings oft he FreeProxy program and install a little http-server to make the logs easily accessible. Advanced users may use the http-service of Freeproxy (which is not described here) instead of the Techlogica http-Server. a. Connect to your VM using a RDP-Session (see point 2) b. Open the „FreeProxy Control Center“ and click on „Options“ c. Set the options as they are set in the following screenshot For further details about the „Format string“ press F1 ;-) - 20 - How-to setup a proxy in the cloud… d. Download the Techlogica http-Server: http://www.techlogica.us/software/httpserver/download.php e. Launch the setup.exe and click „I Agree“ f. Click „Install“ g. Click „Yes“ - 21 - How-to setup a proxy in the cloud… h. Click „Next“ i. Click „Finish“ - 22 - How-to setup a proxy in the cloud… j. Click on „Local Server“ and change it to „Internet Server“ and click „Apply“ k. Click on „Browse“ and navigate to the Folder where your logs are saved (in our example it is D:\proxylogs) and click „OK“ + „Apply“ - 23 - How-to setup a proxy in the cloud… l. Now you have to open port 80 in the cloud – Go to the AWS Management Console m. Click on „Security Groups“ and check the security group you created in step 4c n. Choose the following values: i. Connection Method = HTTP o. Click „Save“ under Actions Now you can access the connection-log through http://<Public-DNS-of-your-VM>/connections.log :) - 24 - How-to setup a proxy in the cloud… 7. Change DNS-Servers in the virtual machine (optional) Due to government filtering you may want to change the used DNS-Servers of your proxyserver. Therefor you might want to use the following DNS-Servers: Europe: United States: 213.73.91.35 (dnscache.berlin.ccc.de) 80.237.196.2 (n80-237-196-2.cnet.hosteurope.de) 208.67.222.222 (resolver1.opendns.com) 208.67.220.220 (resolver2.opendns.com) To change DNS-Servers to use in the VM do the following: a. Connect to your VM using a RDP-Session (see point 2.) b. Open the properties of the Network Connections - 25 - How-to setup a proxy in the cloud… c. Mark „Internet Protocol“ and click Properties d. Choose „Use the following DNS Server addresses“ and fill in the DNS-Servers from the beginning of point 7. e. Click „OK“ Now your Proxy-Server uses the new DNS-Server - 26 - How-to setup a proxy in the cloud… 8. Change your proxy-authentication (highly recommended) You may not want the bad guys to use your proxy-server for doing bad things – Therefor you should activate authentication in your proxy-service: a. Connect to your VM using a RDP-Session (see point 2.) b. Open the „FreeProxy Control Center“ c. Click on „Users“ d. Click on „Groups“ and click the button „Add“ - 27 - How-to setup a proxy in the cloud… e. Give it a name and description and click „done“ f. Click on „Users“ and click the button „Add“ g. Give it a name, description and password - 28 - How-to setup a proxy in the cloud… h. Click on your new group and click „Add“ i. Choose your new user and click „Done“ - 29 - How-to setup a proxy in the cloud… j. Click „Done“ k. Double-Click the „Port“ - 30 - How-to setup a proxy in the cloud… l. Check „Use http Authentication“, fill something in the „Realm“ and click on „Permissions“ m. Click „Add Ressource“ - 31 - How-to setup a proxy in the cloud… n. Change the settings like they are set on the following screenshot and click „Done“ o. Click „Done“ and go back to the „FreeProxy Control Center“ p. Click on „Start/Stop“ - 32 - How-to setup a proxy in the cloud… q. Restart the Service Now your proxy-servers wants everybody to authenticate – Test it! - 33 -