CentOS compile the source code and install Apache

1. Download the latest version of Apache

wget http://mirror.downloadvn.com/apache//httpd/httpd-2.4.41.tar.gz

2, the installation package

yum install apr* gcc

3, compile and install

tar -zxvf httpd-2.4.41.tar.gz
cd httpd-2.4.41
./configure –prefix=/usr/local/apache –enable-vhost-alias –enable-rewrite –enable-info
make
make install

Copy the initialization file and Apache set to start

cp build/rpm/httpd.init /etc/init.d/httpd
chmod 755 /etc/init.d/httpd
chkconfig –add httpd
chkconfig –level 35 httpd on

Create a symbolic link

ln -s /usr/local/apache/ httpd
cd /usr/sbin/
ln -fs /usr/local/apache/bin/httpd
ln -fs /usr/local/apache/bin/apachectl
cd /var/log
rm -rf httpd/
/etc/init.d/httpd start

Start / Stop the httpd service

service httpd restart
service httpd start
/usr/local/apache/bin/apachectl start
/usr/local/apache/bin/apachectl stop
/usr/local/apache/bin/apachectl status
/etc/init.d/httpd start
/etc/init.d/httpd stop
/etc/init.d/httpd restart

Pgrep started using the process to find

pgrep httpd

CentOS compile the source code and install Apache

Apache configuration file

we /usr/local/apache/conf/httpd.conf

Guess you like

Origin www.linuxidc.com/Linux/2020-01/162074.htm