Linux source packages installation tutorial (with apache, for example)
1. Use version is httpd-2.4.38.tar.gz
2. The dependent packages have apr-1.6.5.tar.gz, apr-util-1.6.1.tar.gz, pcre-8.10.zip
3. I put on my installation package Baidu cloud, you can download their own:
Link: https: //pan.baidu.com/s/17tv2ohteUFUwbuQB9ylGCA
extraction code: 5jai
installation steps:
The first step: yum install the necessary software packages
[root@localhost ~]#yum install -y libxml2-devel pcre-devel openssl-devel expat-devel
The following steps may also need to install some resources yum, yum resources to small problems when the reader may need to download their own needs arise
Note the need to use yum install gcc gcc-c ++ environment and the environment
The second step: compiling httpd have apr, apr-util, pcre support
apr-1.6.5.tar.gz download:
[root@localhost ~]#wget http://mirrors.cnnic.cn/apache/apr/apr-1.6.5.tar.gz
apr-util-1.6.1.tar.gz download:
[root@localhost ~]#wget http://mirror.bit.edu.cn/apache//apr/apr-util-1.6.1.tar.gz
httpd-2.4.38.tar.gz Downloads:
[root@localhost ~]#wget https://mirrors.cnnic.cn/apache/httpd/httpd-2.4.38.tar.gz
pcre-8.10.zip Download: https://sourceforge.net/projects/pcre/files/pcre/8.10/
The third step: extracting package
[root@localhost ~]# tar xf apr-util-1.6.1.tar.gz && tar xf httpd-2.4.38.tar.gz && tar xf apr-1.6.5.tar.gz [root@localhost ~]# unzip pcre-8.10.zip
Step Four: installation package apr-1.6.5.tar.gz
[root@localhost apr-1.6.5]# ./configure --prefix=/usr/local/apr [root@localhost apr-1.6.5]# make && make install
Step 5: Install package apr-util-1.6.1.tar.gz
[root@localhost apr-util-1.6.1]# ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr [root@localhost apr-util-1.6.1]# make && make install
Step Six: Install the package pcre-8.10.zip
[root@localhost pcre-8.10]# ./configure --prefix=/usr/local/pcre [root@localhost pcre-8.10]# make && make install
Step Seven: installation package httpd-2.4.38.tar.gz
Note: If the preceding steps are successful, you can view the corresponding packet generated in the / usr / local / lower
[root@localhost httpd-2.4.38]# ./configure --prefix=/usr/local/apache2 --enable-so --enable-ssl --enable-cgi --enable-rewrite --with-zlib --with-pcre --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --enable-modules=most --enable-mpms-shared=all --with-mpm=prefork [root@localhost apr-1.6.5]# make && make install
Step eight: open service
[root@localhost local]# /usr/local/apache2/bin/apachectl start
Before turning on the service, you need to do some configuration
[root@localhost local]# vim /usr/local/apache2/conf/httpd.conf
Find the line ServerName, supplement ServerName localhost: 80
[root@localhost local]# /usr/local/apache2/bin/apachectl restart
Step eight: Verify that the installation was successful
Open your browser and enter localhost: 80, appeared It works show that Apache successfully installed!