SSL -> public_html

DA_user

Verified User
Joined
Oct 26, 2004
Messages
32
Is there an easy way to make https://www.domain.com point to, or use the same folder as http?
 
Or you could just modify the template to put all of the SSL into public_html that way you don't have to add a link all the time.

/usr/local/directadmin/data/templates/custom/virtual_host_secure.conf

replace private_html with public_html

Big Wil
 
I can't get it to work!
I have created a link:
ln -s public_html private_html

So now the folder looks like this:
[root@server --hidden--.com]# ls -l
total 20
drwxr-xr-x 2 --hidden-- --hidden-- 4096 Jan 26 00:10 logs
lrwxrwxrwx 1 --hidden-- --hidden-- 11 Jan 30 17:38 private_html -> public_html
drwxr-x--- 2 --hidden-- --hidden-- 4096 Jan 25 19:44 private_html2
drwx--x--x 3 --hidden-- --hidden-- 4096 Jan 25 19:44 public_ftp
drwxr-x--- 7 --hidden-- --hidden-- 4096 Jan 30 14:59 public_html
drwxr-xr-x 2 --hidden-- --hidden-- 4096 Jan 26 00:10 stats
But when I try to access https://www.domain.com it shows the apache page, the same as I get when I enter the IP.
 
If you are doing the initial setup of DA and want to do away with the private_html folder for your users and have the SSL use the public_html folder then forget the symlinks. If you already have users using the private_html folder then a little more preparation is necessary. But on a fresh install do this:

Copy the templates /usr/local/directadmin/data/templates/*secure* to /usr/local/directadmin/data/templates/custom/

Open up /usr/local/directadmin/data/templates/custom/*secure*
and replace the first two lines with these

|?CGI=ScriptAlias /cgi-bin/ `HOME`/domains/`DOMAIN`/public_html/cgi-bin/|
|?DOCROOT=`HOME`/domains/`DOMAIN`/public_html|

Then your SSL virtual hosts will be created to use public_html and not private_html.

Then if you want to do away with the private_html directory completely in the name of good housekeeping then create this file.

/usr/local/directadmin/scripts/custom/domain_create_post.sh

with this content

#!/bin/sh

PRIVATEFOLDER=/usr/home/${username}/domains/${domain}/private_html
rm -Rf $PRIVATEFOLDER

exit 0

Chmod the domain_create_post.sh file 750 so it can execute.

This shouldn't be OS specific but just for history we run FreeBSD 4.10. If you notice your home directory is in a different place then modify as needed.

Create a new user and test their SSL. You will see that it uses the public_html folder and that private_html is no longer created for the domain.

Big Wil
 
Last edited:
Back
Top