In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
Today, I would like to share with you the relevant knowledge about how to deploy apache server under Centos6.6. The content is detailed and the logic is clear. I believe most people still know too much about this, so share this article for your reference. I hope you can get something after reading this article. Let's take a look at it.
Install the compilation environment install the developer toolset yum groupinstall 'Development tools' install only the tools you need
Because my virtual machine is installed by mini, the yum source with aliyun is slow to download, so just install a gcc.
Yum install gcc download source package download httpd
If the default image download is too slow, you can select another domestic image in the red box.
Execute the following command to download the source code package to Linux and extract it
Wget https://mirrors.tuna.tsinghua.edu.cn/apache//httpd/httpd-2.4.27.tar.gztar-xf httpd-2.4.27.tar.gz download apr and apr-util
Apr is the abbreviation of Apache Portable Runtime, which is translated into Chinese for Apache portable runtime environment, which is necessary for httpd, and apr-util is the same.
Download address of apr and apr-util: http://apr.apache.org/download.cgi
Execute the following command:
Wget https://mirrors.tuna.tsinghua.edu.cn/apache//apr/apr-1.6.2.tar.gzwget https://mirrors.tuna.tsinghua.edu.cn/apache//apr/apr-util-1.6.0.tar.gztar-xf apr-1.6.2.tar.gztar-xf apr-util-1.6.0.tar.gz begins to compile first compile aprcd apr-1.6.2./configure-- prefix=/usr/local/apr16 / / specify installation location make & & make install compile apr-utilcd apr-util-1.6.0./configure-- with-apr=/usr/local/apr16/-- prefix=/usr/local/apr16-util / / specify the directory where apr is located and the apr-util installation directory make & & make install
An error will be reported here, as shown below
Xml/apr_xml.c:35:19: error: expat.h: No such file or directory / / Note this line, indicating that there is no expat.h header file xml/apr_xml.c:66: error: expected specifier-qualifier-list before 'XML_Parser'. Forcibly omit. Xml/apr_xml.c: In function 'do_parse':xml/apr_xml.c:434: error:' apr_xml_parser' has no member named 'xp'. Don't look at me. Xml/apr_xml.c:500: error: 'apr_xml_parser' has no member named' xp_err'make [1]: * * [xml/apr_xml.lo] Error 1make [1]: Leaving directory `/ root/apr-util-1.6.0'make: * [all-recursive] Error 1
Expat is a program that parses XML. Do you want to execute yum install expat-devel immediately?
However, I can tell you, but not eggs!
Both version 2. 0 in the base library and version 2. 1 in the epel library will report errors when compiling httpd later!
So we went to expat's website to download the latest version of expat.
Cd ~ wget https://nchc.dl.sourceforge.net/project/expat/expat/2.2.3/expat-2.2.3.tar.bz2tar-xf expat-2.2.3.tar.bz2cd expat-2.2.3./configure-- prefix=/usr/local/expat23make & & make install
Now you can recompile apr-util
Cd ~ cd apr-util-1.6.0./configure-- with-apr=/usr/local/apr16/-- with-expat=/usr/local/expat23/-- prefix=/usr/local/apr16-utilmake clean / / because it has been compiled once, delete those compiled things just to be on the safe side Although in theory it does not affect make & & make install compilation httpdcd ~ cd httpd-2.4.27./configure-- prefix=/usr/local/httpd24-- sysconfdir=/etc/httpd24-- with-mpm=prefork-- enable-mpms-shared=all-- enable-mods-shared=most-- with-apr=/usr/local/apr16-- with-apr-util=/usr/local/apr16-util/
An error will be reported at this stage, indicating that we do not have pcre installed. The error is as follows:
Configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/
Just execute yum install pcre-devel.
. / configure-prefix=/usr/local/httpd24-- sysconfdir=/etc/httpd24-- with-mpm=prefork-- enable-mpms-shared=all-- enable-mods-shared=most-- with-apr=/usr/local/apr16-- with-apr-util=/usr/local/apr16-util/make & & make install
Here is an explanation of the options used:
Prefix=/usr/local/httpd24: do you need to say more about configuring the installation directory? Sysconfdir=/etc/httpd24: specify the directory where the configuration files are stored, which are stored in the installation directory by default with-mpm=prefork: default mpm is preforkenable-mpms-shared=all: compile all mpm into .so modules enable-mods-shared=most: compile most modules into .so files with-apr=/usr/local/apr16: specify the directory where apr is located with-apr-util=/usr/local/apr16-util/: specify the directory where apr-util is located, test the new version of httpd
First, add the bin directory of httpd2.4.27 to the PATH environment variable to execute the command ~
Echo "export PATH=$PATH:/usr/local/httpd24/bin" > > / etc/profile.d/httpd.shsource / etc/rc.local
Simply execute the following command to start the service and test:
Apachectl start
Open the browser-> visit 192.168.123.233-> see the following figure indicating the successful installation
Report an error as mentioned above
Well, I didn't recreate the wrong scene... .
If you encounter an error similar to the following, you can compile expat by yourself
Libaprutil-1.so: undefined reference to `XML_GetErrorCode'
Add modules that are not enabled at compile time
1. Enter the modules/proxy directory of the apache source code 2. Run the following command to automatically compile, install, and modify the httpd.conf file to activate the mod_proxy module: apachepath/bin/apxs-c-I-a mod_proxy.c proxy_util.capachepath/bin/apxs-c-I-a mod_proxy_http.c proxy_util.c option description:-c performs compilation operation-I installation operation, installs one or more dynamic shared objects to the server's modules directory-an automatically adds a LoadModule line to the httpd.conf file To activate this module,-An is similar to-an if this line exists, but the additional LoadModule line is preceded by the pound sign prefix (#)-e that needs to be edited, which can be used with the-an and-An options, similar to the-I operation, modify the httpd.conf file, but do not install this module 3. Restart apache. These are all the contents of the article "how to deploy apache servers under Centos6.6". Thank you for reading! I believe you will gain a lot after reading this article. The editor will update different knowledge for you every day. If you want to learn more knowledge, please pay attention to 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.
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.