Apache HTTP Server(简称Apache)是Apache软件基金会的一个开放源代码的网页服务器软件,可以在大多数计算机操作系统中运行。由于其跨平台和安全性注 1,被广泛使用,是最流行的Web服务器软件之一。它快速、可靠并且可通过简单的API扩展,将Perl/Python等解释器编译到服务器中。
wget
make
gcc
gcc-c++
pcre
openssl
openssl-devel
zlib
unzip
cmake
ncurses-devel expat-devel
libjpeg libjpeg-devel libpng libpng-del libxml2 libxml2-devel
curl-devel
libtool libtool-ltdl libtool-ltdl-devel libevent libevent-devel
zlib-static
zlib-devel
autoconf
pcre-devel
gd
perl
freetype freetype-devel
yum
安装就行,可以选择系统没有的依赖安装;也可以安装全部依赖
wget https://mirrors.tuna.tsinghua.edu.cn/apache//apr/apr-1.6.5.tar.gz
tar -zxvf apr-1.6.5.tar.gz
cd apr-1.6.5
./configure --prefix=/etc/apr/
make && make install
如果地址404可以访问:apr目录地址获取最新下载地址
wget https://mirrors.tuna.tsinghua.edu.cn/apache//apr/apr-util-1.6.1.tar.gz
tar -zxvf apr-util-1.6.1.tar.gz
cd apr-util-1.6.1
./configure --prefix=/etc/apr-util --with-apr=/etc/apr
make && make install
如果地址404可以访问:apr目录地址获取最新下载地址
wget http://mirror.bit.edu.cn/apache//httpd/httpd-2.4.38.tar.gz
tar -axvf httpd-2.4.38.tar.gz
cd httpd-2.4.38
chmod 777 *
#编译
./configure --prefix=/etc/apache/ \
--sysconfdir=/etc/httpd/ \
--with-include-apr \
--disable-userdir \
--enable-headers \
--with-mpm=worker \
--enable-modules=most \
--enable-so \
--enable-deflate \
--enable-defate=shared \
--enable-expires-shared \
--enable-rewrite=shared \
--enable-static-support \
--with-apr=/etc/apr/ \
--with-apr-util=/etc/apr-util/bin \
--with-ssl \
--with-z
make && make install
#创建运行Apache的用户
groupadd www
useradd -g www www -s /bin/false
configure
正确的信息*make && make install
正确的信息
/etc/httpd/httpd.conf
vim /etc/httpd/httpd.conf
#找到156 157行把 daemon修改为www
156 User www
157 Group www
#添加ServerName
ServerName localhost:80
vim /etc/profile
#在文件的末尾加上
export PATH=$PATH:/etc/apache/bin/
#行下面命令更新环境变量
source /etc/profile
cp /etc/apache/bin/apachectl /etc/init.d/httpd
#修改启动脚本
vim /etc/init.d/httpd
#在#!/bin/bash后添加一下内容
####STA
#chkconfig:345 61 61
#description:Apache httpd
####END
#添加服务
chkconfig --add httpd
chkconfig --level 2345 httpd on
/etc/init.d/httpd start|stop|restart
分别是开启|停止|重启版权属于:龙之介大人
本文链接:https://cloud.tencent.com/developer/article/1617653
本站所有原创文章采用知识共享署名-非商业性使用-相同方式共享 4.0 国际许可协议进行许可。 您可以自由的转载和修改,但请务必注明文章来源和作者署名并说明文章非原创且不可用于商业目的。