LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 12-02-2022, 11:42 PM   #1
ozstar
Member
 
Registered: Oct 2003
Location: Sydney OZ
Distribution: Ubuntu 20.04LTS, Zorin 16.2 Pro
Posts: 143

Rep: Reputation: 15
Setting up HTTPS problem - Apache Ubuntu 20.04


HTTPS set up problem 20.04

Hi,

I have just set up a SSL Certificate and it was successfully installed.

On testing at the ssllab.com site, I got this message Assessment failed: Unable to connect to the server

I have set it so it redirects http to https and as checked that I have allowed 80 and 443 through ufw.

When I use the address say, mysite.com or http://mysite.com or https://mysite they all resolve at my router.
They don't go through it to the site via 443 or 80.

It worked fine before I told it to redirect to the https:// address so.

Any ideas please to get it working.

EDIT: I just checked port forward on the router and 80 is okay but 443 wasn't.

I tried to use it but got message can't use it as..

Port is used by router for HTTPS

How do I get around this. It is a Netcomm NF18 MESH.

EDIT: Did a sudo netstat -ntupl | grep :443 and got the following but not sure what it means.
Quote:
tcp6 0 0 :::443 :::* LISTEN 615/apache2
Should my virtual host .conf file have 443 in it as well as *80 ?
 
Old 12-03-2022, 02:34 PM   #2
rnturn
Senior Member
 
Registered: Jan 2003
Location: Illinois (SW Chicago 'burbs)
Distribution: openSUSE, Raspbian, Slackware. Previous: MacOS, Red Hat, Coherent, Consensys SVR4.2, Tru64, Solaris
Posts: 2,800

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
Quote:
Originally Posted by ozstar View Post
EDIT: I just checked port forward on the router and 80 is okay but 443 wasn't.
Perhaps you need to configure port 443 on your router? I'm not familiar with that router; hopefully another reader is.

Ensure that your ISP is not doing any blocking of the ports you'll need. From personal experience, a non-business account that include a static IP address is no guarantee that the ISP isn't blocking ports. (Just what one would do with a static IP with port blocking is a little beyond me (garden-variety web servers only, maybe?) but I found out the hard way at least one major ISP offers such a configuration.)

Quote:
EDIT: Did a sudo netstat -ntupl | grep :443 and got the following but not sure what it means.
Hmm... looks like only IPv6 packets for port 443 are being listened for. This looks like an Apache configuration file problem.

Quote:
Should my virtual host .conf file have 443 in it as well as *80 ?
How is SSL being handling inside your network? On my setup, I have anything headed to port 443 directly to a (Nginx) proxy server which has an "upstream" block defined to forward HTTP traffic to a proxy_pass definition for the web server listening on 8080. As such, I do not have Apache set up up to be listening on 443. Much will depend on your LAN configuration (firewall, proxy server (if any), web server, etc.)

Since you're using Apache for your web server, there is good information in the its manual. (Probably at "localhost/manual/ssl/" if you enabled the "/manual" location in the Apache configuration but definitely at "http://httpd.apache.org/docs/2.4/" if you didn't.) I'd start doing some leisure reading there.

HTH...

Last edited by rnturn; 12-03-2022 at 02:47 PM. Reason: Added comment about the IPv6 listener on port 443.
 
Old 12-03-2022, 06:32 PM   #3
elgrandeperro
Member
 
Registered: Apr 2021
Posts: 415
Blog Entries: 2

Rep: Reputation: Disabled
I am guessing your router is using https for remote management. If you are the one configuring the router, then you should turn this option off because anyone knowing the login/password can reconfigure your router. Then you probably can port forward.
 
Old 12-03-2022, 06:48 PM   #4
ozstar
Member
 
Registered: Oct 2003
Location: Sydney OZ
Distribution: Ubuntu 20.04LTS, Zorin 16.2 Pro
Posts: 143

