Linux Apache Web Server _ Server

Source: Internet
Author: User
Tags http authentication

The business community soon saw its value, with many companies setting up homepages, using the web to post messages online, and counter it as an interface to a variety of services, such as customer service, detailed descriptions of specific products and services, publicity campaigns, and growing product sales and services. Commercial use has facilitated the rapid development of global information networks.
If you want to introduce yourself or your company to the world through the homepage, you must put your home page on a Web server, and of course you can use some free home space to publish it. But if you have the conditions, you can register a domain name, apply for an IP address, and then have your ISP resolve the IP address to your Linux host. Then, set up a Web server on the Linux host. You can store your home page on your own Web server and publish your home page out of it.
WWW is a combination of information discovery Technology and hypertext technology based on client/server mode. WWW server uses HTML Hypertext Markup Language to organize the information into the hypertext; www browser provides user interface based on HTTP Hypertext Transfer Protocol. Users use the WWW browser to access HTML hypertext on the remote WWW server over the Internet, as shown in the following illustration:
HTTP protocol
www browser <-----> www server

In the WWW client/server work environment, the WWW browser plays a controlling role, the task of WWW browser is to use a URL (Internet address) to obtain a Web document on a WWW server, explain this HTML, The document content is displayed to the maximum extent that the user's environment permits. The whole process is as follows:

The WWW browser connects to the corresponding remote WWW server according to the URL entered by the user;

Gets the specified Web document;

Disconnect from the remote WWW server.
In other words, when we browse a website, we establish a connection with each page.
Disconnect immediately after reading, and then cycle back when another page is needed.
Comparison and selection of WWW server Software
At present, there are many companies and academic groups around the world that have developed different WWW servers based on different computer systems, such as Apache, CERN httpd, Microsoft Internet information System, NCSA httpd, Plexus httpd, website and so on. Commonly used in Unix/linux systems are: CERN, NCSA, Apache three species

CERN httpd
This is the earliest WWW server software, written in C language, now has limited functionality, the user
Reduction in. If you are interested, you can find it in:.

NCSA httpd
This is the beginning of the WWW server development, the U.S. National Supercomputer Computer Center (NCSA)
The first-class WWW server that was created in 1995. It is also written in C language, the program is small, fast. But now that the main developer of the NCSA WWW server has left NCSA, the server project has stalled. I believe you will not choose a no development of the WWW server software it!
Of course, because of its special historical status, I believe the people who use it are still quite a few. If you need to be able to get it in.

Apache
According to the survey conducted by the renowned WWW Server survey company, more than 50% of the world's
The WWW server is using Apache, the world's number one Web server.
The birth of Apache is very dramatic. When the NCSA WWW server project stopped, people who used the NCSA WWW server began exchanging their patches for the server, and they quickly realized that it was necessary to set up a forum to manage these patches. So, the Apache group was born, and then the group created Apache on the basis of NCSA.
The main features of Apache are:
. Can be run on all computer platforms;
. Support for the latest HTTP 1.1 protocol;
. Simple and powerful file-based configuration;
. Support Common Gateway Interface CGI;
. Support
. Support HTTP authentication;
. Integrated Perl scripting programming language;
. Integrated proxy server;
. have customizable server logs;
. Support for server-side include commands (SSI)
. Support for Secure Sockets Layer (SSL)
. The ability to track the user's session process;
. Support fastcgi;
. Supports Java Servlets.
Is there any reason why we should give up this powerful and promising WWW server software?
Third, the installation of Apache
Here we start a long journey to conquer the Apache, through step-by-step demand examples, step-by-steps to learn how to use Apache, from getting to proficient.
3.1 System Requirements
Running Apache does not require a lot of computing resources. It works well on Linux systems with 6-10MB hard disk space and 8MB RAM. However, just running Apache may not be the thing you want to do. More likely, you want to run Apache to provide the WWW service, start the CGI process, and take full advantage of all the amazing features that WWW can offer. In this case, you need to provide additional disk space and memory space that reflects the load requirements. In other words, if the WWW service is only started, it does not require a lot of system resources, but it requires more system resources to provide services to a large number of customers.
3.2 Getting the Software
You can get the latest version of Apache in. While almost all Linux distributions contain Apache software packages, you can also use them directly.
It should be noted that the Apache software package has two kinds: one is the source code, you need to recompile after downloading, and the other is executable files, download only after the decompression can be used.
3.3 Installing software
You can install the Apache server in the following three ways.
1. If you install the Linux version with Apache, in the selection of the server to be installed, will httpd this service selected, Linux installer will automatically complete the installation of Apache, and do a basic configuration.
2. Using executable packages, this is better for novice users who are not too familiar with the compilation process, because it is relatively simple.

