My website crash too many redirect after instaling let's encrypt

and filzela to transfer files

2 Likes

Perfect. :slightly_smiling_face:

Let's find out a few things.

What are the outputs of these commands?

sudo apachectl -S
sudo ls -lRa /etc/apache2/sites-available
sudo ls -lRa /etc/apache2/sites-enabled

Please put 3 backticks above and below each output, like this:

```
output
```

2 Likes
root@wordpress-ubuntu-s-1vcpu-1gb-nyc3-01:~# sudo apachectl -S
VirtualHost configuration:
*:80                   guesthost.tech (/etc/apache2/sites-enabled/000-default.conf:4)
ServerRoot: "/etc/apache2"
Main DocumentRoot: "/var/www/html"
Main ErrorLog: "/var/log/apache2/error.log"
Mutex watchdog-callback: using_defaults
Mutex rewrite-map: using_defaults
Mutex default: dir="/var/run/apache2/" mechanism=default
Mutex mpm-accept: using_defaults
PidFile: "/var/run/apache2/apache2.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
User: name="www-data" id=33
Group: name="www-data" id=33

/etc/apache2/sites-available:
total 16
drwxr-xr-x 2 www-data www-data 4096 Jun  1 22:12 .
drwxr-xr-x 8 www-data www-data 4096 Jun  2 11:53 ..
-rw-r--r-- 1 www-data www-data  511 Dec 16 14:56 000-default.conf
-rw-r--r-- 1 www-data www-data 1332 Apr 13  2020 000-default.conf.dpkg-dist
/etc/apache2/sites-enabled:
total 12
drwxr-xr-x 2 www-data www-data 4096 Jun  9 21:46 .
drwxr-xr-x 8 www-data www-data 4096 Jun  2 11:53 ..
-rw-r--r-- 1 www-data www-data  709 Jun  1 17:41 000-default.conf```
2 Likes

Thanks for that. :slightly_smiling_face:

What are the outputs of these commands?

sudo cat /etc/apache2/sites-available/000-default.conf
sudo cat /etc/apache2/sites-enabled/000-default.conf
3 Likes

Do you have a .htaccess file in your webroot directory (/var/www/html/.htaccess)?

2 Likes
root@wordpress-ubuntu-s-1vcpu-1gb-nyc3-01:~# sudo cat /etc/apache2/sites-enabled/000-default.conf
# Added to mitigate CVE-2017-8295 vulnerability
UseCanonicalName On

<VirtualHost *:80>
        ServerAdmin webmaster@localhost

        ServerName guesthost.tech
        ServerAlias www.guesthost.tech

        DocumentRoot /var/www/html

        <Directory /var/www/html/>
            Options FollowSymLinks
            AllowOverride All
            Require all granted
        </Directory>

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
RewriteEngine on
RewriteCond %{SERVER_NAME} =guesthost.tech [OR]
RewriteCond %{SERVER_NAME} =www.guesthost.tech
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
root@wordpress-ubuntu-s-1vcpu-1gb-nyc3-01:~# ^C
root@wordpress-ubuntu-s-1vcpu-1gb-nyc3-01:~# sudo cat /etc/apache2/sites-available/000-default.conf
# Added to mitigate CVE-2017-8295 vulnerability
UseCanonicalName On

<VirtualHost *:80>
        ServerAdmin webmaster@localhost

        ServerName $domain
        ServerAlias www.$domain

        DocumentRoot /var/www/html

        <Directory /var/www/html/>
            Options FollowSymLinks
            AllowOverride All
            Require all granted
        </Directory>

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
root@wordpress-ubuntu-s-1vcpu-1gb-nyc3-01:~# sudo cat /etc/apache2/sites-enabled/000-default.conf
# Added to mitigate CVE-2017-8295 vulnerability
UseCanonicalName On

<VirtualHost *:80>
        ServerAdmin webmaster@localhost

        ServerName guesthost.tech
        ServerAlias www.guesthost.tech

        DocumentRoot /var/www/html

        <Directory /var/www/html/>
            Options FollowSymLinks
            AllowOverride All
            Require all granted
        </Directory>

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
RewriteEngine on
RewriteCond %{SERVER_NAME} =guesthost.tech [OR]
RewriteCond %{SERVER_NAME} =www.guesthost.tech
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
2 Likes

Can you please edit your last post to fix the backticks? The top of the first file got cutoff.

3 Likes

sorry I have edited the post thank you

3 Likes

I don't have the .htaccess file i have checked

2 Likes
  1. Remove the bad configuration.

sudo rm /etc/apache2/sites-enabled/000-default.conf

  1. Fix the good configuration.

sudo nano /etc/apache2/sites-available/000-default.conf

Replace $domain in the ServerName and ServerAlias with guesthost.tech

  1. Enable the good configuration.

sudo a2ensite 000-default.conf

  1. Reload Apache.

sudo apachectl -k graceful

  1. Check the status.

sudo apachectl -S

3 Likes

how to :

Replace $domain in the ServerName and ServerAlias with guesthost.tech
after I have executed the command

2 Likes

That command should bring up the nano text editor to make the changes.

3 Likes
root@wordpress-ubuntu-s-1vcpu-1gb-nyc3-01:~# sudo a2ensite 000-default.conf
Enabling site 000-default.
To activate the new configuration, you need to run:
  systemctl reload apache2

2 Likes

I Reload apache or I run the command ?

2 Likes

Just go to the next step. It instructs you to gracefully reload apache with a different command. :slightly_smiling_face:

2 Likes

oki =) I must learn to code I adore this =)

2 Likes

this is the result

root@wordpress-ubuntu-s-1vcpu-1gb-nyc3-01:~# sudo apachectl -k graceful
root@wordpress-ubuntu-s-1vcpu-1gb-nyc3-01:~# sudo apachectl -S
VirtualHost configuration:
*:80                   guesthost.tech (/etc/apache2/sites-enabled/000-default.conf:4)
ServerRoot: "/etc/apache2"
Main DocumentRoot: "/var/www/html"
Main ErrorLog: "/var/log/apache2/error.log"
Mutex mpm-accept: using_defaults
Mutex watchdog-callback: using_defaults
Mutex rewrite-map: using_defaults
Mutex default: dir="/var/run/apache2/" mechanism=default
PidFile: "/var/run/apache2/apache2.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
User: name="www-data" id=33
Group: name="www-data" id=33

2 Likes

Now set the Cloudflare SSL option to Off.

2 Likes

It's done What next Sir

2 Likes

What is the output of this command?

sudo cat /etc/apache2/sites-enabled/000-default.conf

3 Likes