Article Title: How to quickly build an apacheweb server in Linux. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
The latest stable apache server version is httpd-2.2 .. 0, official: http://httpd.apache.org/download.cgi. We can quickly build a web server using the following steps.
1. Download the source code file httpd-2.2.0.tar.gz to a directory on the linux server.
2. decompress the file # tar zxvf httpd-2.2.0.tar.gz.
3. Configure #./c? Refix =/usr/local/apache // specify the installation directory. to delete the installation directory, you only need to delete it.
4. Compile and install the SDK. # Make; make install.
5. Write the startup script and put it in the directory/etc/rc. d/init. d/. The name is httpd, and its content is as follows:
#! /Bin/bash
# Descripti server
# Chkc 235 98 98
Case "$1" in
Start)
Echo "starting apache daemon ..."
/Usr/local/apache2/bin/apachectl-k start
;;
Stop)
Echo "stopping apache daemon ..."
/Usr/local/apache2/bin/apachectl-k stop
;;
Restart)
Echo "restarting apache daemon ..."
/Usr/local/apache2/bin/apachectl-k restart
;;
Status)
Statusproc/usr/local/apache2/bin/httpd
;;
*)
Echo "usage: $0 {start | stop | restart | status }"
Exit 1
;;
Esac
Note: # The descripti server line must be added; otherwise, the command # chkc? "Service apache does not support chkc 2345 98 98 indicates executing the command # chkc? When you add httpd, the files s98httpd and k98httpd are generated in the/etc/rc2.d/directory and/etc/rc3.d/etc/rc5.d directory. This number can be something else.
6. Run the command # chkc? Add httpd to the/etc/rc3.d directory. Check whether the s98httpd and k98httpd files are generated.
7. start the service # service httpd start.