How to make https URLs go to public_html?

Status
Not open for further replies.

SlashChick

Verified User
Joined
Oct 14, 2003
Messages
54
Hello,

We have several users requesting that "https" URLs just go directly to their public_html folder instead of going to a separate folder.

How is this possible with DirectAdmin? I know it's possible because that's how RaQs set it up by default...

Not afraid of editing config files; I just have to know what to edit and make sure that DA won't overwrite it in the future.

Thanks!
 
symlink private_html to public_html.

From the domains' directory:
Code:
mv ./private_html ./private_html_old
ln -s ./public_html ./private_html
 
Hi, I need to make my public_html folder the default, because of a php script that I am using has a licence file which is directory specific. I have also been using the symlink meathode for quite a while but it doesn't work with my script.

So I think the file I need to change is in this path but I'm not 100%. /usr/local/directadmin/conf/directadmin.conf

Thanks for your time and help -Jason
 
Hello,

You can always just use the template system:
Code:
cd /usr/local/directadmin/data/templates
cp virtual_host_secure.conf custom
cd custom
pico virtual_host_secure.conf
Change the private_html to public_html and then just type:
Code:
echo "action=rewrite&value=httpd" >> /usr/local/directadmin/data/task.queue
That will change it for *everyone* without doing any symbolic links.

John
 
Is this correct?
I restarted httpd after the file edit but when I try an hhtps: on my home page I get a forbiden 404 error.

Thanks again for your time and help -Jason


Code:
|?CGI=ScriptAlias /cgi-bin/ `HOME`/domains/`DOMAIN`/public_html/cgi-bin/|
|?DOCROOT=`HOME`/domains/`DOMAIN`/public_html|
<VirtualHost |IP|:443>
|CUSTOM|
        echo "action=rewrite&value=httpd" >> /usr/local/directadmin/data/task.queue
        SSLEngine on
        SSLCertificateFile |CERT|
        SSLCertificateKeyFile |KEY|
        |CAROOT|

        ServerName [url]www.[/url]|DOMAIN|
        ServerAlias [url]www.[/url]|DOMAIN| |DOMAIN|
        ServerAdmin |ADMIN|
        DocumentRoot |DOCROOT|
        |CGI|

        User |USER|
        Group |GROUP|
        CustomLog /var/log/httpd/domains/|DOMAIN|.bytes bytes
        CustomLog /var/log/httpd/domains/|DOMAIN|.log combined
        ErrorLog /var/log/httpd/domains/|DOMAIN|.error.log

        <Directory |DOCROOT|>
                Options +Includes -Indexes
                php_flag engine |PHP|
                #php_admin_value safe_mode 1
        </Directory>
|HANDLERS|
|MIMETYPES|

        #php_admin_value open_basedir |HOME|/:/tmp/:/var/www/:/usr/local/lib/php/:/etc/virtual/

</VirtualHost>
 
Last edited:
Hello,

A 404 means there is no index.html file, try adding an index.html, or index.php etc..

Also, you are supposed to *run* the "echo" command, *not* add it the httpd.conf template :)

John
 
Thanks John,

I made the changes you mentioned and it works now.
My home page is a PHP randomizer script.
SSL Doesn't work with the script but on the pages I need it on it does.

Best Regards - Jason :D
 
Hello,

Just to update this thread (as there was a recent question), there has long since been a simple radiobox to do this for you.
Go to:
User Level -> Domain Setup -> domain.com -> Use a symbolic link from private_html to public_html - allows for same data in http and https

which creates a symbolic link, instead of making any changes to the VirtualHosts.

John
 
Status
Not open for further replies.
Back
Top