Separate private_html folder

Hello Dixie,
This is easy enough to do permanently yourself. I did it yesterday.

Sorry I forgot that you did not have ssh access. You will need to ask your host.

Step 1 from SSH:

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 save and exit

Step 2 from SSH:
code:echo "action=rewrite&value=httpd" >> /usr/local/directadmin/data/task.queue

(This removes any existing private_html folders)

Step 3 from SSH:

cd /usr/local/directadmin/scripts/custom/

pico domain_create_post.sh

paste the following code in:

####################################
#!/bin/sh
#
# domain_create_post.sh - Runs AFTER a domain is created
#
# Remove private_html folder from user/domain directory.
#
rm -R -f /home/${username}/domains/${domain}/private_html
#####################################

save and exit.

chmod 700 domain_create_post.sh

Done.

test an account.

I guess there are other ways to do this as well, but this works well and DA will not overwrite this. Maybe this could be made into a tutorial since many people want to do this. John said he will coonsider making this a user level option. I guess it is easy enough for DA to do, but I don't see it as necessary.
 
Last edited:
fusionictnl

I definitely see your points hence why I started the thread. But I don't know of any shopping cart software that I have used, that does not use ssl in checkout. Also no payment gateway I know of will accept a connection from a non ssl socket.

However, I can see where it is useful. That being said, in 7 years I have never had anyone ask me for a seperate directory for https docs. I only get asked what it is and why it is there(symlink) It might be a nice option for users when they turn on ssl for their domain in the cp and certainly easy for DA to implement.
 
If you want it setup that way. It's easy to correct this:

change: /usr/local/directadmin/data/templates/virtual_host_secure.conf


and change:

|?DOCROOT=`HOME`/domains/`DOMAIN`/private_html|

|?DOCROOT=`HOME`/domains/`DOMAIN`/public_html|

and do a rewrite tally ;)
 
Thanks. Yes I already did this and setup a script to remove the private_html dir at setup.
 
rldev said:
Hello Dixie,
Step 2 from SSH:
code:echo "action=rewrite&value=httpd" >> /usr/local/directadmin/data/task.queue

(This removes any existing private_html folders)

I don't think it will. I think it will just change the httpd.conf files so sites won't use them.

However it will probably break every secure site on the server that uses the secure directory the way it's meant to be used. If it really does delete those directories it could cause the irretrievable loss of data you're responsible for.

I'd be reallly carefuly before doing this.

Jeff
 
well I might do this on my new server which is empty, and my current server after informing my users and allowing them time to adjust. If I had a server with 100s of user's I would probably leave it as it is.
 
Yes I did this on a new server. I certainly would not do this on a production server with many customers.
 
symlink problem with SSL

My current host requires that all securce pages be placed in a seperate private folder. This requires two sets of files to be maintained for an oscomerce site but things worked OK.
I requested that they symlink the private to the public folder so that I might be able to maintain one set of files in public_html which they have done.
Now when I try to connect to a secure page such as the "account page" I get the following error:


"You don't have permission to access /account.php on this server.

Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request."



As long as "Enable SSL" is set to false in my oscommerce config file the site works fine but no lock icon on the secure pages.

I have a geotrust SSL cert...does it also need to be reconfigured or is this a scripting problem in my code?

Any help is appreciated.
 
SSL certificate -- I don't WANT to use the private_html folder

This is not normal practice with SSL certificates. You install a certificate, everything on your site is encrypted, it shouldn't have to reside in a separate folder.

My ssl is installed, but I want it to point to public_html because I am not going to have two copies of my freaking site installed, one for secure and one for not -- that's stupid.
 
jmstacey said:
You must have ssh access to follow these instructions. I do not think a link can be created through the DA Filemanager. It might be possible through ftp but I haven't tried it.

1. Login to your server via ssh
2. CD into your domains directory. (e.g. cd domains/yourdomain.com )
3. Remove you private_html directory rm -rf private_html (Careful)
4. Create the link using something like this
Code:
ln -sf /home/username/domains/yourdomain.com/private_html /home/username/domains/yourdomain.com/public_html

I just did this, logged in as root and it creates no link whatsoever.
 
It's January now. It obviously wasn't an oversight, cause it's still the same way.

I feel DA is a good product, but it breaks from a lot of the industry norms for no real reason.
 
Last edited:
Phhht. This is so screwed up. THIS is why the demo on DA's website is so misleading. It looks all nice and feature-rich, but actually using it for me has been a nightmare.
 
Good luck. I'm having the same problems. No other control panel I know of requires a public and a private html folder, requiring the maintainenace of TWO copies of the site. STUPID STUPID STUPID.
 
symlink problem

I had my host admin do the symlink for me and all unsecure files are fine in an oscommerce site. But now I am having problems with getting the SSL secure pages to work.
Not so sure this is a good fix...probably best to move to a server with no private folder eh?
 
Re: SSL certificate -- I don't WANT to use the private_html folder

knoxhosting said:
This is not normal practice with SSL certificates. You install a certificate, everything on your site is encrypted, it shouldn't have to reside in a separate folder.

What happens if you only want to encrypt some of your website and not all of it?

There are also instructions on how to change the default in other threads of this forum. If you need to know how, give the search function a try ;)
 
What exactly is your nightmare? Most cps have a seperate https folder. DA provides many methods to change this and all are fairly simple if you have root access. Maybe there is something we can help you with.
 
I finally got this to work, but it was the other way around...

ln -s public_html private_html
 
Is there any way to set this link to be there when I create new accounts instead of the directory?
 
Instead of the softlink, you could have changed the httpd.conf file associated with that domain. To use the public_html directory for all new accounts, you would need to copy the file /usr/local/directadmin/data/templates/virtual_host_secure.conf
to the custom directory and edit the DOCROOT line to read public_html instead of private_html. Also do the same for the virtual_host_secure_sub.html file.
 
I've been tempted to merge this thread with those that have come before it on the same subject.

But then you'd more easily find out how to do the link automatically, because it's been discussed.

Search the forum and all shall be made apparent.

:)

Jeff
 
Back
Top