SSL Question

Problems with the Windows version of XAMPP, questions, comments, and anything related.

SSL Question

Postby m_cankov » 21. April 2023 08:37

hello, I bought an ssl certificate for my website, installed it on my apache server, made the necessary settings in httpd-vhosts.conf and everything works fine when the site is accessed from external networks.However, when I try to access it from an internal network (the same as the server) it does not open.

This is my settings on httpd-vhosts.conf

<VirtualHost *:80>

DocumentRoot "C:/xampp/htdocs/website"
ServerName mywebsite.com
ServerAlias www.mywebsite.com
Redirect permanent / https://www.mywebsite.com

</VirtualHost>


<VirtualHost *:443>

DocumentRoot "C:/xampp/htdocs/website"
ServerName website.com
ServerAlias www.mywebsite.com

SSLEngine on
SSLCertificateFile "conf/ssl/certificate.crt"
SSLCertificateKeyFile "conf/ssl/private.key"
SSLCertificateChainFile "conf/ssl/ca_bundle.crt"
<Directory "C:/xampp/htdocs/sot">
Options All
AllowOverride All
Require all granted
</Directory>
</VirtualHost>


What could be the problem?
m_cankov
 
Posts: 3
Joined: 20. February 2023 10:49
XAMPP version: 3
Operating System: windows 10

Re: SSL Question

Postby Nobbie » 21. April 2023 09:54

m_cankov wrote:What could be the problem?


Your Router.

You did not tell us, how your server is connected to the internet. But IF it is connected via Router and Portforwarding, some Routers do not apply so called "NAT loopback". That means, you cannot reach internal server within your LAN via an external IP (your Router). That happens mosrly. when you assigned a DynDNS Domain to your server (what you did not tell us either).

If you need more help. you should explain more precisely what it means "it does not open", explain which URL you enter in your browser, explain how your server is connected to the internet and explain how the Domain Name is assigned.

P.S.: You also have a weird error in your VirtualHost, see the following lines:

DocumentRoot "C:/xampp/htdocs/website"
...
<Directory "C:/xampp/htdocs/sot">
Nobbie
 
Posts: 13176
Joined: 09. March 2008 13:04

Re: SSL Question

Postby m_cankov » 21. April 2023 11:12

The server connects to the internet through a MikroTik router and NAT. Domain Name is assigned on public static ip address on router. maybe the problem is NAT loopbackreally with
m_cankov
 
Posts: 3
Joined: 20. February 2023 10:49
XAMPP version: 3
Operating System: windows 10

Re: SSL Question

Postby Nitu Bisht » 23. January 2024 10:18

If you are purchase the SSl Certificate and install on Apache server. here is the few steps to securing your website and ensure the data exchanged between your server and users is encrypted. given the basis steps to install an ssl certificate.

1) Obtain an SSL Certificate
2) Upload Certificate Files:
3) Update Apache Configuration

Open the Apache configuration file. The location might vary based on your server setup, but common paths include /etc/apache2/apache2.conf.

Look for the <VirtualHost> block corresponding to your website or create one if it doesn't exist.

Add the following lines to configure SSL:


<VirtualHost *:443>
ServerName yourdomain.com
DocumentRoot /path/to/your/document/root

SSLEngine on
SSLCertificateFile /path/to/your/certificate.crt
SSLCertificateKeyFile /path/to/your/private.key
SSLCertificateChainFile /path/to/your/chainfile.pem

# Additional SSL Configuration (optional)
# SSLProtocol, SSLCipherSuite, etc.
</VirtualHost>

Replace domain.com, /path/to/your/document/root, and file paths with your actual domain, document root, and SSL certificate file paths.

4) Verify Configuration
5) Test SSL

This steps are based on your server operating system and apache version.
Nitu Bisht
 
Posts: 1
Joined: 23. January 2024 09:44
XAMPP version: 8.2.12
Operating System: Windows Server 2008 and later


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 217 guests