SSL site, ScriptAlias /cgi-bin/ goes to public_html??

TomJones

Verified User
I've been moving my site to SSL, everything is in the private_html folder and working fine...except for the newsletter manager I had installed in the cgi-bin. I spent an hour or so trying to figure out why everything seemed to be rerouting to my public cgi-bin. I finally took a look in the http.conf for the site and found this in the <VirtualHost: 443>:

ScriptAlias /cgi-bin/ /home/example/domains/example.com/public_html/cgi-bin/

so that's why it was routing back to my public_html cgi-bin folder. I edited virtual_host2_secure.conf (created a custom directory as directed and pasted the four confs in there first), just changed the first line to:

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

Now everything is working as expected with my newsletter. I am posting here because I want to make sure I am not creating problems for myself when I changed this. Why would the SSL config reroute calls to the public cgi-bin?? Also. if there really is no issue with what I did, couldn't I just delete that line all together?

Thanks!
 

DirectAdmin Support

Administrator
Staff member
That should be fine.

I think we had set it that way so long ago, it just never got changed.
Can't really change it now without breaking backwards compatibility for people who've setup their systems this way.

John
 

fcmed

Verified User
Having the same problem here.

I need to the cgi-bin directory under https:// to be in a different location. For example:
/home/admin/domains/somewhere.com/private_html/cgi-bin/

This is so that I can properly test https:// before doing a 301 redirect from normal http://

Can you perhaps provide better instructions on doing this or direct me to help pages for adding this to virtual_host2_secure.conf ? Have no idea how virtual_host2_secure.conf works.

To recap:
I need the cgi-bin directory to be in:
/home/admin/domains/somewhere.com/private_html/cgi-bin/
instead of:
/home/admin/domains/somewhere.com/public_html/cgi-bin/

Thanks
 

zEitEr

Super Moderator
Hello,

For the testing purposes symlinks should work fine. If you don't need to have different set of files for HTTP and HTTPS you might consider using private_html as a symlink for public_html. You can set it in Directadmin at user level.

If using private_html as a symlink for public_html is not an option for you then you can use symlink for cgi-bin only.

No need to modify templates in this case. If you create symlinks in a shell then take care of its ownership, its critically important.
 

SeLLeRoNe

Super Moderator
I thiink a template change would be better, because it makes sense now that SSL become almost a requirement (at least for Chrome apparently) to have things in order, i would have gone crazy if i had to use something on cgi-bin over HTTPS because for sure i was going to use private_html as i always do.

It may be possible that no one ever used cgi-bin in https so far..

Best regards
 
Top