LinuxQuestions.org
Help answer threads with 0 replies.
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 08-13-2020, 09:53 PM   #1
Finsfree
Member
 
Registered: Aug 2018
Location: 3rd rock from the sun
Distribution: Ubuntu, Mint & Kali
Posts: 72

Rep: Reputation: Disabled
Host website on port 443?


I'm hosting a website on my Ubuntu Server. The website is up and running. I created an A record in GoDaddy.com to point the namespace to my public IP. All this is good but I'm only using port 80 (http). I want to use port 443, however if I use the namespace w/ port 443 I get my firewalls login page.

How can I use port 443 for both my website and for the firewall login page? I don't want to give up one for the other. I know it's something simple and stupid I just never hosted a website before, but I want to be secure with the connection.

Btw, this is all a home lap experiment.

Thanks
 
Old 08-13-2020, 09:56 PM   #2
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 2,777

Rep: Reputation: Disabled
It depends on which webserver(s) you are using, and your network setup.

If the public IP address is directly assigned to the Ubuntu server, getting your website to work on port 443 is a matter of configuring the web server and/or the firewall web GUI. If the firewall is your router and you're forwarding port 80 to the Ubuntu server, you'll have to move the firewall GUI to a different port.
 
Old 08-13-2020, 10:05 PM   #3
Finsfree
Member
 
Registered: Aug 2018
Location: 3rd rock from the sun
Distribution: Ubuntu, Mint & Kali
Posts: 72

Original Poster
Rep: Reputation: Disabled
My firewall is my router (fortinet 60d). I know I can configure the firewall the port forward all https traffic to the web server, but I would lose the ability to login on to my firewall...right? Wouldn't that stop me from being able to login my firewall w/ https?

How can I use https for both the website and the firewall?

Last edited by Finsfree; 08-13-2020 at 10:08 PM.
 
Old 08-13-2020, 10:09 PM   #4
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 2,777

Rep: Reputation: Disabled
Just move the firewall GUI to another port, then forward port 443 to the Ubuntu server.
 
Old 08-13-2020, 10:26 PM   #5
michaelk
Moderator
 
Registered: Aug 2002
Posts: 20,407

Rep: Reputation: 3551Reputation: 3551Reputation: 3551Reputation: 3551Reputation: 3551Reputation: 3551Reputation: 3551Reputation: 3551Reputation: 3551Reputation: 3551Reputation: 3551
I am guessing you are trying to access the server from within your LAN using your public IP. Seeing your router's configuration webpage is normal and you should still be able to access the server from within the LAN using its LAN IP address.

Without changing anything you should be access your server from outside your LAN. A quick test would be to turn off your smartphone or other similar device's wifi and try to access your website using https. If it all works you really do not need to change anything if you can not change the router's port.
 
1 members found this post helpful.
Old 08-13-2020, 11:20 PM   #6
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.8.2003
Posts: 5,131

Rep: Reputation: 1876Reputation: 1876Reputation: 1876Reputation: 1876Reputation: 1876Reputation: 1876Reputation: 1876Reputation: 1876Reputation: 1876Reputation: 1876Reputation: 1876
Is your web server listening on port 443? What does
Code:
netstat -tnlp
show you?
Use of the secure port is managed in the web server configuration. We redirect all http requests to https there...and yes, obviously, you need to have port 443 open in your firewall...

You'll also need a certificate for the site...
 
Old 08-14-2020, 01:51 AM   #7
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 15,305
Blog Entries: 9

Rep: Reputation: 4379Reputation: 4379Reputation: 4379Reputation: 4379Reputation: 4379Reputation: 4379Reputation: 4379Reputation: 4379Reputation: 4379Reputation: 4379Reputation: 4379
Quote:
Originally Posted by Finsfree View Post
How can I use https for both the website and the firewall?
Port 443 is only meaningful if you want to use HTTPS in your browser - that defaults to 443.
Apparently that is what you want.
Assigning a different port is not enough, you need to set up SSL keys (either self-made, in which case most browsers are going to complain, or purchased, or created with letsencrypt) and tell your server software to actually serve traffic encrypted with these keys.

There's Gazillions of tutorials covering this particular topic. I recommend tutorials from digitalocean
 
2 members found this post helpful.
Old 08-14-2020, 10:36 AM   #8
Finsfree
Member
 
Registered: Aug 2018
Location: 3rd rock from the sun
Distribution: Ubuntu, Mint & Kali
Posts: 72

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by scasey View Post
Is your web server listening on port 443? What does
Code:
netstat -tnlp
show you?
Use of the secure port is managed in the web server configuration. We redirect all http requests to https there...and yes, obviously, you need to have port 443 open in your firewall...

You'll also need a certificate for the site...
I guess I do not have port 443 open (see attached). The other attachment is the complete system info of the machine (VM). The firewall (fortinet 60D) is allowing port 443 traffic through.

Also I added the ufw status (see attached).
Attached Thumbnails
Click image for larger version

Name:	https_01.PNG
Views:	9
Size:	28.5 KB
ID:	33861   Click image for larger version

Name:	inxi.PNG
Views:	7
Size:	38.7 KB
ID:	33862   Click image for larger version

Name:	FW.PNG
Views:	6
Size:	21.0 KB
ID:	33863  

Last edited by Finsfree; 08-14-2020 at 10:55 AM.
 
Old 08-16-2020, 06:36 AM   #9
linksm
LQ Newbie
 
Registered: Aug 2020
Posts: 3

Rep: Reputation: Disabled
You should set up the rule for port 443 in your firewall
 
Old 08-17-2020, 02:51 AM   #10
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 1,812

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
Do you have these settings below in your Apache config, I think it's httpd.conf. Haven't played Apache for a while don't know which file to configured for the listening port.

Like: Listen 443

Or check out this link: https://bobcares.com/blog/apache-not...g-on-port-443/
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Check port open status for port 443 asteroid4u Linux - Server 8 07-06-2017 09:56 PM
[SOLVED] Redirect port 443 requests to port 3000 on hostmonster (Centos 6.8) for Node Express Application listening on port 3000 brentw Linux - Server 8 12-20-2016 11:38 AM
[SOLVED] Making request at port 443, but strangely my requests are redirected to port 80. anjo236 Linux - Newbie 3 03-01-2016 01:16 PM
Configuring Automatic Redirects from port 80 to port 443 with bundled Apache server kaplan71 Fedora 1 12-28-2007 08:30 AM
turn off http port 80, keep https port 443 lothario Linux - Networking 6 02-11-2005 04:06 AM

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

All times are GMT -5. The time now is 03:42 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