Creating the script for updating or replacing the existing http.conf file


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Creating the script for updating or replacing the existing http.conf file
# 1  
Old 04-07-2016
Creating the script for updating or replacing the existing http.conf file

Hi
I need some help with a task, i am an absolute newbie to any form of shell scripting and request guidance.

I have been building a proxy server using the apache mod proxy currently my solution is working , but i need to automate the process , suppose if any changes need to be made on httpd.conf file , it can be done by using the script outside the server . The script need to be updated with latest content also the service should get restarted or the new content file should get replaced with the old file on the server. I want to add the lines in the existing httpd.conf file using the script externally. The users who will edit the file will not have access to the server , they can edit the file which can be stored in repository.

I am using aws linux instance , below is the code from the config which we need to edit every time the changes comes in.

Code:
ProxyPass /test/ example
ProxyPassReverse /test/ example/1
ProxyHTMLURLMap example/ /test/

<location /annual/>
ProxyPassReverse /
SetOutputFilter proxy-html;SUBSTITUTE
ProxyHTMLURLMap / /test/
Substitute "s|\/test//|//|iq"
Substitute "s|url\(\'\/|url\(\'/test/|iq"
Substitute "s|url\(\/|url\(/test/|iq"
Substitute "s|url\(\"/|url\(\"/test/|iq"
</location>


Moderator's Comments:
Mod Comment Please use code tags correctly!

Last edited by RudiC; 04-07-2016 at 10:17 AM.. Reason: Corrected code tags again.
Login or Register to Ask a Question

Previous Thread | Next Thread

7 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need help in creating a file in required format form another existing file

I have a text file with contents like this: a,b,c, d~e,f,g,h~i,j ,k,l,m~n,o,p,q~ I need to convert this file into this format unix shell script commands: a,b,c,d~ e,f,g,h~ i,j,k,l,m~ n,o,p,q~ as you may have noticed, I need to retain the ~ signs at the end. Any help is greatly... (3 Replies)
Discussion started by: harsha1238
3 Replies

2. Shell Programming and Scripting

Creating file from an existing file using CUT, is it the best option?

Dear All, I have a requirement in which i have to load a file placed in FTP location onto my database. The process i'll follow is as below: 1) Get the files using FTP. 2) Create the desired load files as i have to load only 19 fields out of the 104 available in the file. The fields i require... (7 Replies)
Discussion started by: abhishekakaomi
7 Replies

3. Shell Programming and Scripting

Replacing the existing files only

Hey, Can someone pls give me an idea on how to write a shell script for the below requirement. I am generating lot of .txt files in a unix directory through a etl tool, now I need to write a shell script which will move these files to another directory(\abc\xyz\source), but in the... (2 Replies)
Discussion started by: shruthidwh
2 Replies

4. Shell Programming and Scripting

Creating a new file based on existing file

Hello Guys , I need an another help regarding the below problem. I want to create a new file based on the existing file ,where two columns will be changed according to user input .(say column 4 and column 5) Please let me know how to proceed with Thanks (3 Replies)
Discussion started by: Pratik4891
3 Replies

5. UNIX for Dummies Questions & Answers

Updating a field in a File without creating temp file's

Hi Experts, I have a requirement where i need to update the below items in file, 1. END TIME 2. PREV_STATUS For the first time the PREV_status and end time of all job the job will be sysdate & NULL reply as below, Session_name,Load Type,Frequency,Seesion End time,Prev_Status... (2 Replies)
Discussion started by: prabhutkl
2 Replies

6. Shell Programming and Scripting

Creating/ammending Name Column in existing .txt file

With the help of this forum, I have a script with the following output: chr7 27104483 27105154 chr7 27106872 27110789 chr7 27111956 27112830 chr7 27114388 27125180 chr7 27126966 27131260 chr7 27135440 27137796 which was created by the following script: awk '1 == NR || $NF >= 1000 {... (6 Replies)
Discussion started by: awknerd
6 Replies

7. Shell Programming and Scripting

Creating a csv file based on Existing file

Hi I am Newbie to Unix.Appreciate Help from forum user would loada b.Csv File(Below example) in /data/m/ directory.Program need to read the b.csc to extract certain column and create a new file /data/d/ directory as csv file with new name. User File Format 1232,samshouston,12345... (3 Replies)
Discussion started by: skywayterrace
3 Replies
Login or Register to Ask a Question