- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- sed to edit httpd.conf
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2006 04:19 AM
02-15-2006 04:19 AM
For example when I find
Alias /manual/ "/usr/apache/htdocs/manual/"
Options Indexes FollowSymLinks MultiViews
AllowOverride None
I want to end up with
#Alias /manual/ "/usr/apache/htdocs/manual/"
#
# Options Indexes FollowSymLinks MultiViews
# AllowOverride None
#
I'm using sed, but having difficutly in finding the line starting Alias /manual/ and commenting out the next 4 lines too.
Comment out 1 line is
sed -e "/Alias \/manual\//s/^/# DONT'T ALLOW ACCESS TO THE MANUAL #/g" < httpd.conf.orig > httpd.conf
Any ideas would be appreciated.
Regards,
Dave.
Solved! Go to Solution.
- Tags:
- sed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2006 04:41 AM
- Tags:
- Perl
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2006 04:46 AM
02-15-2006 04:46 AM
Re: sed to edit httpd.conf
Regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2006 04:49 AM
02-15-2006 04:49 AM
Re: sed to edit httpd.conf
Perhaps something like:
# sed -ne '/Alias/,4 s/^/#/;p'
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2006 04:49 AM
02-15-2006 04:49 AM
Re: sed to edit httpd.conf
perl -p -e 's/^/#/ if /^Alias/../<\/Directory/' httpd.conf.orig >httpd.conf
HTH
-- Rod Hills
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2006 04:54 AM
02-15-2006 04:54 AM
Re: sed to edit httpd.conf
The BEGIN{$start=-99999} is because $start will assume to be zero upon first reference, so that the calculation would prefix "#" on the first few lines of the file.
HTH
-- Rod Hills