خرید بک لینک

Hello friends. I'm trying to accomplish the goal of binding two boxes to one IP address. We all know this isn't possible, but it seems as if a reverse proxy is the ticket. I looked through a multitude of guides, but I'm finding a large portion of these guides to leave me with some questions. Most guides are for nginx, which doesn't help me much given I'm using apache. Most of what I see is a little vague in certain areas, and the guides in question often differ in their approach (which doesn't exactly clarify things).

To lay out a few details, I have two servers ruing at my house. One is for basic web stuff + ownCloud + IRC etc. The other is ruing ZoneMinder and NAS-related uses, which I'd like to access exteally to get into the web interface of ZM. Both servers are Ubuntu Server 14.04.

Let's refer to these details (mostly so I can stay sane):
ownCloud/main web server = "web server" = 192.168.1.22
ZoneMinder/NAS box = "ZM server" = 192.168.1.20
Lastly, let's say my domain is myhomedomain.org

The goal is to have myhomedomain.org hit the web server, but I want to have a different URL to access the ZM box, such as zm.myhomedomain.org or myhomedomain.org/zm. Either works.

Another potential snafu: I have apache auto redirecting all http traffic as https, so if you hit http://myhomedomain.org it auto pipes it to https://myhomedomain.org.

Using Digital Ocean's approach, I have all of the modules activated, but their implementation is where I get a little gray.

Code:

<VirtualHost *:*>
    ProxyPreserveHost On

    # Servers to proxy the coection, or;
    # List of application servers:
    # Usage:
    # ProxyPass / http://[IP Addr.]:[port]/
    # ProxyPassReverse / http://[IP Addr.]:[port]/
    # Example: 
    ProxyPass / http://0.0.0.0:8080/
    ProxyPassReverse / http://0.0.0.0:8080/

    ServerName localhost
</VirtualHost>
In the 0.0.0.0 examples, I assume I'm supposed to be pointing towards 192.168.1.20 (the IP of ZM), correct? In particular, the address is 192.168.1.20/zm, so I figured it would look like this (keeping in mind the guide says if you are using SSL, you are to make a secondary virtualhost, one for 80 one for 443).

Code:

<VirtualHost *:*>
    ProxyPreserveHost On

    # Servers to proxy the coection, or;
    # List of application servers:
    # Usage:
    # ProxyPass / http://192.168.1.20:80/zm/
    # ProxyPassReverse / http://192.168.1.20:80/zm/
    # Example:
    ProxyPass / http://192.168.1.20:80/zm/
    ProxyPassReverse / http://192.168.1.20:80/zm/

    ServerName localhost
</VirtualHost>
Listen 443

NameVirtualHost *:443
<VirtualHost *:443>

    SSLEngine On

    # Set the path to SSL certificate
    # Usage: SSLCertificateFile /path/to/cert.pem
    SSLCertificateFile /etc/apache2/ssl/myhomedomain_org.crt


    # Servers to proxy the coection, or;
    # List of application servers:
    # Usage:
    # ProxyPass / http://192.168.1.20:80/zm/
    # ProxyPassReverse / http://192.168.1.20:80/zm/
    # Example:
    ProxyPass / http://192.168.1.20:80/zm/
    ProxyPassReverse / http://192.168.1.20:80/zm/

    # Or, balance the load:
    # ProxyPass / balancer://balancer_cluster_name

</VirtualHost>
When restarting Apache after this change, two errors are listed:
AH00548: NameVirtualHost has no effect and will be removed in the next release /etc/apache2/sites-enabled/000-default.conf:17
(98)Address already in use: AH00072: make_sock: could not bind to address [::]:443

Overall I'm a little unsure. If anybody has any suggestions, insight, or any sort of setup guides that might help I'd *greatly* appreciate it!

برچسب: نویسنده: استخدام کار تاريخ: جمعه 13 فروردين 1395 ساعت: 12:02

صفحه بندی