Example 3-5. Example
commands for restarting Apache
1. Several Linux and SysV variants:
/etc/rc.d/init.d/httpd restart
2. Using apachectl scripts:
/path/to/apachectl stop
/path/to/apachectl start
3. httpdctl and httpsdctl (Using OpenSSL), similar to apachectl:
/path/to/httpsdctl stop
/path/to/httpsdctl start
4. Using mod_ssl, or another SSL server, you may want to manually
stop and start:
/path/to/apachectl stop
/path/to/apachectl startssl |
|
The locations of the apachectl and http(s)dctl
binaries often vary. If your system has locate or whereis
or which commands, these can assist you in finding your
server control programs.
Different examples of compiling PHP for apache are as follows:
Same as before, except instead of including PostgreSQL
support directly into the final httpd you will get a pgsql.so
shared library that you can load into PHP from either the
php.ini file or directly using dl().
When choosing to build PHP in different ways, you should
consider the advantages and drawbacks of each method. Building
as a shared object will mean that you can compile apache
separately, and don't have to recompile everything as you
add to, or change, PHP. Building PHP into apache (static
method) means that PHP will load and run faster. For more
information, see the Apache webpage on DSO support.
Note: Apache's default httpd.conf currently ships with
a section that looks like this:
Unless you change that to "Group nogroup" or something
like that ("Group daemon" is also very common) PHP will
not be able to open files.
Note: Make sure you specify the installed version
of apxs when using --with-apxs=/path/to/apxs. You must
NOT use the apxs version that is in the apache sources
but the one that is actually installed on your system.