Original Poster
Rep: Reputation: 15
Yes elgrandeperro I am the only one other than the ISP when needed. I didn't think of ythat and will take a look to see if that can be done.

rnturn yes I will look into that too. Was going fine until I decided to get the certificate, then whammo.


Thank you both.
 
Old 12-03-2022, 08:42 PM   #5
ozstar
Member
 
Registered: Oct 2003
Location: Sydney OZ
Distribution: Ubuntu 20.04LTS, Zorin 16.2 Pro
Posts: 143

Original Poster
Rep: Reputation: 15
Wekk I took a look in the NF18Nettcomm MESH and found this reference to 443, the only one in the admin. Not sure what it means and if it is related to my trouble.
Attached Thumbnails
Click image for larger version

Name:	router access control ip 443.JPG
Views:	8
Size:	86.9 KB
ID:	39983  
 
Old 12-03-2022, 09:05 PM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,699

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
Can you connect to your site from the Ubuntu PC itself and other PCs on the LAN using https?
Does redirecting work on the Ubuntu PC as well as other LAN PCs?

The router access control page is not port forwarding. I assume the problem lies from trying to access the website from inside the LAN. Try accessing your website from an external IP address. Try Turning the WiFi off on your mobile phone and connecting to your Public IP or URL.
 
Old 12-03-2022, 10:59 PM   #7
ozstar
Member
 
Registered: Oct 2003
Location: Sydney OZ
Distribution: Ubuntu 20.04LTS, Zorin 16.2 Pro
Posts: 143

Original Poster
Rep: Reputation: 15
Thank you

It all worked fine with http until I got the certificate and tried to port forward 443. The router refused to allow it and that's when it all went south :-)

These are the trying to connect via browsers scenarios..

From inside the Zorin16.2 (ubuntu20.04) VirtualBox where I have the server, in the FF browser with https I get to the front door of my IP (192.168.20.1) the gateway where it shows the admin login of my router
but with just http I get a 'Unable to connect page.

From the browser of the host Linux which is also the same os as VB, for both http and https I get from Firefox, Unable to connect.
From the browser of that same host with 127.0.0.1, I get the apache index.html (Then again this was not given a certificate)

From a Windows PC on the LAN the Brave browser says 'ERR_CONNECTION_REFUSED' with both http and https and also 127.0.0.1

I am currently looking at my apache config which I assume is now no good since the certificate site added code to the conf files etc for the 443.

It's a mess and I'd like to be able to undo the certificate and get back to normal the n start again, but so far the Let's Encrypt form doesn't respond to that request.

Sorry to present such a mess guys !!
 
Old 12-04-2022, 01:26 AM   #8
pingu_penguin
Member
 
Registered: Aug 2004
Location: pune
Distribution: Slackware
Posts: 350

Rep: Reputation: 60
Are you using IPv4 to connect to your https site or IPv6 ?

Did you try connecting to your https site from inside the network as michaelk suggested ?

Looks like a apache misconfiguration issue again to me.
 
Old 12-04-2022, 01:29 AM   #9
pingu_penguin
Member
 
Registered: Aug 2004
Location: pune
Distribution: Slackware
Posts: 350

Rep: Reputation: 60
Quote:
From a Windows PC on the LAN the Brave browser says 'ERR_CONNECTION_REFUSED' with both http and https and also 127.0.0.1
you are supposed to connect to the website ip from the lan , not 127.0.0.1.
 
Old 12-04-2022, 02:22 AM   #10
ozstar
Member
 
Registered: Oct 2003
Location: Sydney OZ
Distribution: Ubuntu 20.04LTS, Zorin 16.2 Pro
Posts: 143

Original Poster
Rep: Reputation: 15
Yes I tried inside network but still no go.
I checked apache and looks like you're right..

This is the message I get form a status command. How can I correct this please?


root@zorin162-VirtualBox:~# systemctl status apache2
● apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Tue 2022-12-06 20:22:24 AEDT; 11h ago
Docs: https://httpd.apache.org/docs/2.4/
Process: 585 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE)

