a , Apache mode view
If Apache is already installed, we can use the Httpd-l command to view the current mode (there may only be one), if found PREFORK.C indicates that the current work in prefork mode, the same way WORKER.C is working in worker mode.
If Apache is not yet installed, we can add--with-pem= (prefork|worker) when compiling
option determines what mode is enabled.
Of course if you have installed (author mode is prefork) You can also use the following command to switch
MV HTTPd Httpd.prefork
MV Httpd.worker httpd
after rebooting, the mode will change.
Second, installation Apche
Because Apache relies on APR, Apr-util, and pcre, it needs to be downloaded:
APR + apr-util:http://apr.apache.org/download.cgi
PCRE:http://sourceforge.net/projects/pcre/files/pcre/
1. Install Apr
Tar zxvf apr-1.5.1.tar.gz (extract files to directory/home/gaoqing/software/apache)
./CONFIGURE--PREFIX=/HOME/GAOQING/SOFTWARE/APACHE/APR Configuring the installation directory
Make
Make install
2, installation Apr-util
./configure--prefix=/home/gaoqing/software/apache/apr-util--WITH-APR=/HOME/GAOQING/SOFTWARE/APACHE/APR
Make && make install
3, installation Pcre
./configure--prefix=/home/gaoqing/software/apache/pcre
4, install Apache, and specify the working mode for work
: http://httpd.apache.org/
./configure--prefix=/home/gaoqing/software/apache/apache--WITH-APR=/HOME/GAOQING/SOFTWARE/APACHE/APR-- With-apr-util=/home/gaoqing/software/apache/apr-util--with-pcre=/home/gaoqing/software/apache/pcre--with-mpm= Worker
Make && make install
Third, the configuration
Modify the configuration file, or the problem will occur:
AH00558:httpd:Could notreliably determine the server ' s fully qualified domain name, using 127.0.1.1.Set the ' ServerName ' Directive globally to suppress this message
Workaround: Modify the conf/httpd.conf :
# servernamewww.example.com:80
instead:
Servernamelocalhost:80
IV: Start, stop, restart of Apache service
Assuming your APAHCE installation directory is/usr/local/apache2, these methods are suitable for any situation
Apahce Start command:
Recommended/usr/local/apache2/bin/apachectl Start APACEH startup
Apache Stop Command
/usr/local/apache2/bin/apachectl Stop Stop
Apache Restart command:
/usr/local/apache2/bin/apachectl Restart Restart
To restart the Apache server without interrupting the current connection, you should run:
/usr/local/sbin/apachectl Graceful
Service httpd Start
Service httpd Restart Restart
servicehttpd Stop Stop Service
Compile and install Apache and specify working mode as work