Err_too_many_redirects - No idea why

Thank you for looking at this. I thought I followed the install instructions, but now have a non-working website that says
“Err_Too_Many_redirects”

Any help is greatly appreciated or any suggestions.


Please fill out the fields below so we can help you better. Note: you must provide your domain name to get help. Domain names for issued certificates are all made public in Certificate Transparency logs (e.g. https://crt.sh/?q=example.com), so withholding your domain name here does not increase secrecy, but only makes it harder for us to provide help.

My domain is: nextstudy.org

I ran this command: I followed the SSL cert installation

It produced this output: It said the SSL cert was installed. But when I go to the site it says, err_too_many_redirects

My web server is (include version): Google Cloud - Debian/Jessie

The operating system my web server runs on is (include version): Debina/Jessie/ Apache/2.4.10 (Debian)

My hosting provider, if applicable, is:

I can login to a root shell on my machine (yes or no, or I don’t know): Not able to log-in to Wordpress, but can log into GoogleCloud

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—


Below is the installation process:

Connected, host fingerprint: ssh-rsa 0 48:D0:FB:E1:34:D0:66:92:0B:FA:37:79:B9:23
:DB:8C:DB:F9:B9:40
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Mon Jun 10 23:07:09 2019 from 74.125.72.34
doug@wordpress-nextstudy-vm:~$ wget https://dl.eff. org/certbot-auto && chmod a+x certbot-auto
--2019-06-18 00:09:34-- https://dl.eff.org/certbot-auto
Resolving dl.eff. org (dl.eff.org)... 151.101.0.201, 151.101.64.201, 151.101.128.201, ...
Connecting to dl.eff .org (dl.eff.org)|151.101.0.201|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 68023 (66K) [application/octet-stream]
Saving to: ‘certbot-auto.2’
certbot-auto.2 100%[================================================>] 66.43K --.-KB/s in 0.02s
2019-06-18 00:09:34 (3.38 MB/s) - ‘certbot-auto.2’ saved [68023/68023]
doug@wordpress-nextstudy-vm:~$ ./certbot-auto certonly --webroot -w /opt/bitnami/apps/wordpress/htdocs/ -d nextstudy.com -d www.nextstudy. com
doug@wordpress-nextstudy-vm:~$ $ mkdir /tmp/apache_config_backup/
-bash: $: command not found
doug@wordpress-nextstudy-vm:~$ $ cp -r /etc/apache2/* /tmp/apache_config_backup/
-bash: $: command not found
doug@wordpress-nextstudy-vm:~$ $ mkdir /tmp/apache_config_backup/
-bash: $: command not found
doug@wordpress-nextstudy-vm:~$ $ cp -r /etc/apache2/* /tmp/apache_config_backup/
-bash: $: command not found
doug@wordpress-nextstudy-vm:~$ mkdir /tmp/apache_config_backup/
doug@wordpress-nextstudy-vm:~$ cp -r /etc/apache2/* /tmp/apache_config_backup/
doug@wordpress-nextstudy-vm:~$ sudo apt-get install python-certbot-apache -t stretch-backports
Reading package lists... Done
doug@wordpress-nextstudy-vm:~$ sudo apt-get install git
Reading package lists... Done
The following NEW packages will be installed:
git git-man libcurl3-gnutls liberror-perl rsync
0 upgraded, 5 newly installed, 0 to remove and 0 not upgraded.
Need to get 5,641 kB of archives.
After this operation, 25.5 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http:  //deb.debian.org/debian/ jessie/main liberror-perl all 0.17-1.1 [22.4 kB]
Get:2 http  ://security.debian.org/ jessie/updates/main libcurl3-gnutls amd64 7.38.0-4+deb8u15 [251 kB]
Get:3 http  ://security.debian.org/ jessie/updates/main git-man all 1:2.1.4-2.1+deb8u7 [1,269 kB]
Get:4 http://security.debian.org/ jessie/updates/main git amd64 1:2.1.4-2.1+deb8u7 [3,709 kB]
Get:5[ http://security.debian. org/](http://security.debian .org/) jessie/updates/main rsync amd64 3.1.1-3+deb8u2 [390 kB]
Fetched 5,641 kB in 0s (10.2 MB/s)
Selecting previously unselected package libcurl3-gnutls:amd64.
(Reading database ... 62461 files and directories currently installed.)
Preparing to unpack .../libcurl3-gnutls_7.38.0-4+deb8u15_amd64.deb ...
Unpacking libcurl3-gnutls:amd64 (7.38.0-4+deb8u15) ...
Selecting previously unselected package liberror-perl.
Preparing to unpack .../liberror-perl_0.17-1.1_all.deb ...
Unpacking liberror-perl (0.17-1.1) ...
Selecting previously unselected package git-man.
Preparing to unpack .../git-man_1%3a2.1.4-2.1+deb8u7_all.deb ...
Unpacking git-man (1:2.1.4-2.1+deb8u7) ...
Selecting previously unselected package git.
Preparing to unpack .../git_1%3a2.1.4-2.1+deb8u7_amd64.deb ...
Unpacking git (1:2.1.4-2.1+deb8u7) ...
Selecting previously unselected package rsync.
Preparing to unpack .../rsync_3.1.1-3+deb8u2_amd64.deb ...
Unpacking rsync (3.1.1-3+deb8u2) ...
Processing triggers for man-db (2.7.0.2-5) ...
Processing triggers for systemd (215-17+deb8u13) ...
Setting up libcurl3-gnutls:amd64 (7.38.0-4+deb8u15) ...
Setting up liberror-perl (0.17-1.1) ...
Setting up git-man (1:2.1.4-2.1+deb8u7) ...
Setting up git (1:2.1.4-2.1+deb8u7) ...
Setting up rsync (3.1.1-3+deb8u2) ...
Processing triggers for libc-bin (2.19-18+deb8u10) ...
Processing triggers for systemd (215-17+deb8u13) ...
doug@wordpress-nextstudy-vm:~$ sudo git clone[ https: //github.com/certbot/certbot.git](https://github. com/certbot/certbot.git)
Cloning into 'certbot'...
remote: Enumerating objects: 38, done.
remote: Counting objects: 100% (38/38), done.
remote: Compressing objects: 100% (34/34), done.
remote: Total 66269 (delta 10), reused 15 (delta 4), pack-reused 66231
Receiving objects: 100% (66269/66269), 21.74 MiB | 22.51 MiB/s, done.
Resolving deltas: 100% (48464/48464), done.
Checking connectivity... done.
doug@wordpress-nextstudy-vm:~$ cd certbot
doug@wordpress-nextstudy-vm:~/certbot$ ./certbot-auto
Requesting to rerun ./certbot-auto with root privileges...
./certbot-auto has insecure permissions!
To learn how to fix them, visit[ https://community.letsencrypt. org/t/certbot-auto-deployment-best-practices/91979/](https://community.letsencrypt. org/t/certbot-auto-deployment-best-practices/91979/)
Creating virtual environment...
Installing Python packages...
Installation succeeded.
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator apache, Installer apache
Which names would you like to activate HTTPS for?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: nextstudy. org
2: www.nextstudy. org
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate numbers separated by commas and/or spaces, or leave input
blank to select all options shown (Enter 'c' to cancel):
Cert is due for renewal, auto-renewing...
Renewing an existing certificate
Performing the following challenges:
http-01 challenge for nextstudy.org
http-01 challenge for www.nextstudy. org
Waiting for verification...
Cleaning up challenges
Created an SSL vhost at /etc/apache2/sites-available/wordpress-le-ssl. conf
Deploying Certificate to VirtualHost /etc/apache2/sites-available/wordpress-le-ssl. conf
Enabling available site: /etc/apache2/sites-available/wordpress-le-ssl. conf
Deploying Certificate to VirtualHost /etc/apache2/sites-available/wordpress-le-ssl. conf
Please choose whether or not to redirect HTTP traffic to HTTPS, removing HTTP access.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: No redirect - Make no further changes to the webserver configuration.
2: Redirect - Make all requests redirect to secure HTTPS access. Choose this for
new sites, or if you're confident your site works on HTTPS. You can undo this
change by editing your web server's configuration.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate number [1-2] then [enter] (press 'c' to cancel): 1
Future versions of Certbot will automatically configure the webserver so that all requests redirect to secure HTTPS
access. You can control this behavior and disable this warning with the --redirect and --no-redirect flags.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Your existing certificate has been successfully renewed, and the new certificate
has been installed.
The new certificate covers the following domains: https://nextstudy.org and
[https://www.nextstudy.org](https://www.nextstudy. org/)
You should test your configuration at:
https://www.ssllabs.com/ssltest/analyze.html?d=nextstudy. org
https://www.ssllabs.com/ssltest/analyze.html?d=www.nextstudy. org
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
IMPORTANT NOTES:
- Congratulations! Your certificate and chain have been saved at:
/etc/letsencrypt/live/nextstudy.org/fullchain. pem
Your key file has been saved at:
/etc/letsencrypt/live/nextstudy.org/privkey. pem
Your cert will expire on 2019-09-15. To obtain a new or tweaked
version of this certificate in the future, simply run certbot-auto
again with the "certonly" option. To non-interactively renew *all*
of your certificates, run "certbot-auto renew"

Can you paste the contents of /etc/apache2/sites-available/wordpress-le-ssl.conf? And perhaps the other Apache virtual hosts?

I am tried to enter that in the SSH window, but ti says it isn’t available. Can I get help how to pull up that information?

Exactly what did you enter, and exactly what was the error message?

/etc/apache2/sites-available/wordpress-le-ssl.conf is – or should be – a text file, not a command. So you can run a command like “cat /etc/apache2/sites-available/wordpress-le-ssl.conf” to display it.

Here is what I entered:

doug@wordpress-nextstudy-vm:~/certbot/certbot/certbot$ /etc/apache2/sites-available/wordpress-le-ssl.conf?
-bash: /etc/apache2/sites-available/wordpress-le-ssl.conf?: No such file or directory
doug@wordpress-nextstudy-vm:~/certbot/certbot/certbot$ cd
doug@wordpress-nextstudy-vm:~ /etc/apache2/sites-available/wordpress-le-ssl.conf? -bash: /etc/apache2/sites-available/wordpress-le-ssl.conf?: No such file or directory doug@wordpress-nextstudy-vm:~

doug@wordpress-nextstudy-vm:~ cat/etc/apache2/sites-available/wordpress-le-ssl.conf -bash: cat/etc/apache2/sites-available/wordpress-le-ssl.conf: No such file or directory doug@wordpress-nextstudy-vm:~

There needs to be a space after “cat”.

doug@wordpress-nextstudy-vm:~$ cat /etc/apache2/sites-available/wordpress-le-ssl.conf

<VirtualHost *:443>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html

ServerName www.nextstudy.org
ServerAlias nextstudy.org
Redirect / https://nextstudy.org/

Options FollowSymLinks
AllowOverride None

<Directory /var/www/html/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory “/usr/lib/cgi-bin”>
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all

ErrorLog ${APACHE_LOG_DIR}/error.log

Possible values include: debug, info, notice, warn, error, crit,

alert, emerg.

LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/nextstudy.org-0001/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/nextstudy.org-0001/privkey.pem

Well, there’s the redirect:

2 Likes

You are wonderful. How do I get rid of the redirect?

1 Like

You can use a text editor to modify this file. The one that’s most often recommended to novices is nano because it’s fairly self-documenting.

1 Like

Do I simply remove everything after the word redirect?

You could comment out the line by adding a # character at the beginning, so that you preserve the information about what used to be there but prevent it from having an effect on your configuration.

1 Like

What file or file name should I open with nano?

Thanks. I looked in varied of files, but only found code in Apache2.conf, but no redirect command.

Any other file name you would suggest I look in? Below is what file types I tried.

doug@wordpress-nextstudy-vm:~ nano /etc/apache2/conf-enabled doug@wordpress-nextstudy-vm:~ nano /etc/apache2/apache2.conf
doug@wordpress-nextstudy-vm:~ nano /etc/apache2/sites-enabled.conf doug@wordpress-nextstudy-vm:~ nano /etc/apache2/conf-enabled.conf
doug@wordpress-nextstudy-vm:~ nano /etc/apache2/mods-enabled.conf doug@wordpress-nextstudy-vm:~ nano /etc/apache2/apache2.conf

I think I found the right file - /etc/apache2/sites-available/wordpress-le-ssl.conf

When I put “#” in front of the redirect and tried to save it said permission denied, but I have the highest level of ownership. Any idea why?

Try putting sudo in front of the command.

1 Like

Here is the error message I am getting. Any idea why or anything else to try? I have “owner” roles

Below is the error message I am getting.

          [ Error writing /etc/apache2/sites-available/wordpress-le-ssl.conf: Permission denied ]

^G Get Help ^O WriteOut ^R Read File ^Y Prev Page ^K Cut Text ^C Cur Pos

But are you running the text editor as root?

With e.g. “sudo nano” or by using “sudoedit”?

Thank you it worked! Do I need to reset or restart the server for it take effect? I am still getting the same error message of too many redirects.