Download Package apache_1.2.4.e.tar.gz

Tar xvzf apache_1.2.4.e.tar.gz
This completes the installation work, simple!
If you are using Redhat Linux, you can also download apache_1.2.4.rpm software ann
Pack and then install using the RPM–IVH apache_1.2.4.rpm command.
3. If you want to make the Apache server fully use, you must compile your own Apache
Customize its functionality.

Download a package containing Apache source code apache_1.2.4.tar.gz;

Then use the tar command to untie it;

The current directory is changed to the Apache source code distribution version of the SRC directory;

Copy the Configuration sample file (Configuration.tmpl) to the Configuration file;

To edit the configuration options in the configuration file:

Makefile Configuration options: Some compilation options:
. The "cc=" line specifies what compiler software compiles, generally "CC=GCC";
. If you need to assign additional flags (parameters) to the C compilation software, you can use:
extra_cflags=
extra_lflags=
. If your system requires special libraries and include files, you can specify them here:
extra_libs=
extra_includes=
. If you want to change the code optimization settings, you need to remove the following sentence
Then change to the value you need:
#OPTIM =-o2

Rule configuration options: Used to determine what functionality is required, generally without change.

Module configuration: The module is an Apache component that adds new functionality to the Apache kernel. By using the module configuration, you can customize what functionality is required on the Apache server, and this part is also the performance of Apache agility. The module configuration line looks like this:
Addmodule MODULES/STANDARD/MOD_ENV.O
If you need any functionality from the Apache server, add that module to the configuration file configuration with the Addmodule statement.
The following table lists the module features of Apache:
Module Name feature Default
Mod_access provides host-based access control command y
Mod_actions can run a CGI script based on MIME type or HTTP request method y
Mod_alias can perform URL redirection service y
Mod_asis enables documents to be sent to client Y without HTTP headers
Mod_auth supports the use of user names stored in text files, passwords to implement authentication Y
MOD_AUTH_DBM supports using dbm file to store basic HTTP authentication n
Mod_auth_mysql supports using MySQL database for basic HTTP authentication n
Mod_auth_anon allows anonymous access to areas that require authentication Y
Mod_auth_external supports the use of third party authentication n
Mod_autoindex dynamically catalog list y when the index file is missing
Mod_cern_meta provides support for meta information n
mod_cgi support for CGI y
Mod_dir is able to redirect any request to a command that does not include trailing slash characters
MOD_ENV enables you to pass environment variables to CGI or SSI scripts n
Mod_expires let you determine how Apache handles expires y when the server responds to the request
Mod_headers can manipulate HTTP answer header y
MOD_IMAP provides graphical mapping support n
Mod_include enables SSI N to support
Mod_info provides a comprehensive description of the server configuration y
Mod_log_agent allows the user agent's information to be stored in a separate log file n
Mod_log_config Support Log Y
Mod_log_referer provides the ability to write Referer headers in a request to the log
Mod_mime is used to provide the client with meta information about the document Y
Mod_negotiation provides support for content negotiation y
MOD_SETENVIF enables you to create custom environment variables Y
Mod_speling enables you to handle URL requests that contain misspellings or capitalization errors
Mod_status allows administrators to manage Apache y through the web
MOD_UNIQUE_ID provides a unique identifier for each request under very special conditions n
Table I: Apache module function List

Execute in the SRC directory: ". /configure ";

Compile Apache: Execute command "make";

Depending on the performance of the machine, after a 5-30-minute compilation, it is done.

Copy the compiled executable file httpd to the/etc/httpd/bin directory;

Copy the Apache Release configuration files: access.conf, httpd.conf, Mime.types, srm.conf files to the/etc/httpd/conf directory. So far, the installation is complete.
3.4 Some Notes
In red Hat Linux 6.0, Apache puts all of its own configuration files and log files under the "/etc/httpd" directory, where "/etc/httpd/conf" is the configuration file, and "/etc/httpd/log" is the log file.
At the same time, it will create a "/home/httpd" directory, and under its three subdirectories: "html/": In this directory to store HTML (home) file; "cgi-bin/": In this directory can be stored some CGI programs; "icons/" : In this directory is a server with some of the icons.
Related Article

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.