LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 01-11-2013, 04:18 AM   #1
coolpraz
Member
 
Registered: Feb 2010
Posts: 35

Rep: Reputation: 0
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
 
Old 01-11-2013, 04:52 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 26,524
Blog Entries: 51

Rep: Reputation: 2601Reputation: 2601Reputation: 2601Reputation: 2601Reputation: 2601Reputation: 2601Reputation: 2601Reputation: 2601Reputation: 2601Reputation: 2601Reputation: 2601
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.
 
Old 01-11-2013, 05:32 AM   #3
bijo505
Member
 
Registered: Nov 2012
Location: Bangalore
Distribution: Fedora & Ubuntu
Posts: 77

Rep: Reputation: 18
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

Last edited by bijo505; 01-11-2013 at 05:34 AM.
 
Old 01-12-2013, 02:23 PM   #4
coolpraz
Member
 
Registered: Feb 2010
Posts: 35

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by bijo505 View Post
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Query: CentOS 6.2 Apache 2.2.15 Virtual Host Set-up LouArnold Linux - Server 11 03-02-2012 06:10 PM
CentOS 6.2 - Empty Add/Remove Software list Panupat Linux - Software 6 02-03-2012 11:38 AM
Any way to tunnel apache virtual host to an internal apache? ciuly Linux - Server 5 01-31-2010 12:53 PM
CentOS Apache Server - identifying (virtual host) target of spam attack Lord Matt Linux - Server 3 04-07-2008 02:17 AM
apache virtual host navinc Linux - Software 10 05-22-2003 12:16 PM


All times are GMT -5. The time now is 10:37 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration