Re: Daemon configuration for Apache

From: Amrahsa (amrahsa_at_yahoo.com)
Date: 04/26/04

  • Next message: Andrew Gaffney: "using Hash::Case and Storable"
    Date: Sun, 25 Apr 2004 20:05:29 -0700 (PDT)
    To: beginners@perl.org
    
    

    Hi,
        You understand the problem correctly. I wanted to
    get the path for httpd.conf file when the System boots
    up and my daemon will parse the httpd.conf file to get
    the Server Address and the port number and some
    additional information from where your Server runs. I
    wanted to show this information to the user So that
    they can directly change their configuration rather
    than editing the file, I have reached till the steps
    where i can look for /etc/rc.d/rc3.d for httpd and
    apache files but seems for each vendor these files are
    written differently and i can not found the exact
    httpd.conf file. Please suggest what you say.

    Thanks,

    --- drieux <drieux@wetware.com> wrote:
    >
    > On Apr 24, 2004, at 2:46 AM, amrahsa wrote:
    > [..]
    > > 1) When the system boots up I found in which run
    > level System boots up
    > > and go to corresponding directory e.g.
    > /etc/rc.d/rc3.d
    > > 2) I look for Sxxapache or Sxxhttp file to see if
    > apache startup file
    > > is there
    > >
    > > Now my problem is one apache startup The
    > configuration file Sxxapache
    > > or Sxxhttp has used some configuration file based
    > on some shell script
    > > to invoke the configuration file as parameter and
    > i need to know that
    > > file in my daemon to read that file e.g.
    > httpd.conf file
    > >
    > > If you have any idea please help me to resolve
    > this problem.
    > [..]
    >
    > Let me see if I get your core problem here,
    >
    > you want to parse out the httpd.conf
    > but you want to find it 'dynamically'
    > based upon what is in the /etc/rc.d/rc3.d section?
    >
    > you do understand that you could find the 'init
    > script'
    > for apache in
    >
    > /etc/rc.d/apache
    >
    > on SuSe distributions, while on Red Hat you would
    > need to be looking for
    >
    > /etc/rc.d/init.d/httpd
    >
    > eg:
    > disky: 62:] ls -li ./init.d/httpd ./rc3.d/S99httpd
    > 1055235 -rwxr-xr-x 1 root root 2245
    > Dec 10 02:05
    > ./init.d/httpd
    > 97370 lrwxrwxrwx 1 root root 22
    > Aug 7 2002
    > ./rc3.d/S99httpd -> /etc/rc.d/init.d/httpd
    > disky: 63:]
    >
    > so clearly first off you can figure out which
    > version
    > of linux you are playing with by how they did their
    > lay out - and there is little real 'useful'
    > information
    > that is in those init scripts to begin with. The
    > line you would of course be interested in is
    >
    > [ -r /etc/sysconfig/apache ] && .
    > /etc/sysconfig/apache
    >
    > the other line where it is 'including' anything
    > is merely the shell library of rc_init functions
    > that is common to all of the rc scripts.
    >
    > So what you really want to be resolving is whether
    > you will find the httpd.conf in say
    >
    > /etc/httpd/conf/httpd.conf
    >
    > or not - since reasonable folks do not generally
    > stuff shell variables into /etc/sysconfig/apache
    >
    > At which point there is the other odd question
    > that comes to mind, why? What is it you are
    > really trying to work out ? Why not talk to
    > the httpd directly?
    >
    >
    > ciao
    > drieux
    >
    > ---
    >
    >
    > --
    > To unsubscribe, e-mail:
    > beginners-unsubscribe@perl.org
    > For additional commands, e-mail:
    > beginners-help@perl.org
    > <http://learn.perl.org/>
    > <http://learn.perl.org/first-response>
    >
    >

            
                    
    __________________________________
    Do you Yahoo!?
    Yahoo! Photos: High-quality 4x6 digital prints for 25¢
    http://photos.yahoo.com/ph/print_splash


  • Next message: Andrew Gaffney: "using Hash::Case and Storable"

    Relevant Pages

    • Re: Fwd: Re: Daemon configuration for Apache
      ... >> Now my problem is one apache startup The ... >> or Sxxhttp has used some configuration file based ... > on some shell script ... Do you Yahoo!? ...
      (perl.beginners)
    • Re: env var dump - why?
      ... > Working on a script that has one huge problem. ... > # Configuration is done all through one configuration file ... > echo "Starts or stops multiple instances of zope one by one or all ...
      (comp.unix.shell)
    • Re: Protecting passwords in Perl scripts?
      ... > the script or contained in an external configuration file (which must be ... > readable by the effective uid of the script). ... Don't bother with encryption or set-id's, ... to the actual threats you face. ...
      (comp.lang.perl.misc)
    • env var dump - why?
      ... Working on a script that has one huge problem. ... # Starts or stops multiple instances of zope one by one or all at ... # Configuration is done all through one configuration file ... echo "Starts or stops multiple instances of zope one by one or all ...
      (comp.unix.shell)