Solved SSL won't take me to private_html no matter what I do - What am I missing?

cmyden

Verified User
Joined
Oct 8, 2020
Messages
60
1. I created a new domain

2. 'Use a directory named private_html' is selected

3. httpd.conf shows:

<VirtualHost ipaddress:443 >
SSLEngine on
SSLCertificateFile /usr/local/directadmin/data/users/admin/domains/domain.com.cert.combined
SSLCertificateKeyFile /usr/local/directadmin/data/users/admin/domains/domain.com.key
ServerName www.domain.com
ServerAlias www.domain.com domain.com
ServerAdmin [email protected]
DocumentRoot /home/admin/domains/domain.com/private_html

- But whenever I access my site using https, it points to my public_html directory (easy to test)

- I'm someone that wants to keep their public_html and private_html directories separate.

I've done this a million times before, although not in a long time, and DirectAdmin has updated itself many times since.

Am I missing something obvious that I forgot about?
 
Hello,

Just to be sure, is /home/admin/domains/domain.com/private_html a folder or a symlink? You might check it in SSH, file manager or FTP.
 
Thanks for the reply. It's definitely a directory not a symlink.

It's so strange, I have 12 other domains on this DirectAdmin install (all of which were created a long time ago). They all have no problems.

But with this new domain I created yesterday my https:// continues to point to my public_html directory. It's easy to tell because a) my private_html directory is empty and b) when viewing the domain from https://domain.com it shows the default index.html placeholder file that is in public_html

Clipboard01.jpg
 
just check your document_root at /usr/local/directadmin/data/USERNAME/nginx(httpd).conf
 
just check your document_root at /usr/local/directadmin/data/USERNAME/nginx(httpd).conf

Thank you for the suggestion. I don't seem to have a .conf file with that name.

# /usr/local/directadmin/data]
# sudo find . -print | grep -i '.*[.]conf'

I have:

./users/USER/domains/domain.com.conf
./users/USER/crontab.conf
./users/USER/ticket.conf
./users/USER/reseller.conf
./users/USER/php/php-fpm54.conf
./users/USER/php/php-fpm54.conf.custom1
./users/USER/php/php-fpm54.conf.custom2
./users/USER/php/php-fpm74.conf
./users/USER/user.conf
./users/USER/httpd.conf


I have compared my SSL entries in ./users/USER/httpd.conf


The 12 old domains without the issue:

DocumentRoot /home/admin/domains/domain.com/private_html

<Directory /home/admin/domains/domain.com/private_html>
<FilesMatch "\.(inc|php|phtml|phps|php54)$">
<If "-f %{REQUEST_FILENAME}">
#ProxyErrorOverride on
AddHandler "proxy:unix:/usr/local/php54/sockets/admin.sock|fcgi://localhost" .inc .php .phtml .php54
</If>
</FilesMatch>
</Directory>


The 1 newly created domain with the issue:

DocumentRoot /home/admin/domains/domain.com/private_html

<Directory /home/admin/domains/domain.com/private_html>
AllowOverride AuthConfig FileInfo Indexes Limit Options=Indexes,IncludesNOEXEC,MultiViews,SymLinksIfOwnerMatch,FollowSymlinks,None
Options -ExecCGI -Includes +IncludesNOEXEC

<FilesMatch "\.(inc|php|phtml|phps|php74)$">
<If "-f %{REQUEST_FILENAME}">
#ProxyErrorOverride on
AddHandler "proxy:unix:/usr/local/php74/sockets/admin.sock|fcgi://localhost" .inc .php .phtml .php74
</If>
</FilesMatch>
</Directory>


- Backing up httpd.conf I deleted the 2 extra lines in bold (the second one just relates to having selected CGI access I believe)

- Restarted httpd. Still didn't fix it.
 
check also maybe there another confs or customizations.

Thank you, I'm currently running a search...

/usr/local/directadmin]# grep -rnw '/usr/local/directadmin' -e '/home/admin/domains/domain.com/public_html' -r

Taking a while :)

Edit: /usr/local/directadmin/data/users/USER/httpd.conf is the only file with a reference to public_html
 
Last edited:
but in your example Private_html

It is displaying my public_html directory when I call up my domain from https:// - so I figured if anything were misconfigured it would be pointing to public_html.

But /usr/local/directadmin/data/users/USER/httpd.conf is the only file I can see with a reference to the public_html directory for this domain.
 
You might check under /etc/httpd/ too, as well as run:

Code:
apachectl -S 2>&1 | grep domain.com

replace domain.com with your real domain name, without www.

Thank you,

The result of the command for the domain that isn't working:

port 80 namevhost www.notworking.com (/usr/local/directadmin/data/users/admin/httpd.conf:91)
alias www.notworking.com
alias notworking.com
port 443 namevhost www.notworking.com (/usr/local/directadmin/data/users/admin/httpd.conf:121)
alias www.notworking.com
alias notworking.com

The result of the command for one of the 12 domains that is working:

port 80 namevhost www.working.com (/usr/local/directadmin/data/users/admin/httpd.conf:724)
alias www.working.com
alias working.com
port 443 namevhost www.working.com (/usr/local/directadmin/data/users/admin/httpd.conf:755)
alias www.working.com
alias working.com


Under /etc/httpd/ I have:

extra httpd.conf httpd.conf.bak ips.conf magic mime.types original ssl.crt ssl.key

- The only reference to public_html contained in any files in this directory is in the following file:

/etc/httpd/conf/original/extra/httpd-userdir.conf

# Settings for user home directories
#
# Required module: mod_authz_core, mod_authz_host, mod_userdir

#
# UserDir: The name of the directory that is appended onto a user's home
# directory if a ~user request is received. Note that you must also set
# the default access control for these directories, as in the example below.
#
UserDir public_html

#
# Control access to UserDir directories. The following is an example
# for a site where these directories are restricted to read-only.
#
<Directory "/home/*/public_html">
AllowOverride FileInfo AuthConfig Limit Indexes
Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
Require method GET POST OPTIONS
</Directory>
 
It doesn't really help but I ran the following and I see no difference between the domains that are working, and this newly created domain that is not.

IPADDRESS:2222/CMD_API_DOMAIN?action=document%5Froot%5Fall&json=yes&redirect=yes

"users":
{
"admin":
{
"domains":
{
"notworking.com":
{
"private_html": "/home/admin/domains/notworking.com/private_html",
"public_html": "/home/admin/domains/notworking.com/public_html",
"subdomains":
{
}
},
"working.com":
{
"private_html": "/home/admin/domains/working.com/private_html",
"public_html": "/home/admin/domains/working.com/public_html",
"subdomains":
{
 
Resolving to the same IPs? No CloudFlare is used?

I am using CloudFlare. I did set up this domain in Cloudflare the same way as my previous domains but I am starting to wonder if something is different between:

a) my Cloudflare DNS settings
or
b) my DirectAdmin DNS records.

I'm going to compare the records of the working domains versus the new one.
 
Resolving to the same IPs? No CloudFlare is used?

SOLVED: The issue was that in CloudFlare under SSL/TTS the encryption mode needs to be changed to Full (strict). I forgot that all my other domains had this setting. As soon as I changed it, boom, my https requests were pointing to the private_html directory.

Thanks everyone!
 
Back
Top