PDA

View Full Version : Still can't disable http://ip/~user



hkivan
08-24-2004, 09:58 AM
I have used ssh to connect to the server and type
[ perl -pi -e 's/UserDir public_html/UserDir disabled/' /etc/httpd/conf/httpd.conf ]


but i still can use http://ip/~user/ tp browse the site . :confused:


Does anyone can tell me what can i do in next step ? :(

or .. http://ip/~user/ can count the bandwidth of user now in new version of directadmin ?


I am so confuse in it . :D ...

Thanks all of your help :D

jmstacey
08-24-2004, 07:54 PM
You can disable it by modifying the httpd.conf, but there isn't any reason since DA counts the bandwidth now.
See:
http://www.directadmin.com/features.php?id=392

hkivan
08-25-2004, 09:16 AM
that mean when user download the file from http://ip/~user/
, it still counting their bandwidth ? :D

jmstacey
08-25-2004, 10:57 AM
Yes, since 1.222
If you upgraded from an older version to 1.222 or later you will need to follow the instructions below. If you installed 1.222 or later and haven't used an older version then it should be doing it already :)

Instructions:
1) Disable UserDir by running:

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

2) Setup /~username to be accessed only via your server IP or hostname:
1. edit /etc/httpd/conf/httpd.conf
2. go to the bottom of the file and make the 2 virtualhosts look like this:

##########

LogFormat "%b \"%r\"" homedir
#The default site for the server.
<VirtualHost 192.168.0.2:80>
ServerAdmin webmaster@yourhostname.com
AliasMatch ^/~([^/]+)(/.*)* /home/$1/public_html$2
DocumentRoot /var/www/html
ServerName localhost
ScriptAlias /cgi-bin/ /var/www/cgi-bin/

CustomLog /var/log/httpd/homedir.log homedir
</VirtualHost>

<VirtualHost 192.168.0.2:443>
ServerName localhost
ServerAdmin webmaster@yourhostname.com
AliasMatch ^/~([^/]+)(/.*)* /home/$1/public_html$2
DocumentRoot /var/www/html
ScriptAlias /cgi-bin/ /var/www/cgi-bin/

SSLEngine on
SSLCertificateFile /etc/httpd/conf/ssl.crt/server.crt
SSLCertificateKeyFile /etc/httpd/conf/ssl.key/server.key

CustomLog /var/log/httpd/homedir.log homedir
</VirtualHost>