Still can't disable http://ip/~user

hkivan

Verified User
Joined
Jul 2, 2004
Messages
83
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
 
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 [email protected]
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 [email protected]
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>
 
Back
Top