Author |
|
CountOmega
Joined: 06 Jun 2019 Posts: 5 Location: Bavaria
|
Posted: Mon 10 Jun '19 12:48 Post subject: Two nextcloud servers one network |
|
|
Hi folks,
I´ve 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. I´ve heard something about to be applied to the vhost. Is this the solution I´m looking for?
Thanks in advance
Count Omega |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7373 Location: Germany, Next to Hamburg
|
Posted: Tue 11 Jun '19 13:24 Post subject: |
|
|
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
|
Posted: Tue 11 Jun '19 15:22 Post subject: |
|
|
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 or something like that? |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7373 Location: Germany, Next to Hamburg
|
Posted: Wed 12 Jun '19 8:52 Post subject: |
|
|
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
|
Posted: Wed 12 Jun '19 10:57 Post subject: |
|
|
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: 7373 Location: Germany, Next to Hamburg
|
Posted: Wed 12 Jun '19 16:21 Post subject: |
|
|
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
|
Posted: Wed 12 Jun '19 18:53 Post subject: |
|
|
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 I´ve enabled 880 and 8443 and set defaul_ssl conf port to 8443; tho ports are also forwarded on the router. Still I can´t acess my site. Entering my site gets me the default page. |
|
Back to top |
|
CountOmega
Joined: 06 Jun 2019 Posts: 5 Location: Bavaria
|
Posted: Thu 13 Jun '19 18:15 Post subject: |
|
|
So problem solved, applied different ports and worked. |
|
Back to top |
|