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 method of installing Apache on Linux platform

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

Editor to share with you how to install Apache on the Linux platform, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

One: what is Apache

Apache is an extraordinary application. It is the most widely used Web server application in the world and accounts for more than 50% of the commercial Web server market. Apache is the most widely used Web server application in Unix-like operating systems, which can be used on almost all platforms, such as Windows and so on. Apache is named after Native's American tribe Apache and is known for its war and strategy-making skills.

Apache is a process-based modular Web server application that creates a new thread with each simultaneous connection. It supports many functions; many of them are compiled into separate modules and extend their core functions, and provide everything from server-side programming language support to authentication mechanisms, allowing a single Apache Web server to serve many different Web sites.

Second: how to install Apache

There are many ways to install software packages or applications. Here are the installers:

One of the features of open source Web applications is that anyone can create an installer according to their own environment, which enables various vendors such as Debian,Red Hat,FreeBSD,Suse to customize the file location and configuration of apache, taking into account other installed applications and basic operating systems.

In addition to installing it from a vendor-based installer, you can always choose to build and install from source code, where Apache is a separate platform for all operating systems.

Apache Web server is a modular application, and administrators can choose the required functions and install different modules according to their own requirements. All modules can be compiled as dynamic shared objects that exist separately from the master apache file, and we strongly recommend using the DSO method, which makes it easy to add / remove / update modules from the server configuration.

Third, install Apache on the Linux platform:

Using rpm based on the Linux distribution (RedHat Package Manager is the utility for installing applications on Linux systems), namely RedHat, Fedora,CentOs,Suse, you can install the application through the vendor-specific package manager or build the rpm file directly from the available source tarball.

You can install Apache through the default package manager available on all Red Hat-based distributions, such as CentOs,Red Hat and Fedora.

[root @ amsterdam~] # yum install httpd

You can use the following command to convert the apache source tarball to an rpm file.

[root @ amsterdam~] # rpmbuild-tb httpd-2.4.x.tar.bz2

The-devel package must be installed on the server to create an .rpm file from the source code.

After converting the source file to the rpm installer, you can install Apache using the following command.

[root @ amsterdam~] # rpm-ivh httpd-2.4.4-3.1.x86_64.rpm

The server does not start automatically after installation, in order to start the service, you must use any of the following commands on Fedora,CentOs or Red Hat.

[root @ amsterdam~] # / usr / sbin / apachectl start [root @ amsterdam~] # service httpd start [root @ amsterdam~] # / etc / init.d / httpd start

Install Apache from Source

Installing apache from the source requires the-devel package to be installed on the server. You can find the latest version of Apache, which you can download here. After downloading the source file, move it to the / usr / local / src folder.

[root @ amserversterdam~] cd / usr / local / src [root @ amserversterdam~] gzip-d httpd-2.2.26.tar.gz [root @ amserversterdam~] tar xvf httpd-2.2.26.tar [root @ amserversterdam~] httpd-2.2.26

To see all the configuration options available to Apache, you can use the. / configure-help option. The most common configuration option is-prefix = {install directory name}.

[root @ amserversterdam~]. / configure-- help [root @ amserversterdam~]. / configure-prefix = / usr / local / apache-enable-so [root @ amserversterdam~] make [root @ amserversterdam~] make install

The above example shows compiling Apache in the / usr / local / apache directory using the DSO function. The enable-so option allows the required modules to be loaded into apache at run time through the DSO mechanism without recompilation.

After the installation is complete, you can browse the default page of the Web server using your favorite browser. If a firewall is enabled on the server, port 80 must be excepted on the operating system firewall. You can open port 80 using the following command.

Iptables-I INPUT-p tcp-- dport 80-j ACCEPT. The above is all the contents of the method of installing Apache on the Linux platform. Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

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