Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Apache Restart

by gopalr (Priest)
on Aug 24, 2006 at 13:46 UTC ( #569363=perlquestion: print w/ replies, xml ) Need Help??
gopalr has asked for the wisdom of the Perl Monks concerning the following question:

Hello Monks,

Whenever I change the Module file, I need to restart the apache server by using the following commands in Debian.

/etc/init.d/apache-perl stop /etc/init.d/apache-perl start

I feel its little bit uneasy to run again and again.

Please guide me if there is any other way to restart the apache server as soon as I modified the Module file.

Thanks in Advance,
Gopal.R

Comment on Apache Restart
Download Code
Re: Apache Restart
by sub_chick (Hermit) on Aug 24, 2006 at 14:00 UTC
    As far as I know, Apache doesn't support config changes without a restart so I don't know of any guide to help you out with that.
    But as far as perl goes System Function might do the trick if you make a small application in /usr/bin/ that would stop and then start your apache server by just running the one worded program from the terminal. Will save you alot of tedious keystrokes.

    Hope this helps.


    Es gibt mehr im Leben als Bücher, weißt du. Aber nicht viel mehr. - (Die Smiths)"
Re: Apache Restart
by derby (Abbot) on Aug 24, 2006 at 14:13 UTC

    For production sites, yes, that's what you want to do. For dev or test sites, Apache::StatINC is what you want.

    -derby
      These days we recommend Apache::Reload/Apache2::Reload instead.
Re: Apache Restart
by clinton (Priest) on Aug 24, 2006 at 14:17 UTC
    You don't speciy what the Module file is, or how you are running it, but if you need to keep restarting apache, I'm supposing that you're running something under mod_perl, in which case you should just be able to use:

    /etc/init.d/apache-perl restart or /etc/init.d/apache-perl graceful

    Alternatively, because it doesn't sound like you are making use of mod_perl, you may want to use ModPerl::Registry to run your CGI with the power of mod_perl.

    See Getting your feet wet with mod_perl

Re: Apache Restart
by imp (Priest) on Aug 24, 2006 at 14:21 UTC
    /etc/init.d/apache-perl is just a shell script that encapsulates common tasks. Read through it to see your other options.

    You can also do the following:

    • reload - same as 'apachectl graceful' (sends USR1 signal)
    • restart - same as 'apachectl restart' (sends HUP signal)
    • reload-modules - same as stop + start
Re: Apache Restart
by kprasanna_79 (Hermit) on Aug 24, 2006 at 17:12 UTC
    Gopal,

    When ever you feel uneasy to do the built in things, write small scripts in perl or shell, which will act as wrapper scipt for the original script, and try running that.

    Put that in your bin path and just run in a single command. Keep what ever name you want, easy to (remmember, key and use ) and feel its taste


    -Prasanna.K

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://569363]
Approved by prasadbabu
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (13)
As of 2014-07-11 15:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (230 votes), past polls