LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   How to list and remove virtual host of apache in centos by shell script (https://www.linuxquestions.org/questions/programming-9/how-to-list-and-remove-virtual-host-of-apache-in-centos-by-shell-script-4175445104/)

coolpraz 01-11-2013 04:18 AM

How to list and remove virtual host of apache in centos by shell script
 
Hi,
Can anybody help me to make a script which list and remove the virtual host from the http.cof file

unSpawn 01-11-2013 04:52 AM

Just like you did in your previous three threads you should start by showing what you already scripted or at least the commands you use for doing that and the relevant part of your httpd.conf.

bijo505 01-11-2013 05:32 AM

Hi,
This will do
Code:

sed -i.bak '/<VirtualHost .*>/,/<\/VirtaulHost>/d' apache2.conf
Also please have a look at this
http://en.kioskea.net/faq/1451-sed-d...es-from-a-file

coolpraz 01-12-2013 02:23 PM

Quote:

Originally Posted by bijo505 (Post 4867655)
Hi,
This will do
Code:

sed -i.bak '/<VirtualHost .*>/,/<\/VirtaulHost>/d' apache2.conf
Also please have a look at this
http://en.kioskea.net/faq/1451-sed-d...es-from-a-file

Thanx bijo your link help me a lot thanx


All times are GMT -5. The time now is 04:51 PM.