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 Plain copy print?
- 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 Plain copy print?
- 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 Plain copy print?
- ./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 Plain copy print?
- 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 Plain copy print?
- ./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 Plain copy print?
- ./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 Plain copy print?
- 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 Plain copy print?
- ./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 Plain copy print?
- ./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).
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!!!
Original address: http://blog.csdn.net/bob007abc/article/details/8281630
Install Apache environment on Linux and installation process error solution (0 initial environment)