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.



Apache 2.4 ownCloud redirect query

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



View previous topic :: View next topic  
Author Message
pnewbery



Joined: 05 Apr 2019
Posts: 4
Location: U.K., Lowestoft

PostPosted: Fri 05 Apr '19 11:57    Post subject: Apache 2.4 ownCloud redirect query Reply with quote

Hi all,
I'm new here, so please be gentle with me!
I am running an ownCloud 10.x server on a Linux Mint PC with Apache 2.4. Due to a change in network infrastructure, access to the server has had to change. The server is in a DMZ on a router to which I have no administrative access. Port forwarding has been set up with 8080 going to port 80 and 40440 going to port 443. External access with the ownCloud client using port 40440 is working fine, but internally, it does not work. I have opened port 40440 on the server firewall and attempted to use a VirtualHost entry in the owncloud.conf in etc/apache2/sites-available, to forward port 40440 to https on 443 but cannot get it to work.
When an attempt is made to access the server using the external URL internally: https://harry.mydomain.org.uk:40440/owncloud, an error box is presented with the option to "use a different URL", "Retry Unencrypted using HTTP (Insecure)" [this works] or "Configure client-side TLS certificate". Cancelling out gives: "Failed to connect to ownCloud at https://blah.blah. SSL handshake failed"
Here's where I hope you guys will come in and save the day.
These are the entries in owncloud.conf:

<VirtualHost *:80>
Alias /owncloud "/var/www/owncloud/"
ServerName harry.mydomain.org.uk
DocumentRoot /var/www/owncloud
Redirect permanent / https:/harry.mydomain.org.uk
</VirtualHost>

listen *:40440
<VirtualHost *:40440>
Alias /owncloud "/var/www/owncloud/"
ServerName harry.mydomain.org.uk
DocumentRoot /var/www/owncloud
Redirect permanent / https://harry.mydomain.org.uk/
</VirtualHost>

<VirtualHost _default_:443>
Alias /owncloud "/var/www/owncloud/"
ServerName harry.mydomain.org.uk
DocumentRoot /var/www/owncloud

<IfModule mod_headers.c>
Header always set Strict-Transport-Security "max-age=15552000; includeSubDomains"
</IfModule>

<IfModule mod_dav.c>
Dav off
</IfModule>

SetEnv HOME /var/www/owncloud
SetEnv HTTP_HOME /var/www/owncloud

SSLEngine on
SSLCertificateFile /etc/apache2/ssl/owncloud.pem
SSLCertificateKeyFile /etc/apache2/ssl/owncloud.key
</VirtualHost>

I hope you can help
Paul Newbery
Back to top
James Blond
Moderator


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

PostPosted: Mon 08 Apr '19 20:34    Post subject: Reply with quote

Hi Paul,
remove the redirect on your 40440 port vhost and add the same SSL settings like on your 443 vhost.
Back to top
pnewbery



Joined: 05 Apr 2019
Posts: 4
Location: U.K., Lowestoft

PostPosted: Tue 09 Apr '19 18:35    Post subject: Re: Apache 2.4 ownCloud redirect query Reply with quote

Hi James, thanks for your reply.
I tried your suggestion of removing the 40440 redirect and copying the rest of the port 443 VirtualHost config (Including the modules and SSL bits) to the 40440 VirtualHost. Unfortunately, it doesn't work. I'm still getting the "Retry unencrypted etc." message box, so obviously when I come in on port 40440, it's not using ssl / https encryption, which is not what I'm after.
That's why I thought I needed the redirect to port 443.
Any other ideas?
Back to top
pnewbery



Joined: 05 Apr 2019
Posts: 4
Location: U.K., Lowestoft

PostPosted: Tue 09 Apr '19 19:08    Post subject: Re: Apache 2.4 ownCloud redirect query Reply with quote

After a little more research, I tried adding the https protocol to the port 40440 Listen statement thus:
Listen *:40440 https
That didn't work either. Crying or Very sad
Back to top
pnewbery



Joined: 05 Apr 2019
Posts: 4
Location: U.K., Lowestoft

PostPosted: Sun 14 Apr '19 12:21    Post subject: Re: Apache 2.4 ownCloud redirect query Reply with quote

Well, it seems I owe James an apology. When I first read James' post, it made such sense, that I knew it should work and it does. His suggestion works perfectly now that I have modified the correct config file!!
I read in another forum somewhere, that you should only modify a website's .conf file in the /sites-available directory and that's what I have been doing with no success. When I tried James' suggestions in the /sites-enabled .conf file, hey presto! It worked!
I must read up what the purpose of the 2 directories is.
Thanks again James.
Regards
Paul N
Back to top
James Blond
Moderator


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

PostPosted: Wed 17 Apr '19 13:44    Post subject: Re: Apache 2.4 ownCloud redirect query Reply with quote

pnewbery wrote:

I must read up what the purpose of the 2 directories is.


Well in the some of the linux distros you have to use the a2* tools that create a symlink from the *available* to the *enabled* directory. Developers thought / think that way you can have a config without deploying it.

Some of those tools are a2ensite, a2dissite, a2enmode ... etc.
Back to top


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