Remove public_html from view...

Nexxterra.com

Verified User
Joined
Apr 22, 2006
Messages
208
Location
Miami Beach
When a user has only one domain and they either use file manager or ftp they see public_html, etc.
When the user has 2 or more domains they see all the same folders and files as before in addition to "domains" folder
The problem I am having, is when a user has 2 or more domains, in order to place files and folders in the correct area for the domain they need to click domains, choose the domain, then choose public_html, now they can upload files with the correct resaults... However, most users tend to upload their files to the first public_html folder, which I believe to be the same as if they did as above and chose the original domain for the account.
is there a way to "hide" that first public_html" when the folder "domains" is created??
 
No, you can not!

You may not be clear of what I am referring, but deleting this folder will delete the entire contents of the original domain,
A user starts their account with 1 domain... then they add domain 2,3,4,etc
However, their first experiance with DA was to log in, and right there was public_html, this all worked fine when doing the last site... so why not again?
But, when they do upload to this, they can not see their work and it may have overwritten some files, like index.html etc.
So if from the very begining they had to click on domains folder, domain, public_html... the confusion would never take place.
I do not believe removing this public_html folder is an option as it is the same one you would be viewing when clicking "domains...yourdomain.com...Public_html
 
I was referring to the shortcut under the /home/user/

I was not referring to the actual folder of public_html.

The only way you can make public_html be for one domain is to only have one domain under each user. If you add more then one domain as you have explained above it will create a different path/structure. There can only be one public_html under each user.

I'm sure you could re-structure this yourself, you will just have to make sure and update any paths that are using these locations.

imo if a user is not smart enough to know where he or she is uploading files then they should be paying someone else to do the work for them. The only solution I can think of for a fail safe is one domain per user account.
 
Last edited:
I have the symlink to which you refer deleted automatically every time a domain is added.
 
You may not be clear of what I am referring, but deleting this folder will delete the entire contents of the original domain,
The file at ~/public_html is generally (not always) a link to ~/domains/EXAMPLE.COM/public_html, where EXAMPLE.COM is the default domain for the user (generally the first domain you've created under the user unless you've changed it by clicking on Domain Administration page and selecting a different domain.

If you delete the link you don't do any damage to the target file.

But you will break the ability to use:
Code:
http://123.45.67.89/~username
to see the default domain.

Jeff
 
But you will break the ability to use:
Code:
http://123.45.67.89/~username
to see the default domain.

I also create a new symlink in /var/www/html that points to the real public_html of the domain so that this works:

Code:
http://123.45.67.89/username/example.com

To me this makes more sense.
 
I also create a new symlink in /var/www/html that points to the real public_html of the domain so that this works:

Code:
http://123.45.67.89/username/example.com
To me this makes more sense.

I like that, do you have a script for this that you might want to share or how are you doing this?

It makes much more sense and is something I didn't agree with on DA, but it is what it is.. nice to see you thinking the same.
 
I use perl code since I know it a lot better. In the domain_create_post.sh script:

Code:
#!/usr/bin/perl

$username = $ENV{'username'};
$domain = $ENV{'domain'};

`ln -s /home/$username/domains/$domain/public_html /var/www/html/$domain`;

The end url would actually be:

Code:
http://123.45.67.89/example.com

There are some things that may not work exactly right but most things do.
 
Interesting. And to think that all these years I've been content with the way the OS has set up; I've been doing it the old way for about 14 years now :).

If you use Floyd's script don't forget to make a change to the welcome email sent out to users.

Jeff
 
Interesting. And to think that all these years I've been content with the way the OS has set up; I've been doing it the old way for about 14 years now :).

If you use Floyd's script don't forget to make a change to the welcome email sent out to users.

Jeff

Do you see anything that it may cause issues with? I like it better then the standard format, but I don't want to break anything either that is built into da.
 
Using ~username is great if they only have one domain. I have found that when customers add more than one domain then ~username becomes confusing to them. They do not understand that it refers to their "default" domain. They do not know what that means. The same is true of the public_html symlink. I have had a number of customers ftp in using their domain as the hostname and upload to the symlink public_html and overwrite entire websites because they thought the hostname put them into the right spot. They do not understand that the hostname merly connects them to the server and that they still have to navigate to the correct domain name.

Using the ~username and public_html symlink is great for customers with one domain. But can prove to be perilous to those with more than one domain and who are not really careful about what they are doing.

This not my opinion but a testament to what has already happened, not what could or may happen.
 
Do you see anything that it may cause issues with? I like it better then the standard format, but I don't want to break anything either that is built into da.
The default method has nothing to do with DirectAdmin; it's built into unix and linux (perhaps even into the Posix standard upon which both are based).

I don't see any reason why Floyd's method won't work.

We'd have to ask Floyd if it causes any problems with domain deletion, or user deletion, or you can set up a test domian and try it yourself.

Jeff
 
You have to write the post scripts to delete the symlinks when a user or domain is deleted. The worst is that you end up with a bunch of broken symlinks. You could also write a script that runs every day looking for and deleting broken symlinks.

There may be certain anomalies in the web site you are viewing that I cannot predict but I know I have not had any major problems either.

Actually the best way to view a site before changing public DNS is to change your own hosts file and view the site as normal. Then there are no issues.
 
Hello,

Note, for people with multiple domains, DA does have the built-in ability to setup:

1.2.3.4/~username/domain1.com
1.2.3.4/~username/domain2.com

before the domains resolves.

http://www.directadmin.com/features.php?id=897

It used to be the default for the span of about a week, but as the default, it was confusing to people (for some reason) so we changed it back.
The feature is still there to use if you want, it makes it simple to have multiple domains under the pre-exisiting public_html setup.

If you want:
1.2.3.4/domain.com

then use floyds script.

Just a note though, from what I recall, with the /var/log/httpd/homedir.log, DA manually parses it to grab info from it.. and it bills bandwidth to users if it finds /home/username. Using the /var/www/html/domain.com, DA will not find /home/username, so that setup wouldn't bill users for bandwith. The /home/username/public_html/domain.com version (id=897) does still bill for bandwidth.

John
 
Hello,

Note, for people with multiple domains, DA does have the built-in ability to setup:

1.2.3.4/~username/domain1.com
1.2.3.4/~username/domain2.com

before the domains resolves.

http://www.directadmin.com/features.php?id=897

It used to be the default for the span of about a week, but as the default, it was confusing to people (for some reason) so we changed it back.
The feature is still there to use if you want, it makes it simple to have multiple domains under the pre-exisiting public_html setup.

If you want:
1.2.3.4/domain.com

then use floyds script.

Just a note though, from what I recall, with the /var/log/httpd/homedir.log, DA manually parses it to grab info from it.. and it bills bandwidth to users if it finds /home/username. Using the /var/www/html/domain.com, DA will not find /home/username, so that setup wouldn't bill users for bandwith. The /home/username/public_html/domain.com version (id=897) does still bill for bandwidth.

John

Thank you very much
 
Did this...its great!

Now when someone clicks on Public_html they see their domain name(s) they click on the one they want and they are in the right place to upload files...
All that is needed now is to find a way to hide all the other files they should not play with!!!
 
Thanks...

The weird thing is I found this after I posted in something called the knowledge base???
I guess after 5 years of being a DA user, I guess I can read the instructions...
 
Back
Top