Dec 06 20:22:20 zorin162-VirtualBox systemd[1]: Starting The Apache HTTP Server...
Dec 06 20:22:24 zorin162-VirtualBox apachectl[610]: AH00526: Syntax error on line 12 of /etc/apache2/sites-enabled/mysitemc-ssl.conf:
Dec 06 20:22:24 zorin162-VirtualBox apachectl[610]: <Directory> directive requires additional arguments
Dec 06 20:22:24 zorin162-VirtualBox apachectl[585]: Action 'start' failed.
Dec 06 20:22:24 zorin162-VirtualBox apachectl[585]: The Apache error log may have more information.
Dec 06 20:22:24 zorin162-VirtualBox systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE
Dec 06 20:22:24 zorin162-VirtualBox systemd[1]: apache2.service: Failed with result 'exit-code'.
Dec 06 20:22:24 zorin162-VirtualBox systemd[1]: Failed to start The Apache HTTP Server.
root@zorin162-VirtualBox:~#
Attached Thumbnails
Click image for larger version

Name:	apache problem.png
Views:	16
Size:	72.1 KB
ID:	39993  

Last edited by ozstar; 12-06-2022 at 03:10 PM.
 
Old 12-06-2022, 02:51 AM   #11
ozstar
Member
 
Registered: Oct 2003
Location: Sydney OZ
Distribution: Ubuntu 20.04LTS, Zorin 16.2 Pro
Posts: 143

Original Poster
Rep: Reputation: 15
Is it best I uninstall apache and delete all the 'sites-*' folders and conf files and start again, then re setup the certificate?
 
Old 12-06-2022, 09:55 PM   #12
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Code:
Dec 06 20:22:24 zorin162-VirtualBox apachectl[610]: AH00526: Syntax error on line 12 of /etc/apache2/sites-enabled/mysitemc-ssl.conf:
Dec 06 20:22:24 zorin162-VirtualBox apachectl[610]: <Directory> directive requires additional arguments
I'd recommend looking at those errors and figuring out the soln, otherwise you'll likely make the same mistake again.
 
Old 12-07-2022, 04:14 PM   #13
ozstar
Member
 
Registered: Oct 2003
Location: Sydney OZ
Distribution: Ubuntu 20.04LTS, Zorin 16.2 Pro
Posts: 143

Original Poster
Rep: Reputation: 15
Thank you. Yes I did and found the mistakes. Now moving on hopefully to a happy ending :-)
 
Old 12-08-2022, 10:22 AM   #14
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940
To provide "closure" for this thread, would you please add just one more post detailing what the problem turned out to be, and how you resolved it?

It's frustrating when you find a thread which seems to describe the same problem you're dealing with, and it just ends with "I fixed it!"

---

When you get a new router, always change the admin password to something non-trivial, and run a "software update." If your router provides for "automatic software updates," turn that option on. If it provides a firewall, turn that on and configure it appropriately. If it provides "easy configuration" for client computers, or "remote configuration," turn that off. You never know how long that piece of equipment has been sitting in a warehouse – I once bought a "new" unit whose software was three years old. This is the computer that is "sitting on the front porch of your house," and like any computer it can have vulnerabilities.

Last edited by sundialsvcs; 12-08-2022 at 10:27 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: What is https and How to enable https on your website LXer Syndicated Linux News 1 11-26-2019 06:36 AM
[SOLVED] Need suggestion:->>Failed HTTPS transfer to https://supportfiles.sun.com/curl manalisharmabe Solaris / OpenSolaris 11 01-10-2014 12:58 AM
https certication error , the page can not be loaded via https ust Linux - Server 2 11-21-2013 08:49 PM
redirect https://www.domain.com to https://domain.com decenter Linux - Server 4 09-13-2011 10:05 AM
apache 2.0 https to https redirect struct Linux - Software 1 04-22-2011 05:43 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 01:53 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration