In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "how to install apache on CVM". Interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to install apache on a CVM.
1) copy apr and apr-util libraries
Here is the Bug of Apache 2.4. we must manually copy the three libraries apr, apr-util, and pcre in order to install Apache 2.4 correctly. Cp-r / usr/local/src/apr-1.4.6 / usr/local/src/httpd-2.4.7/srclib/aprcp-r / usr/local/src/apr-util-1.4.1 / usr/local/src/httpd-2.4.7/srclib/apr-util# these two packages need to be unzipped first, then renamed and copied to the specified location
2) install pcre source code package
Pcre is a library of regular expression functions written in C, and Apache and PHP use pcre regular expression rules by default.
[root@localhost gd-2.0.35] # cd / usr/local/src/pcre-8.34# enter the unzipped directory [root@localhost pcre-8.34] #. / configure# pre-compilation configuration [root@localhost pcre-8.34] # make# compilation [root@localhost pcre-8.34] # make install# compilation installation
3) enter the directory extracted by Apache
[root@localhost pcre-8.34] # cd / usr/local/src/ httpd-2.4.7
4) pre-compilation configuration
[root@localhost httpd-2.4.7] #. / configure\ # pre-compile configuration-- prefix=/usr/local/apache2/\ # specify the Apache installation directory-- sysconfdir=/usr/local/apache2/etc/\ # specify the Apache configuration file save directory-- with-included-apr\ # use a copy of the bundled APR/APR-Util-- enable-so\ # compile-- enable as a dynamic shared object (DSO) -deflate=shared\ # enable modules supported by small transport programmers-- enable-expires=shared\ # generate HTTP header information that fails and hides control according to the user's special settings-- enable-rewrite-shared # module that starts the rewrite function
The Apache here is compiled dynamically, so is there a static compilation? Of course, static compilation is to put the module of Apache directly into Apache, and if Apache needs to call this module, it can be called directly. This method installs Apache with better performance and faster speed, but if you need to load new modules, you need to recompile and install Apache.
If you compile dynamically, instead of putting the module directly into the Apache, you put the location of the module into the Apache. If Apache needs to call the module, you need to go to the specified location to find it yourself, and the performance is slightly worse than that of static mode. But if you need to load a new module, you don't have to reinstall Apache, you can load the new module dynamically. The more common compilation method is dynamic compilation, so we use dynamic compilation during the installation process.
5) compile and compile installation
[root@localhost httpd-2.4.7] # make [root@localhost httpd-2.4.7] # make install
6) start Apache and test it
[root@localhost httpd-2.4.7] # / usr/local/apache2/bin/apachectl start# starts Apache [root @ localhost httpd-2.4.7] # netstat-tlun | grep 80tcp 00 netstat 80:: * LISTEN#80 port has been started, indicating that Apache has been started
Next, we need to use a browser to test whether the Apache server is accessible, just type "http://IP"" in the URL (uniform Resource location, that is, the address bar), as shown in the following figure.
If you see "It works!" Indicates that the Apache server is working properly
7) set Apache to boot automatically
We need to ensure that Apache starts normally every time we boot, so we also need to set the auto-boot command as follows:
[root@localhost httpd-2.4.7] # vi / etc/rc.local/usr/local/apache2/bin/apachectl start# adds the Apache startup command in the rc.local file to this point. I believe you have a better understanding of "how to install apache on CVM". 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.