An issue with IP/~users bandwidth

Any information about this? It's a good idea to parse 1 file and add that to the bandwith and disk usage. I'm still noticing users using ~username on my server.

thanks

Robert
 
A solution I thought up a while back involves making things neater allowing a simple solution to this problem.

Instaed of:

http://host.name.com/~username/

why not have

username.host.name.com ?

A subdomain looks neater like that and would allow a much easier solution for directadmin to put the bandwidth on an account.. since its setup as a vhost :)

Chris
 
ooo.. nifty :) Just have to add "* A 1.2.3.4" to the dns record for the hostname, but then you'd be good to go.

John
 
And then what? The bandwith would still be charged against host.name.com and that's exactly what we're trying to avoid.

The idea of strictly using the server's ip / hostname and then parsing that log file to check for the username would still be best imho. This way the user can fully take advantage of having the server's ip/hostname ~ feature (or the vhost, whichever you prefer) but no matter what it would be charged against his bandwith. I couldn't care less if he was doing it that way or using his own domain, whereas now I do care since I keep on noticing users which prefer to have big image files loaded via ~ and therefor reducing bandwith.

btw, you'd not only have to add that A record, you'd have to create the vhost in the user's httpd.conf as well right?
 
Last edited:
S2S-Robert said:
And then what? The bandwith would still be charged against host.name.com and that's exactly what we're trying to avoid.

Read my message again.

Putting it as a subdomain allows it done be done a vhost, and therefore bandwidth tracking can be done 100% externally to any other account.

It would basically act as a full account although not be shown in the panel, have anything to do with the panel or be shown seperately in the panel. The quotas for the 'domain' (the subdomain) With DA hard coded modifications basically allows DirectAdmin to add domain1.com and subdomain.com quotas together and display that as a total for domain.com

Its a simple solution that fixes the whole problem and looks better than the current preview system in my opinion.

Chris
 
ah ok, so this would mean disabling of the ~, just parsing all the available log files for the subdomain.host.name.com vhosts and then adding the found bandwith to the account which is similar to the parsed vhost.

Neat :D
 
How about creating a default index.php file in the ~/ subdirectory redirecting to the subdomain?

This way customers won't be looking for it :)
 
UltimeWWW said:
How about creating a default index.php file in the ~/ subdirectory redirecting to the subdomain?

This way customers won't be looking for it :)

The easiest way without using bandwidth - or minimal bandwidth would be a redirect line in the main domains httpd.conf which would do this...... then you save space bandwidth and it will increase the redirect speed to instant (or very very close) :)

Chris
 
Sorry, havn't touched that one. If you need it badly, you could just setup a script to do it with the /usr/local/directadmin/scripts/custom/domain_create_post.sh script, where it creates a virtualhost for you as a subdomain on your own domain.. ie: http://newdomain.com.yourdomain.com and set the Document root to their domain (/home/user/domains/domain.com/public_html), and also set the "bytes" log to /var/log/httpd/domains/domain.com.bytes so that they get the bill. Then just disabled user_dir (~username).

John
 
Im in the middle of an easy directadmin (redhat) system config / setup / installer script for basically everything! will consider including that :)

Chris
 
Why we need to add VirtualHost ?
I think more simplier it's just to add " |DOMAIN|.host.name.com" to ServerAlias line in custom virtual_host.conf, so it will looks like
Code:
ServerAlias www.|DOMAIN| |DOMAIN| |DOMAIN|.host.name.com

So, for any newly created domain we'll have a subdomain that already resolved to server IP (cos we added *.host.name.com pointed to server's shared IP in DNS) and it's ready to use!

Am I right? :)

But I don't like that "subdomain solution" anyway. I prefer to enable UserDir only on main server's IP and parse main access.log file once a week.
 
Last edited:
Hello,

All I'd need to do is add the hostname into a token as |HOSTNAME| and we could throw that token into the templates ..

The only question, is how to add the subdomain in a nice and generic fashion. Yes, * will work if they're all on the same IP, but what happens when the IP is shared on another IP.. or owned (Actuallly for owned, they just go the the IP).

Anyway, I'll add the HOSTNAME token anyway, (wont' touch the templates) .. no decision yet, but that is a good idea :)

John
 
I would really love to see this feature implemented since I keep having users who use ~ to either deliberately bypass bandwith or just don't know it.
 
Hello,

Well, how bout I throw out a solution and you guys can chew on it for a while before anything is actually done:

1) implement the "subfulldomain" hosting ;) (domain.com.hostnam.com)
2) disable userdir on user domains
3) ? leave ~username on the server IP and parse the logs?

So.. all of 1,2 and 3 would be implemented. Now for 3).. we could almost get rid of ~username completely, as long as we could rely on the "subfulldomain" thing working.. (is that a reasonable definition for it? ;))

John
 
I actually like the way hostname/~user looks. Don't know. I guess for thing for me is to disable ~user everywhere except for on my hostname and then parse its log.
 
DirectAdmin Support said:
Hello,

You can just disable the ~username feature in apache. Just comment out the following lines:
Code:
<IfModule mod_userdir.c>
    UserDir public_html
</IfModule>
There isn't a whole lot that can be done (that I know of) to charge bandwith to a user from ~user. (If someone knows, let me know! :))

John

i just did this:

AddHandler cgi-script .cgi .pl
#<IfModule mod_userdir.c>
# UserDir public_html
#</IfModule>

restarted apache, but i can still access ip/~username
 
Hello,

You need to have
Code:
UserDir disabled
in there.. otherwise I think it defaults to on or something :)

Phi1.
 
Back
Top