There was an error compiling Apache today:
#./configure--prefix ... When checking the editing environment, it appears:
Checking for APR ... no
Configure:error:APR not found. Please read the documentation
Workaround:
1. Download the required packages:
- wget http://archive.apache.org/dist/apr/apr-1.4.5.tar.gz
- wget http://archive.apache.org/dist/apr/apr-util-1.3.12.tar.gz
- wget Http://jaist.dl.sourceforge.net/project/pcre/pcre/8.10/pcre-8.10.zip
2. Compile and install:
- Yum Remove apr-util-devel Apr apr-util-mysql apr-docs apr-devel apr-util Apr-util-docs
The steps are as follows:
A: Solve Apr not found problem >>>>>>
- [Email protected] test]# TAR-ZXF apr-1.4.5.tar.gz
- [Email protected] test]# CD apr-1.4.5
- [Email protected] apr-1.4.5]#/configure --prefix=/usr/local/apr
- [[email protected] apr-1.4.5]# make && make install
B: Solve apr-util not found problem >>>>
- [Email protected] test]# TAR-ZXF apr-util-1.3.12.tar.gz
- [Email protected] test]# CD apr-util-1.3.12
- [Email protected] apr-util-1.3.12]#/configure --prefix=/usr/local/apr-util-with- apr=/usr/local/apr/bin/ Apr-1-config
- [[email protected] apr-util-1.3.12]# make && make install
C: Solve pcre problem >>>>>>>>>
- [[email protected] test] #unzip-o pcre-8.10.zip
- [[email protected] test] #cd pcre-8.10
- [Email protected] pcre-8.10]#./configure --prefix=/usr/local/pcre
- [[email protected] pcre-8.10] #make && make install
4. When you finally compile Apache, add:
--WITH-APR=/USR/LOCAL/APR \
--with-apr-util=/usr/local/apr-util/\
--with-pcre=/usr/local/pcre
Successful compilation completed ~
Note: to start from scratch, do not be too experienced in the middle of various eggache problems!
One. Download Apache source code
1.: http://httpd.apache.org/download.cgi Find stable Latest version (Stable release)
Get File httpd-2.4.3.tar.gz
2. upload to your server directory, such as:/home/tnuser/installers
Decompression: TAR-ZXVF httpd-2.4.3.tar.gz (We downloaded the source code, so this step just extract the source code)
Move the extracted directory to the destination address: mv/home/tnuser/installers/httpd-2.4.3/home/tnuser/(This step just put the extracted directory in the appropriate location for easy management, can not do)
3. Next we need to compile the source files just extracted, which is the focus
Configure some of the parameters at compile time:
[Plain]View Plaincopy
- cd/home/tnuser/installers/httpd-2.4.3 (switch to Apache source code directory)
- ./configure--prefix=/home/tnuser/apache/(set Apache installation directory, where/home/tnuser/apache/is the real installation directory of Apache)
Two. When you get here, enter to run the command, error:
( If you are able to perform normally, you have previously installed Apache environment, please direct make & make install and skip the following paragraph )
Checking for APR ... no
Configure:error:APR not found. Please read the documentation.
Solution:
Apache needs some preparation environment for installation, and there is a need to install another thing APR (Apache portable Runtime).
: http://archive.apache.org/dist/apr/also find the latest version
Get file: apr-1.4.6.tar.gz
Decompression: TAR-ZXVF apr-1.4.6.tar.gz
Compile:
[Plain]View Plaincopy
- cd/home/tnuser/installers/apr-1.4.6
- ./configure--prefix=/home/tnuser/apr/(a heap of log information)
- Make (a bunch of log messages)
- Make install (a bunch of log messages)
Generate directories and files at the specified address after completion
Then install Apache and switch to the source code directory to set the compilation parameters:./configure--prefix=/home/tnuser/apache/
Or the above error, this is because the above to customize the APR installation directory, so you have to tell Apache this information.
The correct Run command is:
[Plain]View Plaincopy
- ./configure--prefix=/home/tnuser/apache/--with-apr=/home/tnuser/apr/
Three. Continue to error after execution
But this time the error message becomes: (It doesn't matter, it means your APR is installed, but also found that there is less another environment, slowly)
Checking for Apr-util ... No
Configure:error:apr-util not found. Please read the documentation.
solution: Download Apr-util
: http://archive.apache.org/dist/apr/Find the latest version
Get file: apr-util-1.5.1.tar.gz
Decompression: TAR-ZXVF apr-util-1.5.1.tar.gz
Compile:
[Plain]View Plaincopy
- cd/home/tnuser/installers/apr-util-1.5.1
- ./configure--prefix=/home/tnuser/apr-util/
This operation will be error:
Checking for APR ... no
Configure:error:APR could not being located. Use the--WITH-APR option.
See the hint you understand, not much said:
[Plain]View Plaincopy
- ./configure--prefix=/home/tnuser/apr-util/--with-apr=/home/tnuser/apr/
- Make
- Make install
The build directory on the installation address you specified indicates that the installation was successful.
Four. Go back and continue installing Apache.
With the last experience, you will know what commands to run this time. Cut to Apache source code directory to run:
[Plain]View Plaincopy
- ./configure--prefix=/home/tnuser/apache/--with-apr=/home/tnuser/apr/--with-apr-util=/home/tnuser/apr-util/
Usual Error:
Checking for pcre-config ... false
Configure:error:pcre-config for Libpcre not found. PCRE is required and available from http://pcre.org/
Solution: Find or less environment, not much to say, download PCRE
: Http://jaist.dl.sourceforge.net/project/pcre/pcre/Find the latest version
Get file: pcre-8.32.tar.gz
Decompression: TAR-ZXVF pcre-8.32.tar.gz
Compile:
[Plain]View Plaincopy
- cd/home/tnuser/hunter/installers/pcre-8.32
- ./configure--prefix=/home/tnuser/pcre/
This error message is as follows:
Checking for windows.h ... no
Configure:error:You need a C + + compiler for C + + support.
The original pcre needs to be compiled in C + + (I just want to say: why I need C + + while I ' m a Java programmer? eggache! Holy shit!)
Solution:
First, differentiate whether your system is Debian or fedora.
My system is fedora, so the configuration steps are as follows: (Debian system using command apt-get, corresponding toolkit for build-essential, command usage: Apt-get install build-essential)
sudo yum groupinstall "Development Tools"
It will take a long time to install things, and the middle will let you choose whether to install, enter Y on the line.
When the download process is complete, it will be installed automatically and finally see complete! It's over.
Come back and you have to continue installing pcre Ah, go:
[Plain]View Plaincopy
- ./configure--prefix=/home/tnuser/pcre/
- Make
- Make install
The installation succeeds in order to eventually generate the corresponding directory in the target location.
At this point, the Eggache Apache preparation environment is even done.
Five. To continue Apache installation, be sure to bring the above 3 environment configurations in the parameters:
[Plain]View Plaincopy
- ./configure--prefix=/home/tnuser/apache/--with-apr=/home/tnuser/apr/--with-apr-util=/home/tnuser/apr-util/-- With-pcre=/home/tnuser/pcre/
Chunk of log, finally no error (only tears thousand lines ah ...) Tears thousand lines ... )
Make
Make install
Six. Last Test Apache:
Cd/home/tnuser/apache/bin
apachectl -k start
If not, check for problems such as the end port conflict (typically conflict with the system's own httpd service port).
Error after startup:
Many of the errors we have one by one to solve
First, the first error function,
Workaround:
Edit the httpd.conf file and then modify the ServerName www.example.com:80 to ServerName localhost:80
Look, that name is hard to find.
Looking at the second solution to an error:
Start well, visit your Apache and see the Classic
It works!
Closed with: Apachectl-k stop
Seven. Appendix:
http://apache.jz123.cn/install.html Chinese version of the official compilation and installation tutorial
Code Finish!!!
CentOS encountered an ARP not found workaround when installing the apache2.4 version