Enable HTTPS/TLS with 8080 port on URL


#1

Hi there!

I’m trying to use ookla server for speed tests. It fails when try to test HTTPS throu 8080 port.
I want to enter my URL with 8080 port specified at the end of URL.
http://speedtest.mydomain.com.ar:8080 <— I can enter normal
https://speedtest.mydomain.com.ar <— (without port) I get a secure conection
https://speedtest.mydomain.com.ar: 8080 <— The browser show my conection is not secure

My certificate it’s okay. I get an +A on ssllabs.com
I already opened 8080 port with firewalld
How can I use TLS secure connection with 8080 port also?

My domain is: private server

I ran this command: certbot --apache -d speedtest.mydomain.com.ar

It produced this output:

My web server is (include version):

The operating system my web server runs on is (include version): Centos 7

My hosting provider, if applicable, is:

I can login to a root shell on my machine (yes or no, or I do not know): yes

I’m using a control panel to manage my site (no, or provide the name and version of the control panel): no


#2

You should modify the setup of your webserver. The certbot Apache plugin uses the default HTTP VirtualHost as template for a default HTTPS VirtualHost on port 443. So it does not automatically add a HTTPS VirtualHost for port 8080.

I don’t know how you’ve enabled HTTPS on your port 8080? Manually? How does the VirtualHost configuration look like?


#3

I don’t think it’s possible to use both http and https on the same port

Thank you


#4

speedtest.mydomain.com.ar.conf

<VirtualHost *:80>
    ServerAdmin root@localhost
	DocumentRoot /var/www/html/
	ServerName speedtest.mydomain.com.ar
	#Redirect / https://speedtest.mydomain.com.ar
	ServerAlias speedtest
	ErrorLog /var/www/html/error.log
		    
	<Directory "/var/www/html/">
	    DirectoryIndex index.html index.php
	    #Options FollowSymLinks
	    AllowOverride All
	    Require all granted
	</Directory>
</VirtualHost>


**speedtest.mydomain.com.ar-le-ssl.conf**

<IfModule mod_ssl.c>
<VirtualHost *:443 *:8080>
    ServerName speedtest.mydomain.com.ar
    ServerAlias speedtest.mydomain.com.ar
    DocumentRoot /var/www/html/
    ErrorLog /home/error.log
    CustomLog /home/requests.log combined
	Include /etc/letsencrypt/options-ssl-apache.conf
	SSLCertificateFile /etc/letsencrypt/live/speedtest.mydomain.com.ar/cert.pem
	SSLCertificateKeyFile /etc/letsencrypt/live/speedtest.mydomain.com.ar/privkey.pem
	SSLCertificateChainFile /etc/letsencrypt/live/speedtest.mydomain.com.ar/chain.pem
</VirtualHost>
</IfModule>

#5

Sorry, the last message doesn’t show up pretty well

speedtest.mydomain.com.ar-le-ssl.conf

<IfModule mod_ssl.c>
	<VirtualHost *:443 *:8080>
	    ServerName speedtest.mydomain.com.ar
	    ServerAlias speedtest.mydomain.com.ar
	    DocumentRoot /var/www/html/
	    ErrorLog /home/error.log
	    CustomLog /home/requests.log combined
		Include /etc/letsencrypt/options-ssl-apache.conf
		SSLCertificateFile /etc/letsencrypt/live/speedtest.mydomain.com.ar/cert.pem
		SSLCertificateKeyFile /etc/letsencrypt/live/speedtest.mydomain.com.ar/privkey.pem
		SSLCertificateChainFile /etc/letsencrypt/live/speedtest.mydomain.com.ar/chain.pem
	</VirtualHost>
</IfModule>

#6

Hi,

Is the website at port 8080 working in https now?

Thank you