How to disable HTTPS in Centos Apache 2 installed on Amazon EC2?

Asked

Viewed 449 times

0

I installed Centos an Amazon EC2 instance, and inserted an SSL certificate using Let’s Encrypt - Free SSL/TLS Certificates. It was all cute and it’s working perfectly. Look:

inserir a descrição da imagem aqui

Every time it’s inserted http://, automatically the user is redirected to https://. As I am performing some tests, I would like to disable HTTPS.

I hacked into the archive /etc/httpd/conf.d/ssl.conf and I saw all the configuration, but did not know what to do to disable HTTPS so that it works again only using HTTP.

How can I disable HTTPS in Centos Apache 2 installed on Amazon EC2?

1 answer

1


If what you want is just to disable redirect, just search on httpd.conf (or included configuration files) something similar to this:

Redirect permanent / https://dominio.com/

He’s probably on the vhosts

It may be that the redirect is in a .htaccess also, it may be something similar to this:

RewriteRule ^(.*)$ https://dominio/$1 [L,R=301]

Just add # forward to comment on this line.

IS important remember that when the browser receives a 301 redirect even if you remove the redirect the browser will still direct to the url with HTTPS, This is because 301 redirection is called permanent redirection and with this the browser records in your local data of your profile such redirection, that is, the browser before you can even connect in the domain will redirect to HTTPS.

To avoid this redirection there are only two ways, clearing the browsing data or opening the browser anonymously.

  • I’m giving an http:// by Postman and is giving 404 Page Not Found.

  • @white your virtualhost must be set to HTTPS only, post virtualhosts for me to see please.

  • Funny, I got into/etc/httpd/conf/httpd.conf but there’s no virtualhost there. I believe that after I installed Lets Encrypt, I only used https.

  • in ssl.conf has <virtualhost *.443> only.

  • 1

    Bro, thanks a lot!! I didn’t have virtualhost even on httpd.conf, only on ssl.conf... so what I did, I went there and created a manual Virtualhost on httpd.conf was good. is now running both http and https;

  • I believe that with the Lets Encrypt configuration, somehow deleted the port 80 navigation option. I’ll read some more to see what might have happened.

  • There’s something I’m buoyant about

  • But outside ssl.conf are there other virtualhost? No port? Look everywhere something like DocumentRoot ..., must exist in more than one place ... if it exists only in 443, then look for other virtualhosts, regardless of what is inside ssl.conf. When you find it see if it counts DocumentRoot and see where he’s pointing @white

  • @white this installation of SSL usually does not change what already exists, it was done manually?

  • 1

    The problem was the redirect. When I was making a request, I was giving 404.. Then I did what you said, removed the redirect and it worked. Then I will change this so that it works even with ssl only... is that at the moment I can’t because I would have to update the app that is pointing to http and not https. As soon as I submit a new app update, I activate the redirect again. Vlw for help.

Show 5 more comments

Browser other questions tagged

You are not signed in. Login or sign up in order to post.