Article title: Easily configure Apache in RedHat8.0. 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.
Author: Lei Yuejun
Once upon a time, it was very painful to configure Apache in the Red Hat Linux release. However, after Red Hat 8.0 was launched, this situation became a historical issue. Now, configuring Apache HTTP Server in Red Hat has become very easy.
In Red Hat 8.0, the Apache HTTP Server has been upgraded to version 2.0, and the software package name has also changed to httpd. We can use the Apache HTTP configuration tool to easily configure. If you are used to the tools earlier than Red Hat, you will find that the tools in Red Hat 8.0 are easier to use.
Use GUI
The Apache HTTP configuration tool provides a graphical user interface that simplifies the configuration of the httpd. conf file on the Apache server. It can be configured with virtual hosts, log properties, and the maximum number of connections. To start the tool, take the following steps: Start> Server settings> HTTP Server; or start the tool from the prompt state by entering redhat-config-httpd.
Configuration overview
When configuring for the first time, you must first set the "main" page, as shown in 1. On the "VM" page, you can set the default VM. If you want to add multiple URLs or virtual host services, you can add them here. On the "servers" page, you can further change the server configuration. On the "adjust performance" page, you can set the connection.
[[The No.1 Picture.]
Figure 1 basic configurations
Once you are sure that all configurations can meet your needs, you can save these settings. Some basic configurations of Apache 1 are shown.
Important settings that cannot be ignored
Although the HTTP configuration tool makes Apache configuration easier, some important settings may be ignored during the configuration process. In order to avoid the trouble of finding and checking errors afterwards, you should perform further checks on the settings before saving them.
For example, in the server name text box on the "main" page, you must enter a complete legal domain name (that is, you must use it legally ). If no server name is specified, the Web server uses the system IP address. Of course, you can master it flexibly here. For example, although the actual DNS name is research. ge_domain.com, you can name the server www. ge_domain.com.
Next let's take a look at some key configurations on each page of the HTTP configuration tool.
1. "master" settings page
On this page, you must provide an email address for maintaining the Web server network management. The content of this entry must be consistent with the content indicated by ServerAdmin in the httpd. conf file. This email address is used to notify the system administrator of system problems in a timely manner. Generally, this system administrator is yourself. by default, this address is root @ localhost. Of course, you can also use a more user-friendly name, such as gexiaomin @ localhost.
2. available addresses
On the "master" settings page, the available address is also worth noting. here, you can define the port request that the server accepts. If you look at the httpd. conf file, you will find that the content is indicated by Listen. By default, Red Hat's HTTP server listens on port 80. To change this setting, click the "add" button on the right to open a window as shown in figure 2. In this window, you can define other ports that can accept requests. you can choose to allow the server to listen to all addresses or specify a special IP address. To avoid DNS lookup errors, I use an IP address to replace the domain name. If there are still errors, you can make some changes to the content.
[[The No. 2 Picture.]
Figure 2 available addresses
3. VM page
On the VM page (as shown in Figure 3), you can change some default settings of Web servers. You can also set different servers to correspond to different IP addresses, host names, or ports on the same Linux server. A default virtual host (4) is defined here, but it can be modified as needed. For more information, see The Apache homepage at http://httpd.apache.org/docs-2.0/vhosts /.
[[The No. 3 Picture.]
Figure 3 VM page
[[The No. 4 Picture.]
Figure 4 VM attributes
4. "server" page
On this page, you can change some basic settings of the server (see figure 5 ). However, these settings are generally appropriate, so you do not need to change them. Note that, unless you are very familiar with what you are doing, do not set "user" as root, because this may cause a large security vulnerability on the server.
[[The No. 5 Picture.]
Figure 5 "server" configuration page
5. "adjust performance" page
This page allows you to set the connection of the Apache HTTP Server client (6 ). Generally, the default settings can meet all requirements. Therefore, we recommend that you do not change these parameters if you do not have any special requirements. Note that all the settings changed here will directly affect the server performance. In addition, the maximum number of connections here cannot exceed 256 unless you re-compile the Apache software. The settings here correspond to MaxClients in httpd. conf.
[[The No. 6 Picture.]
Figure 6 "performance adjustment" page
In addition, if you select "allow persistent connections" and enter a large number, the server may suffer from performance degradation due to waiting. If you feel that the system is obviously slowing down, the setting here is the first place to be viewed.
Test results
After confirming that all the configurations are correct, click "OK" and select "yes" to save the configuration. If you want to cancel the configuration, click cancel. Once saved, the configuration will be saved to/etc/httpd/conf/httpd. conf, and the changes will overwrite the original content.
Although the GUI is very convenient, it is necessary to understand the content of the httpd. conf file. Now a complete Apache server has been set up. run the following command. Figure 7 shows the running effect. here I set the homepage to a homepage developed not long ago.
[[The No. 7 Picture.]
Figure 7 Apache running effect
Conclusion
Through the above introduction, you may have discovered that it is not as difficult to configure a Web server as you think. In fact, the development of open source software has become very mature in terms of both performance and ease of use. this is also why it is becoming increasingly popular.
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.