Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The first pop of Linux powered Apache service (simple build and port based)

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

Apache HTTP Server (abbreviated as Apache) is an open source web server of the Apache Software Foundation, which can run in most computer operating systems. Because of its multi-platform and security, it is one of the most popular Web server-side software. It is fast, reliable and can compile interpreters such as Perl/Python into the server through a simple API extension. Apache HTTP server is a modular server, derived from NCSAhttpd server, after many modifications, it has become the number one Web server software in the world.

It can run on almost all widely used computer platforms.

Apache originates from NCSAhttpd server and has become one of the most popular Web server software in the world after many modifications. Apache is taken from the pronunciation of "a patchy server", which means a server full of patches. Because it is free software, people are constantly developing new features, new features, and fixing old defects for it. Apache is characterized by simplicity, high speed, stable performance, and can be used as a proxy server.

Originally, it is only used for small or experimental Internet networks, and then gradually expanded to a variety of Unix systems, especially the support for Linux is quite perfect. Apache has a variety of products that can support SSL technology and support multiple virtual hosts. Apache is a process-based structure, and processes consume more system overhead than threads, so it is not suitable for multiprocessor environments. Therefore, when an Apache Web site is expanded, it is usually to add servers or cluster nodes rather than processors. By far, Apache is still the most used Web server in the world, with a market share of about 60%. Many famous websites in the world, such as Amazon, Yahoo!, W3 Consortium, Financial Times and so on, are the products of Apache. Its success mainly lies in its open source code, an open development team, support for cross-platform applications (which can run on almost all Unix, Windows, Linux system platforms) and its portability.

The birth of Apache is very dramatic. When the NCSAWWW server project came to a standstill, people who used the NCSAWWW server began to exchange patches for the server, and they quickly realized that it was necessary to set up a forum to manage these patches. In this way, Apache Group was born, and the group later created Apache based on NCSA.

Here the blog will briefly introduce some of the configurations of Apache.

First install the Apache package using yum-y install httpd.

Confirm the location of the configuration file after the installation is complete.

The configuration file path is / etc/httpd/conf/httpd.conf, and the default site is / var/www/html. After the software is installed, we will create a virtual host.

Detailed explanation of the main configuration files

# address and port of the web page

Address of DocumentRoot "/ var/www/html/demo" # site

ServerName www.demo.com # website domain name

ErrorLog "logs/www.demo.com.error_log" # error log file path

# normal log file path

CustomLog "logs/www.demo.com.access_log" common # common must be added

# Control of the site

Require not ip 192.168.220.131 # denies access to this IP address

Require all granted # allows all other IP access, if not

If you refuse, write directly and allow all

It has a default site for creating configuration files for users, and the conf.d directory under the installation directory, so we need to write our own configuration files under this directory.

The following is the configuration file for a new website that has just been written.

After the configuration file is written and the virtual host is created, the next step is to create a corresponding site directory.

Then find the main configuration file, / etc/httpd/conf/httpd.conf, and find which line in the box below to remove the previous comments.

Then use the systemctl start httpd command to start the Apache service. And turn off the firewall.

Open the browser to enter the address of the website and find the default home page. This is why, because you just did not create a home page in the site you just created. Next, create a home page label.

Create a home page in the site, note that the name of the home page must be index.html, and then write something on it.

Next, refresh the web page, and what you just wrote will be displayed. Up to now is a simple Apache website construction.

Create two or more websites based on port and the same IP address.

Add a listening port 8080 above the main configuration file.

Next, create a site for a new website and check if there is something wrong with the grammar.

After the syntax is fine, create a new home page in the new site with This is abc web. Then restart the service.

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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report