How setting up SSL on Xampp (Ubuntu)

Hello?

I run my site using Ubuntu 20.04 and Xampp on a server based on Conoha.

I tried to get an SSL certificate and apply it to my site, but most of the information was not subject to the condition Ubuntu + Xampp.

I want to know how to get SSL issued under the condition of Ubuntu 20.04+Xampp and apply it to my site. I can't find the relevant information.

Please help me.

Hi @MAYUI, and welcome to the LE community forum :slight_smile:

You may do better by splitting those two things:

  • get a cert using an ACME client for Ubuntu 20 [Like: certbot via snap]

  • update Xampp to use the obtained cert

3 Likes

I run a homepage using XAMPP at Ubuntu 20.04. When I used the following command to get the ssl certificate, the following error occurred. I need a cause of this and a solution. I beg you.

My domain is: www.waggle.kr

I ran this command: sudo certbot certonly --webroot -w /opt/lampp/htdocs/w -d www.waggle.kr

It produced this output:
http-01 challenge for www.waggle.kr
Cleaning up challenges
Some challenges have failed.

IMPORTANT NOTES:

  • The following errors were reported by the server:

    Domain: www.waggle.kr
    Type: unauthorized
    Detail: (my ip): Invalid response from
    http://www.waggle.kr/.well-known/acme-challenge/(#^%$^$#$#)
    404

    To fix these errors, please make sure that your domain name was
    entered correctly and the DNS A/AAAA record(s) for that domain
    contain(s) the right IP address.

  • Your account credentials have been saved in your Certbot
    configuration directory at /etc/letsencrypt. You should make a
    secure backup of this folder now. This configuration directory will
    also contain certificates and private keys obtained by Certbot so
    making regular backups of this folder is ideal.

My web server is (include version):

The operating system my web server runs on is (include version): ubuntu 20.04 + XAMPP

My hosting provider, if applicable, is: conoha

I can login to a root shell on my machine (yes or no, or I don't know): yes

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

The version of my client is (e.g. output of certbot --version or certbot-auto --version if you're using Certbot): certbot 0.40.0

1 Like

Can you locate the file with the Apache VirtualHost config for this domain name?

Inside that VirtualHost, what is the folder name for the DocumentRoot ?

The DocumentRoot folder should be used for the -w folder

I think you may need to remove the /w from the end of the folder in your certbot -w but best to see what your DocumentRoot says to make sure

3 Likes

I was able to find the file with the virtual host in /opt/lampp/etc/extra/httpd-vhost.conf, and the contents are as follows:

<VirtualHost *:80>
    ServerAdmin (E-mail)
    DocumentRoot "/opt/lampp/htdocs/w/"
    ServerName waggle.kr
    ServerAlias www.waggle.kr
    ErrorLog "logs/waggle.kr-error_log"
    CustomLog "logs/waggle.kr-access_log" common
</VirtualHost>

That looks right. Can you show output of this command?

apachectl -S
3 Likes

Command 'apachectl' not found, but can be installed with:

apt install apache2

It comes out like this. It's not that I didn't install Apache 2, but it seems to be because the Apache is embedded in xampp.

And here's the news. As you recommended, I took out "W" and used the command "sudo certbot certonly --webroot -w /opt/lampp/htdocs -d www.waggle.kr" and the certificate was issued.

Now I wonder what I should do to apply the certificate.

No, I understand. I was hoping the same command would work anyway.

I am a little puzzled why removing the /w worked. Your DocumentRoot showed it needed one. I wanted to see that other -S info as I wonder if you have more than one VirtualHost for the same domain name.

I originally saw you redirected requests to your domain name to a URL that had a /w on the end. That was why I thought it would not be in your DocumentRoot but it was. Puzzling

I don't know the xampp environ well (as you can see), so can't help much with configuring apache inside it. Sorry

If you can find the command that will show output from -S I could maybe help

3 Likes

Please show the output of:
netstat -pant | grep 80

Also, this could use an update:

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.