Web Hosting Talk







View Full Version : deleting multiple virtualhosts from httpd.conf


hostchamp
08-14-2002, 04:49 AM
I am running apache-1.3.22-5.7.1 on RH7.2, over the years i have accumulated hundreds of Virtual Host block in my httpd.conf and the domains are no more hosted with us. I want to remove the virtaull host blocks to clean up the httpd.conf, doing this manually would take long as there are hundreds of virtual hosts. I am sure there must be some script shell/cgi/php which can accomplish this task.

Also, most importantly i host mutiple domains in one folder, so is there any way the script would take the document root from me, say "/home/web/viv" and delete all the virtual hosts blocks which are hosted with document root /home/web/viv, for eg. /home/web/viv/domain1.com, /home/web/viv/domain2.com and so on?

I would not mind specifying each domain name one-by-oen, it's just that it would take a lot of time to delete hundreds of names whereas specifying a document root and deleting all subsequent domains hosted inside it would be that much faster. I would prefer a script which could run from shell.

FYI my virtual host block is 9lines, i.e. from <virtualhost> to </virtualhost> it is 9 lines in total if that helps.

All you hosting wizards pls jump in to help :D

ntwaddel
08-14-2002, 12:46 PM
ctrl-k in pico?:D

hostchamp
08-15-2002, 09:50 AM
What would that do?

elevation
08-15-2002, 12:00 PM
Ctrl+k deletes one whole line at a time. Try it :) It's a lot faster.

genocidal
08-15-2002, 12:34 PM
Originally posted by ntwaddel
ctrl-k in pico?:D

Your telling me that your a unix web hosting service and you don't know how to use pico? Could you refresh our memory on why we would want to get hosted by you again?

I'm not trying to be mean, but I find it very funny that you took the time to write that whole message and think about the process of script style deleting all these old virtual hosts instead of just going through and deleting them from the beginning.
BTW, I could write a php script to do that :)

-Chris

chirpy
08-15-2002, 05:32 PM
Or if you have a shell phobia, you could always use Webmin and <click> <click> <click> and it's gone ;)

Since what you seem to be after is a someone to write you a kind of automated script, maybe you should post this in the Job Offers and Requests forum :)

ntwaddel
08-15-2002, 08:50 PM
Originally posted by genocidal


Your telling me that your a unix web hosting service and you don't know how to use pico? Could you refresh our memory on why we would want to get hosted by you again?

I'm not trying to be mean, but I find it very funny that you took the time to write that whole message and think about the process of script style deleting all these old virtual hosts instead of just going through and deleting them from the beginning.
BTW, I could write a php script to do that :)

-Chris

i know how to use pico smartie

WebmastersHost
08-15-2002, 09:58 PM
Originally posted by ntwaddel


i know how to use pico smartie

I don't believe he was referring to you. I think he was referring to hostchamp being a Unix host and not knowing what Ctrl-k would do in Pico.

ntwaddel
08-15-2002, 10:10 PM
hehe, thats what i figured...

i was just saying :D

hostchamp
08-16-2002, 04:20 AM
well genocidal i definitely know how to deleting a lines vi, i do not use pico. As far as your hosting with me is concerned, i am happy with the clients we have got so do not bother. If you didn't inderstand my post too well what i meant was i have hundreds of virtual host block which i wanted to delete so deleting one line at a time as what 'ntwaddel' pointed out would not have helped.

Chirpy for some reason the apache section of my webmin doesn't open, it prompts me to verify the apache modules i have got and then gets stucks. Also, the idea behind posting in this forum was to get some help, since there are people here with varied experiences. I have seen some scripts like vhost or webmin for that matter which would you delete virtual host blocks, it's just that i thought i was posting in a community forum.

Thanks for your help though ntwaddel.