Tag: Compile and install Apache
Apache full name: Apache Http Server is one of the most powerful Web server-side software.
The simple compile and install steps are as follows: Take Centos7 as an example
The first step:
Prepare the Development Kit components: Deve lopment Tools (can be installed using Yum install Deven lopment tools); pcre* openssl*
Part II:
download Apache source package tar.bz2 or tar.gz format from official website (wget http://mirrors.hust.edu.cn/apache//httpd/httpd-2.4.29.tar.bz2 ) Download to current directory
Use decompression to make the command: Tar zxf httpd-2.4.29.tar.bz2
CD into httpd-2.4.29.tar.bz2
Step Two:
Before executing./configure It is recommended to read the Readme and install files or./configure--help to see their supported feature options and their parameters; The production environment can specify functions as needed. This is the test environment, so we simply need to specify the installation directory and configuration file installation location;
./configure--prefix=/usr/local/apache2--sysconfdir=/etc/apache2
Here the error is missing "APR" This package is usually missing is-devel package directly with Yum-list "apr*" and then yum-y install apr-devel directly installed;
[Email protected]/app/httpd-2.4.29 139]#./configure--prefix=/usr/local/apache2--sysconfdir=/etc/apache2
Checking for chosen layout ... Apache
Checking for working mkdir-p ... yes
Checking for grep that handles long lines and-e .../usr/bin/grep
Checking for egrep .../usr/bin/grep-e
Checking build system Type ... X86_64-pc-linux-gnu
Checking host system Type ... X86_64-pc-linux-gnu
Checking target system Type ... X86_64-pc-linux-gnu
Configure
Configure:configuring Apache Portable Runtime Library ...
Configure
Checking for APR ... yes
Setting CC to "GCC"
Setting CPP to "GCC-E"
Setting CFLAGS to "-pthread"
Setting Cppflags to "-dlinux-d_reentrant-d_gnu_source"
Setting Ldflags to ""
Configure
configure:configuring Apache Portable Runtime Utility Library ...
Configure
Checking for Apr-util ... Yes
Checking for gcc ... gcc
Checking whether the C compiler works ... yes
Checking for C compiler default output file name ... a.out
Checking for suffix of executables ...
Checking whether we is cross compiling ... no
Checking for suffix of object files ... o
Checking whether we are using the GNU C compiler ... yes
Checking whether GCC accepts-g ... yes
Checking for GCC option to accept ISO C89 ... none needed
Checking how to run the C preprocessor ... gcc-e
Checking for GCC option to accept ISO C99 ...-std=gnu99
Checking for pcre-config .../usr/bin/pcre-config
configure:using External PCRE Library From/usr/bin/pcre-config
Setting Pcre_includes to ""
Setting Pcre_libs to "-lpcre"
Configure
Configure:configuring Apache httpd ...
Configure
Setting includes to "-I."
Adding "-i$ (top_srcdir)/os/$ (Os_dir)" to includes
Adding "-i$ (top_srcdir)/include" to includes
Adding "-i/usr/include/apr-1" to includes
Configure
Configure:applying os-specific hints for httpd ...
Configure
Forcing Single_listen_unserialized_accept to "1"
Forcing Ap_nonblock_when_multi_listen to "1"
Checking for RM ... /usr/bin/rm
Checking for pkg-config .../usr/bin/pkg-config
Checking for rsync .../usr/bin/rsync
Config.status:creating docs/conf/extra/httpd-ssl.conf
Config.status:creating docs/conf/extra/httpd-userdir.conf
Config.status:creating docs/conf/extra/httpd-vhosts.conf
Config.status:creating docs/conf/extra/proxy-html.conf
Config.status:creating include/ap_config_layout.h
Config.status:creating Support/apxs
Config.status:creating Support/apachectl
Config.status:creating Support/dbmmanage
Config.status:creating SUPPORT/ENVVARS-STD
Config.status:creating Support/log_server_status
Config.status:creating support/logresolve.pl
Config.status:creating support/phf_abuse_log.cgi
Config.status:creating Support/split-logfile
Config.status:creating build/rules.mk
Config.status:creating Build/pkg/pkginfo
Config.status:creating build/config_vars.sh
Config.status:creating include/ap_config_auto.h
config.status:executing default Commands
Configure:summary of Build options:
Server version:2.4.29
Install prefix:/usr/local/apache2
C compiler:gcc-std=gnu99
CFLAGS:-pthread
Cppflags:-dlinux-d_reentrant-d_gnu_source
Ldflags:
LIBS:
C PREPROCESSOR:GCC -E (output information too much intercept part check installation environment Configure script)
Step three: Start compiling the execution mak
Dules-module-avoid-version Mod_rewrite.lo
MAKE[4]: Leaving directory '/app/httpd-2.4.29/modules/mappers '
MAKE[3]: Leaving directory '/app/httpd-2.4.29/modules/mappers '
MAKE[2]: Leaving directory '/app/httpd-2.4.29/modules '
MAKE[2]: Entering directory '/app/httpd-2.4.29/support '
MAKE[2]: Leaving directory '/app/httpd-2.4.29/support '
MAKE[1]: Leaving directory '/app/httpd-2.4.29 '
There is too much output information to intercept the section. This step does not prompt the error next you can execute the next command
Fourth Step:
Makeinstall (This step is basically a CP file to each directory)
Installing configuration Files
Mkdir/etc/apache2
Mkdir/etc/apache2/extra
Mkdir/etc/apache2/original
Mkdir/etc/apache2/original/extra
Installing HTML Documents
Mkdir/usr/local/apache2/htdocs
Installing Error documents
Mkdir/usr/local/apache2/error
Installing icons
Mkdir/usr/local/apache2/icons
Mkdir/usr/local/apache2/logs
Installing CGIs
Mkdir/usr/local/apache2/cgi-bin
Installing header Files
Mkdir/usr/local/apache2/include
Installing build System files
Mkdir/usr/local/apache2/build
Installing man pages and online manual
Mkdir/usr/local/apache2/man
Mkdir/usr/local/apache2/man/man1
Mkdir/usr/local/apache2/man/man8
Mkdir/usr/local/apache2/manual
MAKE[1]: Leaving directory '/app/httpd-2.4.29 '
Compile the installation is basically finished; next we need to export the header file; library file; Path environment variable; Help file compilation installation no PATH environment variable bash will not find
Export the binary program directory to the PATH environment variable:
Edit File/etc/profile.d/name.sh
Export Path=/usr/local/apache2/bin: $PATH (not configured in configuration file), it only takes effect on the current shell process
Export Library file path
Edit/etc/ld.so.conf.d/name.conf/usr/local/apache2/lib, add library file path to any file name. conf;
Then let the system regenerate the cache: Ldconfig [-v] //-v show the build cache process
Export Header File
/usr/local/apache2/include should be placed/usr/include inside, create links can be implemented, LN-SV, create symbolic Links
Ln–sv
Export Help manual edit/etc/man.config file
Fill the path in the same format
Fifth Step:
Turn off firewall: Type the native IP to test
Start the service test
Compile and install Apache