LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Host website on port 443? (https://www.linuxquestions.org/questions/linux-server-73/host-website-on-port-443-a-4175680371/)

Finsfree 08-13-2020 09:53 PM

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

Ser Olmy 08-13-2020 09:56 PM

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.

Finsfree 08-13-2020 10:05 PM

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?

Ser Olmy 08-13-2020 10:09 PM

Just move the firewall GUI to another port, then forward port 443 to the Ubuntu server.

michaelk 08-13-2020 10:26 PM

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.

scasey 08-13-2020 11:20 PM

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...

ondoho 08-14-2020 01:51 AM

Quote:

Originally Posted by Finsfree (Post 6155690)
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

Finsfree 08-14-2020 10:36 AM

3 Attachment(s)
Quote:

Originally Posted by scasey (Post 6155702)
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).

linksm 08-16-2020 06:36 AM

You should set up the rule for port 443 in your firewall

JJJCR 08-17-2020 02:51 AM

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/


All times are GMT -5. The time now is 10:42 AM.