disable the ~username method of vewing a website

nicknl

Verified User
Joined
Apr 5, 2013
Messages
5
Hello everyone,

I followed these steps: http://help.directadmin.com/item.php?id=344 to disable the ~username method but it doesn't work.
I did every step exactly, save the files and reboot the server after that.

Does anybody have solution?
My server is running on CentOS 6.4 x64

Kind regards,
Nick
 
The guide you followed is a bit old and for Apache 1.3 or 1.x in any case.
I presume you are running Apache 2.x like most of us? In that case, put a 2 behind the filename like this:
Code:
cd /usr/local/directadmin/data/templates/custom
cp ../ips_virtual_host2.conf .
After that, edit ips_virtual_host2.conf in the custom directory and remove that Alias line or put a # in front of the line.

Don't forget to do the rest what is mentioned in that help section.
 
Thanks for your reaction!
I am running Apache 2.4.4

But if I run your code the system said:
cp: kan status van ‘../ips_virtual_host2.conf’ niet opvragen: Bestand of map bestaat niet

Translation:
The file doesn't exists.
 
Oeps, sorry, my mistake. I was thinking about the virtual_hosts2.conf files changes, without "ips" in front of it. But that was for other changes.
Remove that custom thing you made before.

I myself do it like this, it's easyer, and you can use this for other httpd changes too:
Code:
mkdir -p /usr/local/directadmin/custombuild/custom/ap2/conf/extra
cp /usr/local/directadmin/custombuild/configure/ap2/conf/extra/httpd-vhosts.conf /usr/local/directadmin/custombuild/custom/ap2/conf/extra
After that edit both this httpd-vhosts.conf and the one in your /etc/httpd/conf/extra directory.
Change both lines (both files have this 2 times) in:
Code:
#    AliasMatch ^/~([^/]+)(/.*)* "/home/$1/public_html$2"
so just put a # in front of it, after that, restart httpd.

That should do the trick for you. After that you can use the ap2/conf and ap2/conf/extr for other httpd files you want to make changes to which should also be automatically made after you rebuild the apache configs for some reason.
 
Hi,

Thanks again for your replay.

I did that, but it doesn't work for me again...
 
Removed the custom stuf before doing it?
You also checked after the ./build rewrite_confs that in the /etc/httpd/conf/extra/ the httpd-vhosts.conf indeed contained the changes and restarted httpd after that?
 
Yes I did everything what you said.
On other servers it works, but in this case it doesn't works.
It is so weird :')...
 
Oke I fixed mine by doing ./build rewrite_confs.
However, it's still able to use the userdir on the second ip address of the server which in fact is only used for the nameserver. How can that be fixed?
 
I'm wondering about this as well. I hadn't tested the other IPs. I did a search on AliasMatch in /etc/httpd and /usr/local/directadmin/data/users/ but I didn't find a line which wasn't commented out.
 
Back
Top