httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Boyle Owen" <Owen.Bo...@swx.com>
Subject RE: [users@httpd] a quick question or two
Date Tue, 29 Oct 2002 16:21:58 GMT
Congratulations and welcome to apache :-)

First off - you should (must!) have only one httpd.conf. It is possible
to concatenate config files but that is The Way of Pain.

Second, you must restart apache to pick up config changes. However, this
can simply be done by using the "graceful" argument to apachectl - i.e.
"/usr/local/apache2/bin/apachectl graceful".

Next, be aware of what apachectl is doing. It is just a shell script
which takes one argument on the command line (e.g. stop, start,
graceful). It then issues an appropriate shell command based on that
argument. For example, to stop apache, it just reads the process id of
the httpd parent from the PID file (usually
/usr/local/apache2/logs/httpd.pid) and then says "kill <pid>". To start
apache it just executes the binary (e.g. /usr/local/apache2/bin/httpd).
As an exercise, see if you can figure out how "graceful" works (hint:
have a look at the man page for "kill").

Note that the binary knows where to find its config file since this is a
compile time option. To check it, do: "/usr/local/apache2/bin/httpd -V"
and look at SERVER_CONFIG_FILE. If you want to use another file for some
reason, you can specify this on the command line with the -f switch,
e.g. "/usr/local/apache2/bin/httpd -f /some/other/httpd.conf". To see
other switches, do: "/usr/local/apache2/bin/httpd -f".

This might seem a bit overkill but it's just to point out that there is
no mystery to apache - everything happens for a reason and you are able
to locate and alter every aspect and option of the server if you know
where to look. If you play around with the commands above, it'll all
soon fall into place.

PS about the automatic startup of apache - you need to have a startup
script in a run-control directory. This is OS dependent but typically
you have a link like /etc/rc2.d/S90apache which points to the script
/etc/init.d/apache. On boot, when the machine gets to run level 2, all
scripts beginning with "S" in /etc/rc2.d are executed with argument
"start". So if /etc/init.d/apache is just a copy or a link to
/usr/local/apache2/bin/apachectl, apache will be started. I'd be
suprised if this got set up automatically but some Linuxes are very
clever these days.   

-----Original Message-----
From: Dan Stephens [mailto:DanielBStephens@hotmail.com]
Sent: Mittwoch, 29. Oktober 2003 16:11
To: users@httpd.apache.org
Subject: [users@httpd] a quick question or two


Thank you guys so much, I finally am starting to see how this whole
thing works: I ran a % "killall httpd" then started httpd by %
"/usr/local/apache2/bin/apachectl start" . My box is now listening to
port 80, and I am getting the apache config page when I hit my site. 
    I do want to know one or two more things, if that ok:
    - By starting httpd by % "/usr/local/apache2/bin/apachectl start" do
I need to do anything to make apache start and stop upon booting the
computer
    - I changed the DocumentRoot and Directory in httpd.conf within
/usr/local/apache2/conf/ and saved those changes. Do I need to restart
apache to make these changes take effect? If so, how should I stop and
restart apache (service httpd restart?)? 
    - Do I need to have my httpd.conf file in /etc/ somewhere as well? 
    - It seemed like /etc/init.d/httpd is already looking at the new
httpd executable, should it have done it itself as it appears it has?

    Thank you very much for all you help,
   -Dan

This message is for the named person's use only. It may contain
confidential, proprietary or legally privileged information. No
confidentiality or privilege is waived or lost by any mistransmission.
If you receive this message in error, please notify the sender urgently
and then immediately delete the message and any copies of it from your
system. Please also immediately destroy any hardcopies of the message.
You must not, directly or indirectly, use, disclose, distribute, print,
or copy any part of this message if you are not the intended recipient.
The sender's company reserves the right to monitor all e-mail
communications through their networks. Any views expressed in this
message are those of the individual sender, except where the message
states otherwise and the sender is authorised to state them to be the
views of the sender's company. 

---------------------------------------------------------------------
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


Mime
View raw message