You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by ba...@mediageneral.com on 2003/09/03 16:51:33 UTC
[users@httpd] How to get apache to autostart
Greetings,
I've got apache 1.3 set up on my redhat linux 8 system but I need to fix it
so it will automatically start (I had to compile it so I'm not using the rpm
version) - does anyone know how or what I need to do to get it to
automatically start when we have to reboot the server?
Thanks,
Bobbie
Bobbie Atristain
Internet Systems Administrator
Media General, INC.
804.649.6156
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] How to get apache to autostart
Posted by Leif W <wa...@usa.net>.
RTFM: man init
init is the first program to be run by the kernel after boot. It's been a
long time since I used RedHat, so I forget how their init configs are set
up. I'm using Debian now, and they have a single /etc/init.d directory
where you put a script (you should probably write one, but I'll show an
example). Then, init has different "RUN LEVELS", 0 - 6, 0 being boot, 1
being single user, 2 is networking, 3 is something else (including
networking), 4, I think is X11, 5 I forget, and 6 being shutdown / reboot.
In Debian, the runlevels are represented by /etc/rcN.d/ where N is 0-6, and
within each directory are symbolic links to the scripts in /etc/init.d/ with
a naming convention ln -s /etc/init.d/script SNNscript where S is either S
for start or K for kill, NN is a two digit number, to control the order in
which things are started or killed, and script is the script in /etc/init.d.
For each script, it can be called with a single option, usually one of the
following: {start|stop|restart|rerload}. Symbolic links in /etc/rcN.d
starting with a K call the script with "stop", starting with an S call
script with "start".
Leif
Example script:
=======================================
#! /bin/bash
APACHECTL="/usr/local/apache2/bin/apachectl";
case $1 in
# start)
# echo -n "Starting Apache 2 webserver...";
# echo "done.";
# ;;
start|startssl)
echo -n "Starting Apache 2 webserver w/SSL..."
$APACHECTL startssl;
if [ $? -gt 0 ];
then
echo "ERROR - Apache 2 not started.";
exit 1;
fi
;;
stop)
echo -n "Stopping Apache 2 webserver...";
$APACHECTL stop;
if [ $? -gt 0 ];
then
echo "ERROR - Apache 2 not stopped.";
exit 1;
fi
;;
restart|reload)
echo "Restarting Apache 2 webserver...";
$0 stop;
#[ $? -gt 0 ] && exit 1;
sleep 5;
$APACHECTL -t;
if [ $? -gt 0 ];
then
echo "ERROR - Apache 2 conf.";
exit 1;
else
$0 start;
[ $? -gt 0 ] && exit 1;
fi
;;
*)
echo "Usage: /etc/init.d/apache.sh
{start|startssl|stop|restart|reload}"
;
;;
esac;
echo "done.";
exit 0;
=======================================
----- Original Message -----
From: <ba...@mediageneral.com>
To: <us...@httpd.apache.org>
Sent: Wednesday, September 03, 2003 10:51 AM
Subject: [users@httpd] How to get apache to autostart
> Greetings,
> I've got apache 1.3 set up on my redhat linux 8 system but I need to fix
it
> so it will automatically start (I had to compile it so I'm not using the
rpm
> version) - does anyone know how or what I need to do to get it to
> automatically start when we have to reboot the server?
>
> Thanks,
> Bobbie
>
> Bobbie Atristain
> Internet Systems Administrator
> Media General, INC.
> 804.649.6156
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> " from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>
>
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] cgi scripts
Posted by Leif W <wa...@usa.net>.
----- Original Message -----
From: "Herb Stein" <he...@herbstein.com>
To: <us...@httpd.apache.org>
Sent: Wednesday, September 03, 2003 5:58 PM
Subject: [users@httpd] cgi scripts
> I'm trying to set up a page, password
> required per .htaccess, that asks for
> a few non-private bits and emails it
> to someone usingFormMail.pl. It
> complains about page not found, leaves
> the URL on the bar, and if I click GO
> (IE) it works fine. why does is stall
> at the first place?
Sounds like a programming error or misconfiguration. Check your error log,
there's likely to be something in there.
> I have Options ExecCGI in .htaccess
> but that should not be required
> because of the ServerAlias entry in
> httpd.conf points to FormMail.pl.
Do you mean the ScriptAlias directive specifies the directory in which
FormMail.pl resides? Maybe show this line to be sure it's correct.
A note about FormMail, it's notorious for being easy to exploit as an "mail
relay". There's an option to only allow mail being sent from specific
referral domains, but these are trivial to forge programattically in any
scripting or other programming language. At one job a client was bombarded
with bounced emails as a result of a bulk email spammer abusing the script.
Leif
> I'm braindead no doubt.
>
> --
> Herb Stein
> The Herb Stein Group
> www.herbstein.com
> herb@herbstein.com
> 314 952-4601
>
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> " from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>
>
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
[users@httpd] cgi scripts
Posted by Herb Stein <he...@herbstein.com>.
I'm trying to set up a page, password
required per .htaccess, that asks for
a few non-private bits and emails it
to someone usingFormMail.pl. It
complains about page not found, leaves
the URL on the bar, and if I click GO
(IE) it works fine. why does is stall
at the first place?
I have Options ExecCGI in .htaccess
but that should not be required
because of the ServerAlias entry in
httpd.conf points to FormMail.pl.
I'm braindead no doubt.
--
Herb Stein
The Herb Stein Group
www.herbstein.com
herb@herbstein.com
314 952-4601
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
RE: [users@httpd] How to get apache to autostart
Posted by Herb Stein <he...@herbstein.com>.
> -----Original Message-----
> From: batristain@mediageneral.com [mailto:batristain@mediageneral.com]
> Sent: Wednesday, September 03, 2003 9:52 AM
> To: users@httpd.apache.org
> Subject: [users@httpd] How to get apache to autostart
>
>
> Greetings,
> I've got apache 1.3 set up on my redhat linux 8 system but I need
> to fix it
> so it will automatically start (I had to compile it so I'm not
> using the rpm
> version) - does anyone know how or what I need to do to get it to
> automatically start when we have to reboot the server?
I put a line in /etc/rc.d/rc.local like this:
/usr/local/apache/bin/apachectl start
Change the path to where you find apachectl on your installation.
> Thanks,
> Bobbie
>
> Bobbie Atristain
> Internet Systems Administrator
> Media General, INC.
> 804.649.6156
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> " from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
--
Herb Stein
The Herb Stein Group
www.herbstein.com
herb@herbstein.com
314 952-4601
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org