Linux --- Apache environment setup

Before installing Apache server on Linux system, gcc-c++ compilation function and yum source mounting are required!

Check if there is any Apache related software installed in the RedHat 7 system (not installed)

1. Download the installation package

Download and install Apache    download link

Download pcre          download link

Download apr wget  http://apache.freelamp.com/apr/apr-1.4.2.tar.gz 

Download apr-util wget  http://apache.freelamp.com/apr/apr-util-1.3.10.tar.gz

2. Create a directory under the root directory

Supplement: I uploaded a pcre-8.44.tar.gz software package, the zip format is the windows version

Unzip these 4 software packages to the corresponding files in the /usr/local directory

3. Compile and install

tar -xvf apr-1.4.2.tar.gz -C /usr/local/apr
cd apr-1.4.2/
./configure --prefix=/usr/local/apr
make
make install

tar -xvf apr-util-1.3.10.tar.gz -C /usr/local/apr-util
cd apr-util-1.3.10 
 ./configure --prefix=/usr/local/apr-util -with-apr=/usr/local/apr/bin/apr-1-config
make && make install

tar -xvf pcre-8.44.tar.gz -C /usr/local/pcre
cd pcre-8.44
./configure --prefix=/usr/local/pcre
 make && make install

When executing ./configure --prefix=/usr/local/apache --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util/, the following error appears

configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/

Solution: Use the yum command to install the pcre-devel software package online

yum -y install pcre-devel

tar -xvf httpd-2.4.43.tar.gz -C /usr/local/apache
cd httpd-2.4.43/
./configure --prefix=/usr/local/apache --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util/
 make && make install

4. Configure the main httpd.conf configuration file

5. Use the ifconfig command to view the Linux Apache server IP address, my server IP address is 192.168.203.188

6. Start the Apache server

7. Verification

Guess you like

Origin blog.csdn.net/C_huid/article/details/105722860