I need help to set up SSL on my webserver

I quote: The secure vhost is missing:

I don't understand well what you mean. Remember I like programing but it is my first time with servers.

Can you explain a little bit that part.

Yes you're right I make a huge mistake with RewriteCond thank you very much you're helping me a lot bro.

Y will try all this and I came with the news! thanks

we are almost there my friend, wen I wrote on the explorer alcalacompra.com it takes me to https://www.alcalacompra.com/ but it doesn't enter the web, If I can I'll ask you something more.

Inside my /etc/hosts y make this modifications

# Default
127.0.0.1 localhost

# Added by me = )
127.0.0.1  alcalacompra.com
127.0.0.1  archivomental.com

# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

so alcalacompra and archivomental should by like that or the right thing is:

127.0.1.1 alcalacompra.com
127.0.2.1 archivomental.com

Is a big doubt that I have.

Change your file to this:

<VirtualHost *:80>
        # Domain setings
        ServerAdmin alcalacompra.tienda@gmail.com
        ServerName www.alcalacompra.com
        ServerAlias alcalacompra.com
        DocumentRoot /var/www/prestashop
        # Error and access log files
        ErrorLog ${APACHE_LOG_DIR}/prestashop.error.log
        CustomLog ${APACHE_LOG_DIR}/prestashop.access.log combined
        # Redirec to HHTPS
        RewriteEngine on
        RewriteCond %{SERVER_NAME} =alcalacompra.com [OR]
        RewriteCond %{SERVER_NAME} =www.alcalacompra.com
        RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>

# LoadModule ssl_module modules/mod_ssl.so

<VirtualHost *:443>
    ServerName www.alcalacompra.com
    ServerAlias alcalacompra.com
    DocumentRoot /var/www/prestashop
        # Prestashop needs
        <Directory /var/www/prestashop>
        Options -Indexes +FollowSymLinks
        AllowOverride All
        </Directory>
        # Error and access log files
        ErrorLog ${APACHE_LOG_DIR}/prestashop.error.log
        CustomLog ${APACHE_LOG_DIR}/prestashop.access.log combined
    SSLEngine on
    SSLCertificateFile "/etc/letsencrypt/live/alcalacompra.com/fullchain.pem"
    SSLCertificateKeyFile "/etc/letsencrypt/live/alcalacompra.com/privkey.pem"
    RewriteEngine on
    RewriteCond %{SERVER_NAME} =alcalacompra.com
    RewriteRule ^ https://www.alcalacompra%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
3 Likes

Yes sir I will right now! you are the reason that I will make it you know that right he he

Finally my SSL port is listening:

~$ nmap -p 443 --reason www.archivomental.com

Starting Nmap 7.80 ( https://nmap.org ) at 2023-06-15 21:15 CEST
Nmap scan report for www.archivomental.com (127.0.0.1)
Host is up, received syn-ack (0.0013s latency).
rDNS record for 127.0.0.1: localhost

PORT    STATE SERVICE REASON
443/tcp open  https   syn-ack

Nmap done: 1 IP address (1 host up) scanned in 0.53 seconds

Now I will try thank you for your time man. I owe you a big one!

1 Like

Do you have two sites?

2 Likes

yes but I disable one to make this one work, anyway it still not working

The another one is a phpbb forum.

Where did you do that nmap?

I can't reach your site via HTTPS from the Internet.

3 Likes

I did nmap from shell bash I can't reach the site too tomorrow I will try now I'm very tired I spend one week with this problem and I wake up at 5:00 am thank you very much for your time and support.

1 Like

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