OCT 8 2016
Basic installation procedures for Apache services
first, in order to avoid port conflicts, you need to uninstall the Linux system in the RPM installation of httpd
~] # Rpm-qa | grep httpd
~] # rpm-e httpd--nodeps (here nodeps to ignore Dependencies)
second, the download obtained httpd source package decompression and release to The/usr/src/directory
~] # tar zxvf httpd-2.2.17.tar.gz-c/usr/src
~] # cd/usr/src/httpd-2.2.17
three, configuration: Custom Compilation options
~] # ./configure--prefix=/usr/local/httpd (specify installation Path)
without shutting down the Server. Span style= "font-family:microsoft yahei; font-size:18px; " >
--enable-rewrite ( Enable Web page address Rewriting: uploading a webpage does not require a service to be closed
--enable-charset-lite ( Enable character Set support)
--enable-cgi (enable CGI scripting Support)
Iv. Compilation and Installation
~] # make && make install (where the && symbol is interpreted as: the following do install commands will not continue until the made is successful, and the make command requires support from the GCC and gcc++ compilation Environments. Install with Yum tool, or select " development tools "options. )
five, Confirm the installation results
~] # ls/usr/local/httpd
Briefly enumerate the main contents of THE/USR/LOCAL/HTTPD Folder:
/bin: executable program files, commands, etc. that store httpd services
/conf: Directory of configuration file httpd.conf
/htdocs: default storage path for Web page files
/logs: Log file directory
/modules: The module folder that holds the HTTPD service
/cgi-bin: storing various CGI program files
Vi. Optimization of execution paths
Compile the installed HTTPD service through the source code, The program path is not in the default search path, in order to make the service easier to use, you can add a link to the relevant program
~] # ln-s/usr/local/httpd/bin/*/usr/local/bin
We can run it right now.
~] # apachectl-v command to view the version of the Apache service
Vii. add httpd to System services
~] # cp/usr/local/httpd/bin/apachectl /etc/init.d/httpd
~] # VIM/ETC/INIT.D/HTTPD
Modify the first three lines
# ! /bin/bash
# chkconfig:35 85 21 (3 and 5 run Level Open service "-" is not on, 85th is turned on, 21st is closed)
span>
# description: ———— parameter description line ————
(note: The general configuration file begins with # to comment out this line, but the first three lines of the Apache service must be # and take effect, with the # sign followed by a space, and 35 preceded by a space)
~] # Chkconfig--add httpd (turn on restart Loading)
~] # chkconfig--list httpd(check if it takes Effect)
The server of Apache