Setting up AutoSSL get 404 error

Uneschewed

Member
May 13, 2019
16
0
1
Missouri
cPanel Access Level
Root Administrator
Hello,

I have created the file in my cPanel in the public_html called THE_TEXT_FILE.txt, but I get a 404 error when running
Code:
curl --user-agent "COMODO DCV" --insecure --max-time 10 --retry 0 http://mydomain.com/THE_TEXT_FILE.txt
from the cli

What do I set so that Comodo and Let's Encrypt can access the file THE_TEXT_FILE.txt.
 

Uneschewed

Member
May 13, 2019
16
0
1
Missouri
cPanel Access Level
Root Administrator
I still get 404 I have DCV passthrough enabled.

Do I need to whitelist the ip addresses for comodo and letsencrypt? If so, what are the ip addresses?
 
Last edited by a moderator:

Uneschewed

Member
May 13, 2019
16
0
1
Missouri
cPanel Access Level
Root Administrator
Just to be sure, did you create the file with the ownership of the account or as root?

If you're getting a 404 on the text file manually, you'll definitely continue to get it with AutoSSL

Do you have anything in the .htaccess file for that domain?
I created the file using cPanel File Manager as my account. I have an .htaccess but it worked for AutoSSL before.
 

Uneschewed

Member
May 13, 2019
16
0
1
Missouri
cPanel Access Level
Root Administrator
I'm looking for what specifically is in the .htaccess file here. In some cases a plugin could have added entries or there could be something causing the txt file not to be able to be read.
I have the following information in the mod rewrite:

Code:
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
# Disable Apache MultiViews since it
# may conflict with the GUI installer
Options -Indexes -MultiViews
</IfModule>
RewriteEngine On
# BEGIN Redirect to https / SSL
#RewriteCond %{HTTPS} !on
#RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

#RewriteCond %{HTTPS} off
#RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
# END Redirect to https / SSL
# Redirect Trailing Slashes If Not A Folder...
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller... redirect directroy or folder that does not exist to index
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

# Redirect subdomains that dont exist

# Set rediret for addon domain subdomain in cPanel Redirects
# Set redirect for addon domain subdomain folder
Redirect 301 /example1.com https://www.example.com/index.php
Redirect 301 /example.org https://www.example.com/index.php
Redirect 301 /example.church https://www.example.com/index.php
Redirect 301 /example2.com https://www.example.com/index.php
Redirect 301 /example.tube https://www.example.com/index.php

# Set redirect
RewriteCond %{HTTP_HOST} ^(.+)\.example\.com$ [NC]
RewriteRule ^ https://example.com/ [L,R]
RewriteCond %{HTTP_HOST} ^(.+)\.example\.com$ [NC]
RewriteRule ^ https://example.com/ [L,R]
RewriteCond %{HTTP_HOST} ^(.+)\.example\.org$ [NC]
RewriteRule ^ https://example.org/ [L,R]
RewriteCond %{HTTP_HOST} ^(.+)\.example\.gold$ [NC]
RewriteRule ^ https://example.gold/ [L,R]
RewriteCond %{HTTP_HOST} ^(.+)\.example\.church$ [NC]
RewriteRule ^ https://example.church/ [L,R]
RewriteCond %{HTTP_HOST} ^(.+)\.example\.com$ [NC]
RewriteRule ^ https://example.com/ [L,R]
RewriteCond %{HTTP_HOST} ^(.+)\.example\.tube$ [NC]
RewriteRule ^ https://example.tube/ [L,R]

# Redirect ONLY FOR MAIN DOMAIN example.com
RewriteCond %{HTTP_HOST} ^[^.]+\.(example\.com)$ [NC]
RewriteRule ^ http://%1%{REQUEST_URI} [R=301,L,NE]

# Use WebP
# Does browser explicitly support webp?
RewriteCond %{HTTP_USER_AGENT} Chrome [OR]
# OR Is request from Page Speed
RewriteCond %{HTTP_USER_AGENT} "Google Page Speed Insights" [OR]
# OR does this browser explicitly support webp
RewriteCond %{HTTP_ACCEPT} image/webp [OR]
# AND does a webp image exists?
RewriteCond %{DOCUMENT_ROOT}/$1\.webp -f
# THEN send the webp image and set the env var webp
RewriteRule (.+)\.(?:jpeg|png)$ $1.webp [NC,T=image/webp,E=webp,L]
# If REDIRECT_webp env var exists, append Accept to the Vary header
Header append Vary Accept env=REDIRECT_webp

</IfModule>
Mod note, post edited. Please review:
Guide To Opening An Effective Forums Thread
 
Last edited by a moderator:

Uneschewed

Member
May 13, 2019
16
0
1
Missouri
cPanel Access Level
Root Administrator
May we continue the estimate Houston? I would like to setup my domains, as part of the problem I am having is that my main domain is redirecting to the following:

mydomain.com/cgi-sys/defaultwebpage.cgi
 

Uneschewed

Member
May 13, 2019
16
0
1
Missouri
cPanel Access Level
Root Administrator
I also just set up the server.

My configuration is as follows:

Code:
/etc/redhat-release:CentOS Linux release 7.6.1810 (Core)
/usr/local/cpanel/version:11.78.0.24
/var/cpanel/envtype:xen hvm
CPANEL=release
 

Uneschewed

Member
May 13, 2019
16
0
1
Missouri
cPanel Access Level
Root Administrator
I have already ran the following commands:

Code:
sudo /scripts/install_lets_encrypt_autossl_provider
sudo /scripts/rebuildhttpdconf
sudo service httpd restart
What is the next step to make AutoSSL work with Comodo and LetsEncypt and make the domain no longer redirect to mydomain.com/cgi-sys/defaultwebpage.cgi and fix the 404 error for the text file stored at my root public_html folder when using the following command at Linux CLI?

Code:
curl --user-agent "COMODO DCV" --insecure --max-time 10 --retry 0 http://mydomain.com/THE_TEXT_FILE.txt
 

Uneschewed

Member
May 13, 2019
16
0
1
Missouri
cPanel Access Level
Root Administrator
I deleted the .htaccess file and ran the AutoSSL in cPanel, then I tried clearing browser cache and then ran AutoSSL again. The result is that the txt file I created in the root of the public_html directory shows a 404 on browser, 404 in curl on Linux CLI, and the temporary file AutoSSL tries to create also shows a 404 which is displayed in cPanel SSL/TLS Status.