logo
Apache Lounge
Webmasters

 


About

Forum Index Downloads Search Register Log in  RSS Apache Lounge
 


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Apache Lounge is not sponsored.

Your donations will help to keep this site alive and well, and continuing building binaries.



Two nextcloud servers one network

 
Post new topic   Reply to topic    Apache Forum Index -> Apache



View previous topic :: View next topic  
Author Message
CountOmega



Joined: 06 Jun 2019
Posts: 5
Location: Bavaria

PostPosted: Mon 10 Jun '19 12:48    Post subject: Two nextcloud servers one network Reply with quote

Hi folks,
Ive encountered a problem when trying to set up my own nextcloud (16.0.1) with apache 2.4.29 . In the same network is already another owncloud server listening on port 80/443. Ive heard something about
Code:
ReverseProxy
to be applied to the vhost. Is this the solution Im looking for?

Thanks in advance

Count Omega
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 6604
Location: Germany, Next to Hamburg

PostPosted: Tue 11 Jun '19 13:24    Post subject: Reply with quote

Hi Count Omega,
do you want to reach each instance via a different domain name? Or different subdomain? If yes, then a reverse proxy will do it.

example
Code:

<VirtualHost *:80>
    ServerName cloud1.example.com
    DocumentRoot "/mario/Apache24/htdocs"
    <Directory "/mario/Apache24/htdocs">
        Options Indexes Includes FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>
    <Location />
        ProxyPass https://192.168.1.1/
        ProxyPassReverse https://192.168.1.1/
    </Location>
</virtualhost>
Back to top
CountOmega



Joined: 06 Jun 2019
Posts: 5
Location: Bavaria

PostPosted: Tue 11 Jun '19 15:22    Post subject: Reply with quote

Hello James Blond,
thanks for the quick response. I want just the two instances running parallel. So can I use in the vhost file a
Code:
VirtualHost*.3000
or something like that?
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 6604
Location: Germany, Next to Hamburg

PostPosted: Wed 12 Jun '19 8:52    Post subject: Reply with quote

Ah, okay, then you don't need a reverse proxy. You just can have two v(irtual)hosts.
On each you can run one instance of your nextcloud. Sure you need to double that since you need different vhosts for port 80 and 443.

Here is an example config https://www.hastebin.com/ilicekowac.apache
Back to top
CountOmega



Joined: 06 Jun 2019
Posts: 5
Location: Bavaria

PostPosted: Wed 12 Jun '19 10:57    Post subject: Reply with quote

Sorry if I haven't specified this earlier. There are two servers running on two separate linux machines. So can I tell the vhost to listen e.g. on port 8080?
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 6604
Location: Germany, Next to Hamburg

PostPosted: Wed 12 Jun '19 16:21    Post subject: Reply with quote

If it is

Code:

apache_main----->nextcloud1:8080
           |
           ----->nextclou2:8080


then

Code:

<VirtualHost *:80>
    ServerName cloud1.example.com
    DocumentRoot "/mario/Apache24/htdocs"
    <Directory "/mario/Apache24/htdocs">
        Options Indexes Includes FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>
    <Location />
        ProxyPass http://ip2nextcloud1:8080/
        ProxyPassReverse http://ip2nextcloud1:8080/
    </Location>
</virtualhost>

<VirtualHost *:80>
    ServerName cloud2.example.com
    DocumentRoot "/mario/Apache24/htdocs"
    <Directory "/mario/Apache24/htdocs">
        Options Indexes Includes FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>
    <Location />
        ProxyPass http://ip2nextcloud2:8080/
        ProxyPassReverse http://ip2nextcloud2:8080/
    </Location>
</virtualhost>
Back to top
CountOmega



Joined: 06 Jun 2019
Posts: 5
Location: Bavaria

PostPosted: Wed 12 Jun '19 18:53    Post subject: Reply with quote

So my vhost looks like
Code:
<VirtualHost *:880>
       
        ServerName countomega.ddnss.de

        ServerAdmin Matthias@countomega.ddnss.de
        DocumentRoot /var/www/html/nextcloud
        RewriteEngine on
        #RewriteCond %{SERVER_NAME} =countomega.ddnss.de
        #RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]


        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

       
</VirtualHost>


In ports conf Ive enabled 880 and 8443 and set defaul_ssl conf port to 8443; tho ports are also forwarded on the router. Still I cant acess my site. Entering my site gets me the default page.
Back to top
CountOmega



Joined: 06 Jun 2019
Posts: 5
Location: Bavaria

PostPosted: Thu 13 Jun '19 18:15    Post subject: Reply with quote

So problem solved, applied different ports and worked.
Back to top


Post new topic   Reply to topic    Apache Forum Index -> Apache
Page 1 of 1