An issue with IP/~users bandwidth

perl -pi -e 's/UserDir public_html/UserDir disabled/' /etc/httpd/conf/httpd.conf


adjusts only the current httpd.conf to this?:
<IfModule mod_userdir.c>
UserDir disabled
</IfModule>

and, how can i check the bandwidth is getting counted?
that there are entries in homedir.log?
 
Last edited:
yes, i know, but if there are entries like this: - "GET /~peugeotgti/forum/images/smiles/icon_confused.gif HTTP/1.1"
i can be sure its working?
 
Hello,

The format is: %b "%r"

So you should end up with entries like this:
39716 "GET /~john/photography/cheese.jpg HTTP/1.1"

where 39716 is the bytes transferred and between the quotes is the actual request (the ~user bit is the only important part).

Phi1.
 
I have tried several ways
- # LoadModule, AddModule mod_userdir
- or enable LoadModule, AddModule, but have
<IfModule mod_userdir.c>
UserDir disabled
</IfModule>

but I still can access http://IP/~username. Is there any other way to disable this? In my cPanel box, I just unload mod_userdir, and no more access through IP.

thanks,
 
gate2vn said:
I have tried several ways
- # LoadModule, AddModule mod_userdir
- or enable LoadModule, AddModule, but have
<IfModule mod_userdir.c>
UserDir disabled
</IfModule>

but I still can access http://IP/~username. Is there any other way to disable this? In my cPanel box, I just unload mod_userdir, and no more access through IP.

thanks,

Yep I have tried all this to, and no way it works as da just does not seem to do anything with whatever you put in that part of apache !! and you are correct it works fine in WHM .
Wish I could turn this feature off as its a pain to keep searching for the sites that are taking the Micky in a crafty way.

Anyone got a fix for this problem ???

Les
 
Try to comment out the occurences of following string in your httpd.conf:
Code:
AliasMatch ^/~([^/]+)(/.*)* /home/$1/public_html$2
 
ClayRabbit said:
Try to comment out the occurences of following string in your httpd.conf:
Code:
AliasMatch ^/~([^/]+)(/.*)* /home/$1/public_html$2
I Did
#AliasMatch ^/~([^/]+)(/.*)* /home/$1/public_html$2
or should i have just taken th /~ out of that line ??

Thanks for that it did work on DA, I did comment them out on the 80 and 443 port but does this cause any other problems for ssl etc by doing this hack.

Many thanks for you input into this matter.:)
Regards

Les
 
Last edited:
Hmm has anyone brought this to john's attention, I mean is this an actual outstanding bug?

--edit--

ok caught up now, so I have this.

ip/~userdir works but is logging in /var/log/httpd/userdir.log

www.somedomain.com/~userdir fails which is good :)

so I guess I am all good?
 
Last edited:
rogerdavis said:
I Did
#AliasMatch ^/~([^/]+)(/.*)* /home/$1/public_html$2
or should i have just taken th /~ out of that line ??

Thanks for that it did work on DA, I did comment them out on the 80 and 443 port but does this cause any other problems for ssl etc by doing this hack.

Many thanks for you input into this matter.:)
Regards

Les
I have noticed that its not login the data and bandwidth anymore so I am going to edit out the
/~ in that line to see if that fixes it and stops access to /~ but puts the login back on has anyone tried this.

Les
 
Chrysalis said:
Hmm has anyone brought this to john's attention, I mean is this an actual outstanding bug?

--edit--

ok caught up now, so I have this.

ip/~userdir works but is logging in /var/log/httpd/userdir.log

www.somedomain.com/~userdir fails which is good :)

so I guess I am all good?
Ok If you Take the ~ out this stops the the ip/~username and it will still log bandwidth ok But they can still access by ip/username !!

but if you delite /~ in that line in apache it works as you want it to but does not log bandwidth !! so DA must be pulling data from the / part off the web and not internally on the server so has anyone played with anything else.

Regards

Les
 
rogerdavis said:
Ok If you Take the ~ out this stops the the ip/~username and it will still log bandwidth ok But they can still access by ip/username !!

but if you delite /~ in that line in apache it works as you want it to but does not log bandwidth !! so DA must be pulling data from the / part off the web and not internally on the server so has anyone played with anything else.

Regards

Les

Thats not the case here, if ~ is removed it would treat username as a subdir the ~ is needed to access files owned by user. And in my case it is logging this access and probably counting the traffic.

The domain/~username doesnt work so is disabled. so I dont see any problem why are people worried?
 
xcensus said:
Hows about a time delay feature of say 48 hrs, you create a new account and they get 48hrs of http://ip/~accountname to use that feature before it gets automatically removed.
Great idea but anyone can do that?
If anybody can plz post it here, thanks
 
Sure, rewrite linux :) .

Actually there's a setting you can make in your user-specific httpd.conf file, but the problem is that it gets rewritten from time to time.

The admin user can add it as custom code.

However don't forget that there are reasons why someone might need to use ~username after 48 hours; for example if s/he forgets to renew a domain name.

Or while moving to a new server.

Jeff
 
the /home/username/public_html symbolc link is a magic key to making /~username work .. if you delete it, then ~username will stop working. However DA will occasionaly (based on user actions, suspensions, or domain creations, etc) recreate the public_html link... so deleting it would require some persistence in keeping it gone. (you would have to setup a cronjob to run every 5 minutes or so to make sure any "old" users don't have a public_html symbolic link)... it's a bit of a hack, but might work.

John
 
John,

I was thinking about the apache configuration that automatically allows ~username to look in a user's directory for public_html.

I wasn't even thinking of removing it; of course we can do that; because we don't use it in httpd.conf to point to the html directory.

:)

Jeff
 
Heya Guys,

I am reading into this and I have a request of a user to be able to serve images based from an ip instead of a domain.

Now I'm looking into it by using:
http://IP/~username/

The strange thing however is I keep getting 404 errors.
I looked into both httpd.conf and ips.conf and both have this line within the virtualHost:

AliasMatch ^/~([^/]+)(/.*)* /home/$1/public_html$2

Shouldn't that just redirect to the correct public_html?

I'm kinda stuck, so any insights into this would be very appriciated!

Regards,
Armand
 
Hello,

That will redirect to:
/home/username/public_html

so it depends on where your username/public_html is linked to.
It may be linked to another domain in your account.

So set which one it's linked to, go to:
User Level -> Domain Setup -> check the domain and click "set as default".

John
 
John:

I got a redirect to the correct directory.

lrwxrwxrwx 1 domaincom32 2007-04-04 19:50 public_html -> ./domains/domain.com/public_html
virtual1:/home/domaincom#

I however did what you told me to:

Your default domain has been set
Details
domain.com is now your default domain.
/~domaincom will now point to domain.com

However I get a 400 error (when not ending with trailing slash) and 404 when adding one.
 
Last edited:
Back
Top