02-24-2011
Shell script to parse apache httpd line
Hello,
I have serveral SUN Web servers that need to write a KSH to figure out where Apache is installed and, tar up the directory (for backup purposes) once a month. The trick is that Apache is not installed in same location. So when I do "ps -ef| grep httpd" it shows on some boxes from /usr/local and, on some shows /app. the ones from /app I have the following
ps -fe|grep httpd | awk '{print $8}' to get where apache is running from like so:
www 26228 26215 0 16:01:02 ? 0:00 /app/apache-idmadmin/bin/httpd -k
but, on some other boxes I have to modify my ps to ps -ef| grep httpd | awk '{print $9}' because of the following
www 10303 10295 0 Feb 10 ? 1:28 /usr/local/apache2/bin/httpd -k start
. I would like to write a script that works no matter where httpd is running from.
Appreciate any help
9 More Discussions You Might Find Interesting
1. Ubuntu
Hi everybody,
I have installed Apache 2 + Tomcat 5.5. on Ubuntu 7.04 and the default httpd.conf is empty (0 lines), however there is a file called apache2.conf that looks like a default httpd.conf.
I didn't use Apache in ages, since 1.3.x release, but I remember that the httpd.conf by default... (2 Replies)
Discussion started by: sspirito
2 Replies
2. Shell Programming and Scripting
Hi All,
I have a file like this,
data1,data2,,,data5,data6.
i want to write a shell script to replace data3 with "/example/string". which means my data file should look like this .
data1,data2,example/string],,data5,data6.
Could you guys help me to get a sed command or any other command... (8 Replies)
Discussion started by: girish.raos
8 Replies
3. UNIX for Advanced & Expert Users
Hi,
What options should I use with ./configure to include mod_dav into the build? I use --enable-dav and I didn't see mod_dav.so anywhere in the build directory. I need to load mod_dav.so as a module during httpd startup.
Thanks. (1 Reply)
Discussion started by: Parker_
1 Replies
4. Shell Programming and Scripting
Hi,
I need to parse input file from 2nd line.
Input file contents are,
ABC123;20100913115432;2000000;NO;
04;AAA;09;DDD;601020304;AAAA;1;OPTA1;OPTA2;;;
04;BBB;09;BBB;601020304;BBBB;0;OPTB1;OPTB2;OPTB3;OPTB4;OPTB5;
04;CCC;09;DDD;601020304;CCCC;1;;;;;
For each line,
1] I need to check... (17 Replies)
Discussion started by: Poonamol
17 Replies
5. Web Development
I'd like to know if servername in apache httpd.conf is the machine name or domain name. If it is domain name like example.com, should it be registered before in use? (1 Reply)
Discussion started by: yzhang738
1 Replies
6. Red Hat
Hi, I was wondering if someone could help me out here. I am super-paranoid, so am trying to limit what PHP files can be executed on this server. I have a small list of files that I want to allow. The rest, deny. So I have base rule that denies all php files server-wide: order allow,deny ... (0 Replies)
Discussion started by: Lobster
0 Replies
7. Red Hat
Hi, I was wondering if someone could help me out here. I am super-paranoid, so am trying to limit what PHP files can be executed on this server. I have a small list of files that I want to allow. The rest, deny:
<Files ~ "\.(php|php3)$">
order allow,deny
deny from all
</Files>
I... (0 Replies)
Discussion started by: Lobster
0 Replies
8. AIX
Dear all experts,
I have a environment with 2 web, 2 apps and 2 db servers. Recently after I have patch the AIX O/S from 5300-11-02 to 5300-12-02, we found that the number of httpd processes increase largely. From originally 4 fix httpd processes become more than 600 processes. And it already... (1 Reply)
Discussion started by: kwliew999
1 Replies
9. UNIX for Dummies Questions & Answers
What is the command to see what httpd.conf file is apache using. Apache is started. (1 Reply)
Discussion started by: galford
1 Replies