In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-11 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains the steps of setting up Web server under Linux. Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Now let the editor take you to learn the steps of setting up a Web server under Linux.
Today we will take a look at how to set up the Web server under the Linux system.
There are three common ways in LINUX system: CERN, NCSA and Apache. Generally, the most commonly used method is to use Apache. This method has obvious characteristics, concise configuration and maximum system compatibility. The following is the whole process of configuring a Linux-based WEB server in this way.
I. the Apache server describes briefly.
Its features are remarkable: it can run on all computer platforms, including UNIX/LINUX system naturally; integrate proxy server and Perl programming script; track the access session process of users; customize the server log; also support virtual host and HTTP authentication and so on. Coupled with the strength of the LINUX system itself, there is no reason not to choose Apache.
Two. Install Apache.
Generally speaking, all Linux versions should contain the installation of this software package. If you are not installing this package on the Linux system, you can find the installation file from the installation CD or on the http://www.apache.org/ website (note that there are two versions online: one is the source code that needs to be recompiled after download, the other is the executable file that can be used simply by unzipping it), and then perform the installation.
1. If you download an executable package such as: apache_1.2.4.e.tar.gz (the number in which depends on the version you download, this is an example), then this is relatively simple and more suitable for beginners who are not familiar with Linux compilation, just execute: tar xvzf apache_1.2.3.4.tar.gz to complete the installation.
two。 If you download source code such as apache_1.2.4.rpm, first install it with rpm-ivh apache_1.2.4.rpm, then execute ". / configure" in the src directory; then execute the "make" command to compile Apache;, and then copy the compiled executable file to the / etc/httpd/bin directory Then copy the Apache configuration files: httpd.conf, access.conf, srm.conf, and mime.types to the / etc/httpd/conf directory to complete the installation.
3. Configure Apache to implement WEB service.
In fact, by now your Linux has started WEB service, all you need to do is connect the Linux system to the Internet, and then store the home page in the "/ home/httpd" directory. But in order to make this WEB server work more efficiently, we still need to make some settings for it, and what we need to configure is actually the four files we just copied. Here are some explanations for its two main configuration files, httpd.conf and access.conf:
1. Httpd.conf.
This file is the main configuration file and is mainly used to set up the basic environment in which the server starts, that is, it is responsible for arranging how the WEB server runs. The relevant setting parameters are:
ServerType standalone/inetd: the purpose of this option is to specify how to run the WEB server. The standalone parameter indicates that the WEB service process listens for requests from clients in the background in the way of a separate waiting process, and if so, generates a child process to serve it; it is more efficient. The main thing is to set the specific port address that the master server process listens to: Port [number] (default is 80).
Inetd mode is more secure than standalone, which is the default way for RedHat Linux to run Apache. If your version is not RedHat, you need to add the following new line to the / etc/inetd.conf file: httpd stream tcp nowait httpd/ etc/httpd/bin/httpd-f / etc/httpd/conf/httpd.conf; and then add a new line to the / etc/services file: httpd 80/tcp httpd.
ErrorLog: used to specify the file name and path of the error record. Format such as: ErrorLog / var/httpd/error.log.
ServerRoot: used to specify where to store the server's configuration and log files. Format such as: ServerRoot / etc/httpd.
Server Admin: sets the E-Mail address of the WEB administrator. Format such as: Server Admin XXX@XXXX.com.
2. Srm.conf
This is the Apache resource configuration file, which is used to tell the server which resources you want to provide on the WWW site and how to provide them. The main parameters are:
DocumentRoot: used to specify the address of the main document. Format such as: DocumentRoot / home/httpd/html.
DirectoryIndex: like the IIS setting for the windows platform, it is used to specify the name of the home page file. As we all know, the home page usually takes "index.html" or "index.htm" as the file name. When set to these two file names, whenever the user issues a WEB request, the home page named "index.html" or "index.htm" is called. Format such as: DirecotryIndex index.html index.htm.
After the above simple configuration, your WEB server already has the basic functions. The next thing to do is to restart the WEB service to make the configuration take effect, which we can do with the following command:
/ etc/rc.d/init.d/httpd restart
Finally, let's look at the security aspects of Apache services. The Apache server can control which hosts can access certain sites through the authentication system. Specifically, it is achieved in two ways:
One is based on host address authentication, but since most Internet users use dynamic addresses at present, this method does not have much practical significance.
Another way is based on user name / password authentication, it goes without saying that this method is more suitable for today's network conditions, but for the specific user name / password authentication implementation, is not within the scope of this article, you can refer to the relevant materials for further study.
At this point, I believe you have a deeper understanding of the "steps for setting up Web servers under Linux". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.