0

The reason I put server cluster in parentheses is because I'm not sure if my set up counts as a server cluster. I have an ubuntu LAMP server running a wordpress website that works great. the domain name is set up and I have had no problems with it. I set up an owncloud server on a raspberry pi that I just purchased which works on my local network only. How do I port forward both servers to be able to be reached on an outside network if my wordpress server is already listening on port 80?

3
  • You correctly identified, that no more than one service can listen to one port on one computer. But there are tons of ways to work around it. Please clarify you question: What's your goal? Do both services have to be reachable unter the same www.yourdomain.de ? Or do you just want to reach the Owncloud from the internet at all?
    – alfonx
    Jan 21, 2015 at 20:10
  • 1
    I would like to be able to go to mydomain.com and reach my website and when I go to mydomain.com/owncloud go to my owncloud server. Jan 21, 2015 at 20:12
  • Maybe you question would be better phrased something like this: "How to setup another server to be reached at a path on my existing webserver." Longer but more precise ;-)
    – alfonx
    Jan 21, 2015 at 20:32

1 Answer 1

1

The difficulty here is that your rasberry pi doesn't have a fix IP and is by default not reachable from the outside because your router is a firewall. The following would still work:

  1. Setup your owncloud-Linux to create an ssh reverse tunnel to your outside box on every boot (using key authentification). A ssh reverse tunnel allows that talking to localhost:8123 on the wordpress manshine would reach localhost:80 on the owncloud mashine. For more info search "ssh reverse tunneling", or try this. The ssh configuration ~/.ssh/config file on the resberry pi would contain lines like these:

host wordpress

hostname 123.345.678.987 # IP of the wordpress

RemoteForward 8123 localhost:80

  1. Configure apache on the Wordpress mashine to proxy all requests on "/owncloud" to localhost:8123 . After enabling the Apache2 module, the configuration would look something like:

ProxyPass /owncloud http://localhost:8123/owncloud

ProxyPassReverse /owncloud http://localhost:8123/owncloud

The keyword to search for here is the Apache2 Module HTTP-Proxy

The result would be www.yourdomain.com reaches your wordpress etc.. Only http://www.yourdomain.com/owncloud reaches you raspberry pi.

BTW: Do not use the URL "/owncloud", but rather something that is not standard like "/mycloudy" to avoid standard attacks.

3
  • Thank you so much for answering my question in record time. I will look into that. Jan 21, 2015 at 20:20
  • Follow up question, there is no config file under ~/.ssh/config Do I make one or is there another one? Jan 22, 2015 at 3:00
  • You can just create the file. But search for it's documentation first and/or use "man ssh". BTW: AS soon as you have enough points I really appreciate it you "up" my answer. ;-)
    – alfonx
    Jan 22, 2015 at 8:13

You must log in to answer this question.

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