It produced this output: a file named 000-default-le-ssl.conf
My web server is (include version): apache 2.4.29
The operating system my web server runs on is (include version): Ubuntu 18.04 LTS
My hosting provider, if applicable, is: alicloud
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): XShell6
The version of my client is (e.g. output of certbot --version or certbot-auto --version if you’re using Certbot): 0.31.0
Im noooooob.
this might be a dumb question.
so after running certbot --apache, I got an error “redirect too many times” when I go to my site.
I fixed it by comment out the redirect line in 000-default-le-ssl.conf.
Since it is a configuration file for :443 port, which stands for an HTTPS request, the thing that makes me curious is why is there a redirect to https url? In what case is that gonna be used?
Thanks for your time!!
Perhaps you already got such a redirect and perhaps certbot added another one, so you ended up with too much redirect statements? Without actually seeing the specific configuration statements, it's hard to say.
<VirtualHost *:443>
<Directory /var/www/TianyiTimothy.github.io>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
#ServerName www.example.com
ServerAdmin webmaster@localhost
DocumentRoot /var/www/TianyiTimothy.github.io
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
Redirect "/" "https://tianyi.codes/"
Hi, @JuergenAuer and @Osiris,
Thanks for your reply!!
Here is my configuration, so the last line Redirect "/" "https://tianyi.codes/" is what caused the problem.
I removed the comment and checked my link. The website says “Error direct loop”.
I think it could be https->https loop if that’s possible.
Thanks again for your reply!
certbot doesn't use those kind of redirects (it uses mod_rewrite), so I guess the redirect was already in place in your HTTP configuration and certbot just copied it when it made the HTTPS virtualhost. It probably assumes no such redirect is already in place.