0

The situation I'm running a web server (CentOS on VMware, multiple virtualhosts) on a development machine and I'd like to give access to clients to view some sites without me having to upload them to an external hosting account.

The problem I don't have access to the router, and so can't set up port forwarding. I do however, have a hosting account (with ssh access) and even a VPS.

The question Is there something I could set up on my external hosting account or VPS that would handle web page requests by somehow pulling the data from my local server (behind the router) and serving it to the end user? I understand it's a bit convoluted, but performance doesn't really matter.

Thank you!!!

1
  • 1
    Why not speak to the party that manages the router and ask them to set up the port forwarding for you?
    – joeqwerty
    Sep 27, 2013 at 23:36

3 Answers 3

0

There are already good ideas, but here is the solution to make your VMWare accessible as if it was on your vps:

  1. Install openvpn server on your vps. There are many tutorials. I suggest choosing the bridged mode ( with the tap interface ). Choose an ip range like 10.1.2.1-254 ( 10.1.2.0/24 ). Once you have generated your ca etc, generate a client key called "vmware", without a passphrase, and in the /etcopenvpn/cdd directory put a file called "vmware" with this content:

    --ifconfig-push 10.1.2.3 255.255.255.0

the important lines in your server.conf (ie: which you have to change from the default config)

dev tap0
server-bridge 10.1.2.1 255.255.255.0 10.1.2.100 10.1.2.110
client-config-dir /etc/openvpn/ccd

Make sure udp port 1194 is open for public access ( or at least from the public ip of your vmware machine ).

  • On your vmware install also openvpn, but in /etc/openvpn/ directory you put:
  • your private key + certificate + ca certificate
  • a file named "vps.conf" with the client configuration

important lines:

remote <public ip address your vps> 1194
ca, cert, key

If you enable the openvpn service ( checkconfig openvpn on ) the client will start automatically at boot, establishing a tunnel between your vpn and your vps.

  1. Now in the apache configuration of your vps create a vhost ( not the default one preferably ) with something like:

ServerName MyVmware.vm.ware.com

RewriteEngine On RewriteRule (.*) http://10.1.2.3/$1 [P,L]

Here you are..

By the way, you just made you developpment server available publicly. I suggest restricting the access at least in the apache configuration..

0

if you are on an internal network, and dont have admin on perimeter devices, you cannot have incoming connections from the internet hit a host inside your private lan. however, there are a few options

1) your box inside private network can connect to your cloud server/vps (but not vice-versa), so have a cron that populates the document root for apache/nginx. you can use pki and rsync every hour for instance.

2) set up openvpn on the internal box, and initiate a tunnel from there to your clients sites (not recommended... this is a backdoor into your company)

3) make friends with your firewall admins, and have them port forward for you (although you will most likely have to upload to a webserver in a DMZ, so may as well do #1 and upload to cloud)

0

You can do something like this on your development computer:

ssh vps-hostname -R 8080:localhost:80

This would create an encrypted tunnel from port 8080 on a vps to port 80 on local computer.

I think you'd need to also configure ssh to use keep-alive packets (for example with ClientAliveInterval option on sshd_config on a VPS), as a connection idle for too long would be interrupted by your router.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .