Quickly build an apacheweb server in Linux

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.