Sponsored Content
Top Forums Shell Programming and Scripting sed command to parse Apache config file Post 302377327 by jy2k7ca on Thursday 3rd of December 2009 06:58:12 PM
Old 12-03-2009
rdcwayx, wow quick reply...thanks. It does give me the output am looking for.

I was hoping I could sort the URL uniquely but output but seems impossible as the are subdirectories after the URL.

Here's the sample new output from your code:

Code:
RewriteRule http://dev-individual.com/SFC/$1 [P,NC,L]
RewriteRule http://dev-individual.com/SFC/intranet/$1 [P,NC,L]
RewriteRule http://dev-obawls.com:5313/advisor_PS_docs$1 [P,NC,L]
RewriteRule http://dev-obawls.com:5813/RTL_ADVISOR_DOCS/$1 [P,NC,L]
RewriteRule http://dev-obawls.com:8313/advisor_ho$1 [P,NC,L]
RewriteRule http://dev-obawls.com:8313/advisor_up$1 [P,NC,L]
RewriteRule http://dev-obawls.com:8313/RTL_ADVISOR/$1 [P,NC,L]

The final desired output is as shown:
Code:
RewriteRule http://dev-individual.com [P,NC,L]
RewriteRule http://dev-obawls.com [P,NC,L]

Thank you.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Apache Config

I need help doing two things in my Apache Config.... 1) Creating a Referer log where only domains other than my own (or a list I specify) are logged ...and... 2) I want to replace images loaded from my site, on other sites, it a standard RED "stolen" image. I currently have code in place... (2 Replies)
Discussion started by: l008com
2 Replies

2. Shell Programming and Scripting

How to parse config variables from external file to shell script

How do i use a config.txt to recursively pass a set of variables to a shell script eg my config.txt looks like this : path=c://dataset/set1 v1= a.bin v2= b.bin path=c://dataset/set2 v1= xy.bin v2= abc.bin .................. and so on . and my testscript : (2 Replies)
Discussion started by: pradsh
2 Replies

3. Shell Programming and Scripting

How to parse slash / in sed command..

Hi All, I am trying to replace paths with \ (as in NT) with / (as in Unix) in a script using sed. Following is the command I use: sed "s/e:\Kenny_test\csv_files/var/opt/ciw/data/outbound/g" EMEA4710.SQL > test the string to replace is e:\Kenny_test\csv_files the target string needs to... (3 Replies)
Discussion started by: Abhidey
3 Replies

4. Shell Programming and Scripting

awk/sed Command : Parse parameter file / send the lines to the ksh export command

Sorry for the duplicate thread this one is similar to the one in https://www.unix.com/shell-programming-scripting/88132-awk-sed-script-read-values-parameter-files.html#post302255121 Since there were no responses on the parent thread since it got resolved partially i thought to open the new... (4 Replies)
Discussion started by: rajan_san
4 Replies

5. Shell Programming and Scripting

awk/sed Command: To Parse Stament between 2 numbers

Hi, I need an awk command that would parse the below expression Input Format 1 'Stmt1 ............................'2 'Stmt2 ............................'3 'Stmt3 ............................'4 'Stmt4 ............................'5 'Stmt5 ............................'6 'Stmt6... (1 Reply)
Discussion started by: rajan_san
1 Replies

6. Shell Programming and Scripting

Parse config file and store the values in variables

Hi, I have a config file that has blank, commented lines. I need to escape commented lines, blank lines, parse the remaining lines and store them in variables or array. the config file contains the following lines. # config file # Define Oracle User ORA_USER=abcde ORA_PASS=xyzabc... (8 Replies)
Discussion started by: Lakshmi Chowdam
8 Replies

7. Shell Programming and Scripting

Parse config file data to script variable

I have a script with few pre defined variables. Also have a config file. Something like this. # config file # Define Oracle User MOD1_TAG=abcde MOD2_TAG=xyzabc MOD3_TAG=def I need to parse the config file and have each of the value copied to different variables. Please suggest what... (1 Reply)
Discussion started by: souryadipta
1 Replies

8. Red Hat

Apache virtual host config vs global config problem

Hi folks, I am trying to configure Apache webserver and also a virtual host inside this webserver. For Global server config: /var/www/html/index.html For virtual host config: /var/www/virtual/index.html Both client10 & www10 are pointing to 192.168.122.10 IP address. BUT, MY... (1 Reply)
Discussion started by: freebird8z
1 Replies

9. Shell Programming and Scripting

sed add line to config file

what is the sed command line to add a line to a config file config file name is "config" line to be added cpuid.7.edx = "----:00--:----:----:----:----:----:----" thanks (4 Replies)
Discussion started by: tdubb123
4 Replies

10. UNIX for Beginners Questions & Answers

Parse apache log file with three different time formats

Hi, I want to parse below file and Write a function to extract the logs between two given timestamp. Apache (Unix) Log Samples - MonitorWare The challenge here is there are three date and time format. First :- 07/Mar/2004:16:05:49 Second :- Sun Mar 7 16:02:00 2004 Third :- 29-Mar... (6 Replies)
Discussion started by: sahil_shine
6 Replies
Apache::Qpsmtpd(3pm)					User Contributed Perl Documentation				      Apache::Qpsmtpd(3pm)

NAME
Apache::Qpsmtpd - a mod_perl-2 connection handler for qpsmtpd SYNOPSIS
Listen 0.0.0.0:25 smtp AcceptFilter smtp none ## "smtp" and the AcceptFilter are required for Linux, FreeBSD ## with apache >= 2.1.5, for others it doesn't hurt. See also ## http://httpd.apache.org/docs/2.2/mod/core.html#acceptfilter ## and http://httpd.apache.org/docs/2.2/mod/mpm_common.html#listen LoadModule perl_module modules/mod_perl.so <Perl> use lib qw( /path/to/qpsmtpd/lib ); use Apache::Qpsmtpd; $ENV{QPSMTPD_CONFIG} = "/path/to/qpsmtpd/config"; </Perl> <VirtualHost _default_:25> PerlModule Apache::Qpsmtpd PerlProcessConnectionHandler Apache::Qpsmtpd # can specify this in config/plugin_dirs if you wish: PerlSetVar qpsmtpd.plugin_dirs /path/to/qpsmtpd/plugins PerlSetVar qpsmtpd.loglevel 4 </VirtualHost> DESCRIPTION
This module implements a mod_perl/apache 2.0 connection handler that turns Apache into an SMTP server using Qpsmtpd. It also allows you to set single-valued config options (such as loglevel, as seen above) using "PerlSetVar" in httpd.conf. This module should be considered beta software as it is not yet widely tested. However it is currently the fastest way to run Qpsmtpd, so if performance is important to you then consider this module. BUGS
Probably a few. Make sure you test your plugins carefully. The Apache scoreboard (/server-status/) mostly works and shows connections, but could do with some enhancements specific to SMTP. AUTHOR
Matt Sergeant, <matt@sergeant.org> Some credit goes to <mock@obscurity.org> for Apache::SMTP which gave me the inspiration to do this. perl v5.14.2 2009-04-02 Apache::Qpsmtpd(3pm)
All times are GMT -4. The time now is 04:57 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy