httpd 是 Apache 超文本传输协议 (HTTP) 服务器的主程序. 被设计为一个独立运行的后台进程, 它会建立一个处理请求的子进程或线程的池.
通常, httpd 不应该被直接调用, 而应该在类 Unix 系统中由 apachectl 调用, 在 Windows 中作为服务运行.
httpd 版本
本文主要介绍 httpd 的两大版本, httpd-2.2 和 httpd-2.4.
CentOS6 系列的版本默认提供的是 httpd-2.2 版本的 rpm 包
CentOS7 系列的版本默认提供的是 httpd-2.4 版本的 rpm 包
2.1 httpd 的特性
httpd 有很多特性, 下面就分别来说说 httpd-2.2 版本和 httpd-2.4 版本各自的特性
版本 特性
2.2 事先创建进程
按需维持适当的进程
模块化设计, 核心比较小, 各种功能通过模块添加 (包括 PHP), 支持运行时配置, 支持单独编译模块
支持多种方式的虚拟主机配置, 如基于 ip 的虚拟主机, 基于端口的虚拟主机, 基于域名的虚拟主机等
支持 https 协议 (通过 mod_ssl 模块实现)
支持用户认证
支持基于 IP 或域名的 ACL 访问控制机制
支持每目录的访问控制 (用户访问默认主页时不需要提供用户名和密码, 但是用户访问某特定目录时需要提供用户名和密码)
支持 URL 重写
支持 MPM(Multi Path Modules, 多处理模块). 用于定义 httpd 的工作模型 (单进程, 单进程多线程, 多进程, 多进程单线程, 多进程多线程)
2.4 httpd-2.4 的新特性:
MPM 支持运行 DSO 机制 (Dynamic Share Object, 模块的动态装 / 卸载机制), 以模块形式按需加载
支持 event MPM,eventMPM 模块生产环境可用
支持异步读写
支持每个模块及每个目录分别使用各自的日志级别
每个请求相关的专业配置, 使用 <If> 来配置
增强版的表达式分析器
支持毫秒级的 keepalive timeout
基于 FQDN 的虚拟主机不再需要 NameVirtualHost 指令
支持用户自定义变量
支持新的指令 (AllowOverrideList)
降低对内存的消耗
工作模型 工作方式
prefork 多进程模型, 预先生成进程, 一个请求用一个进程响应
一个主进程负责生成 n 个子进程, 子进程也称为工作进程
每个子进程处理一个用户请求, 即使没有用户请求, 也会预先生成多个空闲进程, 随时等待请求到达, 最大不会超过 1024 个
worker 基于线程工作, 一个请求用一个线程响应 (启动多个进程, 每个进程生成多个线程)
event 基于事件的驱动, 一个进程处理多个请求
2.2 httpd-2.4 新增的模块
httpd-2.4 在之前的版本基础上新增了几大模块, 下面就几个常用的来介绍一下.
模块 功能
mod_proxy_fcgi 反向代理时支持 apache 服务器后端协议的模块
mod_ratelimit 提供速率限制功能的模块
mod_remoteip 基于 ip 的访问控制机制被改变, 不再支持使用 Order,Deny,Allow 来做基于 IP 的访问控制
httpd 基础
3.1 httpd 自带的工具程序
工具 功能
htpasswd basic 认证基于文件实现时, 用到的帐号密码生成工具
apachectl httpd 自带的服务控制脚本, 支持 start,stop,restart
apxs 由 httpd-devel 包提供的, 扩展 httpd 使用第三方模块的工具
rotatelogs 日志滚动工具
suexec 访问某些有特殊权限配置的资源时, 临时切换至指定用户运行的工具
ab apache benchmark,httpd 的压力测试工具
3.2 rpm 包安装的 httpd 程序环境
文件 / 目录 对应的功能
/var/log/httpd/access.log 访问日志
/var/log/httpd/error_log 错误日志
/var/www/HTML/ 站点文档目录
/usr/lib64/httpd/modules/ 模块文件路径
/etc/httpd/conf/httpd.conf 主配置文件
/etc/httpd/conf.modules.d/*.conf 模块配置文件
/etc/httpd/conf.d/*.conf 辅助配置文件
mpm: 以 DSO 机制提供, 配置文件为 / etc/httpd/conf.modules.d/00-mpm.conf
3.3 Web 相关的命令
3.3.1 curl 命令
curl 是基于 URL 语法在命令行方式下工作的文件传输工具, 它支持 FTP,FTPS,HTTP,HTTPS,GOPHER,TELNET,DICT,FILE 及 LDAP 等协议.
curl 支持以下功能:
https 认证
http 的 POST/PUT 等方法
ftp 上传
kerberos 认证
http 上传
代理服务器
cookies
用户名 / 密码认证
下载文件断点续传
socks5 代理服务器
通过 http 代理服务器上传文件到 ftp 服务器
- // 语法: curl [options] [URL ...]
- // 常用的 options:
- -A/--user-agent // 设置用户代理发送给服务器
- -basic // 使用 Http 基本认证
- --tcp-nodelay // 使用 TCP_NODELAY 选项
- -e/--referer <URL> // 来源网址
- --cacert //CA 证书 (SSL)
- --compressed // 要求返回时压缩的格式
- -H/--header // 自定义请求首部信息传递给服务器
- -I/--head // 只显示响应报文首部信息
- --limit-rate // 设置传输速度
- -u/--user <user[:password]> // 设置服务器的用户和密码
- -0/--http1 // 使用 http 1.0 版本, 默认使用 1.1 版本. 这个选项是数字 0 而不是字母 o
- -o/--output // 把输出写到文件中
- -#/--progress-bar // 进度条显示当前的传送状态
- // 通过 curl 下载文件
- [[email protected] ~]# ls
- [[email protected] ~]# curl -o myblog.HTML https://blog.51cto.com/itchentao
- % Total % Received % Xferd Average Speed Time Time Time Current
- Dload Upload Total Spent Left Speed
- 100 67025 0 67025 0 0 87248 0 --:--:-- --:--:-- --:--:-- 87385
- [[email protected] ~]# ls
myblog.HTML
- // 语法: httpd [options]
- // 常用的 options:
- -l // 查看静态编译的模块, 列出核心中编译了哪些模块. // 它不会列出使用 LoadModule 指令动态加载的模块
- -M // 输出一个已经启用的模块列表, 包括静态编译在服务 // 器中的模块和作为 DSO 动态加载的模块
- -v // 显示 httpd 的版本, 然后退出
- -V // 显示 httpd 和 apr/apr-util 的版本和编译参数, 然后退出
- -X // 以调试模式运行 httpd. 仅启动一个工作进程, 并且 // 服务器不与控制台脱离
- -t // 检查配置文件是否有语法错误
- [[email protected] ~]# httpd -l
- Compiled in modules:
- core.c
- mod_so.c
- http_core.c
- [[email protected] ~]# httpd -M
- AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain. Set the'ServerName' directive globally to suppress this message
- Loaded Modules:
- core_module (static)
- so_module (static)
- http_module (static)
- access_compat_module (shared)
- actions_module (shared)
- alias_module (shared)
- allowmethods_module (shared)
- auth_basic_module (shared)
- ......
- ......
- [[email protected] ~]# httpd -v
- Server version: Apache/2.4.6 (CentOS)
- Server built: Jun 27 2018 13:48:59
- [[email protected] ~]# httpd -V
- AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain. Set the'ServerName' directive globally to suppress this message
- Server version: Apache/2.4.6 (CentOS)
- Server built: Jun 27 2018 13:48:59
- Server's Module Magic Number: 20120211:24
- Server loaded: APR 1.4.8, APR-UTIL 1.5.2
- Compiled using: APR 1.4.8, APR-UTIL 1.5.2
- Architecture: 64-bit
- Server MPM: prefork
- threaded: no
- forked: yes (variable process count)
- Server compiled with....
- -D APR_HAS_SENDFILE
- -D APR_HAS_MMAP
- -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
- -D APR_USE_SYSVSEM_SERIALIZE
- -D APR_USE_PTHREAD_SERIALIZE
- -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
- -D APR_HAS_OTHER_CHILD
- -D AP_HAVE_RELIABLE_PIPED_LOGS
- -D DYNAMIC_MODULE_LIMIT=256
- -D HTTPD_ROOT="/etc/httpd"
- -D SUEXEC_BIN="/usr/sbin/suexec"
- -D DEFAULT_PIDLOG="/run/httpd/httpd.pid"
- -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
- -D DEFAULT_ERRORLOG="logs/error_log"
- -D AP_TYPES_CONFIG_FILE="conf/mime.types"
- -D SERVER_CONFIG_FILE="conf/httpd.conf"
- apr:apache portable runtime
- // 安装开发环境
- [[email protected] ~]# yum groupinstall "Development Tools"
- Loaded plugins: product-id, search-disabled-repos, subscription-manager
- This system is not registered with an entitlement server. You can use subscription-manager to register.
- There is no installed groups file.
- Maybe run: yum groups mark convert (see man yum)
- Resolving Dependencies
- --> Running transaction check
- ---> Package autoconf.noarch 0:2.69-11.el7 will be installed
- --> Processing Dependency: m4>= 1.4.14 for package: autoconf-2.69-11.el7.noarch
- --> Processing Dependency: perl(Data::Dumper) for package: autoconf-2.69-11.el7.noarch
- ---> Package automake.noarch 0:1.13.4-3.el7 will be installed
- --> Processing Dependency: perl(Thread::Queue) for package: automake-1.13.4-3.el7.noarch
- ......
- ......
- Dependency Updated:
- elfutils-libelf.x86_64 0:0.170-4.el7 elfutils-libs.x86_64 0:0.170-4.el7
- glibc.x86_64 0:2.17-222.el7 glibc-common.x86_64 0:2.17-222.el7
- libgcc.x86_64 0:4.8.5-28.el7_5.1 libgomp.x86_64 0:4.8.5-28.el7_5.1
- libstdc++.x86_64 0:4.8.5-28.el7_5.1 rpm.x86_64 0:4.11.3-32.el7
- rpm-build-libs.x86_64 0:4.11.3-32.el7 rpm-libs.x86_64 0:4.11.3-32.el7
- rpm-python.x86_64 0:4.11.3-32.el7
- Complete!
- [[email protected] ~]# groupadd -r apache
- [[email protected] ~]# useradd -r -g apache apache
- [[email protected] ~]# yum -y install openssl-devel pcre-devel expat-devel libtool
- Loaded plugins: product-id, search-disabled-repos, subscription-manager
- This system is not registered with an entitlement server. You can use subscription-manager to register.
- Resolving Dependencies
- --> Running transaction check
- ---> Package openssl-devel.x86_64 1:1.0.2k-12.el7 will be installed
- --> Processing Dependency: openssl-libs(x86-64) = 1:1.0.2k-12.el7 for package: 1:openssl-devel-1.0.2k-12.el7.x86_64
- ......
- ......
- libselinux-utils.x86_64 0:2.5-12.el7 libsepol.x86_64 0:2.5-8.1.el7
- libss.x86_64 0:1.42.9-12.el7_5 openssl.x86_64 1:1.0.2k-12.el7
- openssl-libs.x86_64 1:1.0.2k-12.el7
- Complete!
- // 下载并安装 apr-1.4 + 和 apr-util-1.4+
- [[email protected] ~]# cd /usr/src/
- [[email protected] src]# wget http://mirrors.shu.edu.cn/apache//apr/apr-1.6.5.tar.bz2
- --2018-08-04 18:42:17-- http://mirrors.shu.edu.cn/apache//apr/apr-1.6.5.tar.bz2
- Resolving mirrors.shu.edu.cn (mirrors.shu.edu.cn)... 202.121.199.235
- Connecting to mirrors.shu.edu.cn (mirrors.shu.edu.cn)|202.121.199.235|:80... connected.
- HTTP request sent, awaiting response... 302 Found
- Location: http://172.16.24.182/mirrors.shu.edu.cn/apache//apr/apr-1.6.5.tar.bz2 [following]
- --2018-08-04 18:42:17-- http://172.16.24.182/mirrors.shu.edu.cn/apache//apr/apr-1.6.5.tar.bz2
- Connecting to 172.16.24.182:80... connected.
- HTTP request sent, awaiting response... 200 OK
- Length: 854100 (834K) [application/x-bzip2]
- Saving to: 'apr-1.6.3.tar.bz2'
- 100%[======================================================>] 854,100 1.67MB/s in 0.5s
- 2018-08-04 18:42:18 (1.67 MB/s) - 'apr-1.6.5.tar.bz2' saved [854100/854100]
- [[email protected] src]# wget http://mirrors.shu.edu.cn/apache//apr/apr-util-1.6.1.tar.bz2
- --2018-08-04 18:43:13-- http://mirrors.shu.edu.cn/apache//apr/apr-util-1.6.1.tar.bz2
- Resolving mirrors.shu.edu.cn (mirrors.shu.edu.cn)... 202.121.199.235
- Connecting to mirrors.shu.edu.cn (mirrors.shu.edu.cn)|202.121.199.235|:80... connected.
- HTTP request sent, awaiting response... 302 Found
- Location: http://172.16.24.175/mirrors.shu.edu.cn/apache//apr/apr-util-1.6.1.tar.bz2 [following]
- --2018-08-04 18:43:13-- http://172.16.24.175/mirrors.shu.edu.cn/apache//apr/apr-util-1.6.1.tar.bz2
- Connecting to 172.16.24.175:80... connected.
- HTTP request sent, awaiting response... 200 OK
- Length: 428595 (419K) [application/x-bzip2]
- Saving to: 'apr-util-1.6.1.tar.bz2'
- 100%[======================================================>] 428,595 1.14MB/s in 0.4s
- 2018-08-04 18:43:14 (1.14 MB/s) - 'apr-util-1.6.1.tar.bz2' saved [428595/428595]
- [[email protected] src]# ls
- apr-1.6.5.tar.bz2 apr-util-1.6.1.tar.bz2 debug kernels
- [[email protected] src]# tar xf apr-1.6.5.tar.bz2
- [[email protected] src]# tar xf apr-util-1.6.1.tar.bz2
- [[email protected] src]# ls
- apr-1.6.5 apr-1.6.5.tar.bz2 apr-util-1.6.1 apr-util-1.6.1.tar.bz2 debug kernels
- [[email protected] src]# cd apr-1.6.5
- [[email protected] apr-1.6.5]# VIM configure
- cfgfile="${ofile}T"
- trap "$RM \"$cfgfile\"; exit 1" 1 2 15
- # $RM "$cfgfile" // 将此行加上注释, 或者删除此行
- [[email protected] apr-1.6.5]# ./configure --prefix=/usr/local/apr
- [[email protected] apr-1.6.5]# cd /usr/src/apr-util-1.6.1
- [[email protected] apr-util-1.6.1]# ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
- // 编译安装 httpd
- [[email protected] ~]# wget http://mirror.bit.edu.cn/apache//httpd/httpd-2.4.37.tar.bz2
- --2018-08-04 18:30:46-- http://mirror.bit.edu.cn/apache//httpd/httpd-2.4.37.tar.bz2
- Resolving mirror.bit.edu.cn (mirror.bit.edu.cn)... 114.247.56.117, 2001:da8:204:2001:250:56ff:fea1:22
- Connecting to mirror.bit.edu.cn (mirror.bit.edu.cn)|114.247.56.117|:80... connected.
- HTTP request sent, awaiting response... 200 OK
- Length: 6942969 (6.6M) [application/octet-stream]
- Saving to: 'httpd-2.4.37.tar.bz2'
- 100%[======================================================>] 6,942,969 591KB/s in 19s
- 2018-08-04 18:31:05 (353 KB/s) - 'httpd-2.4.37.tar.bz2' saved [6942969/6942969]
- [[email protected] ~]# ls
- httpd-2.4.37.tar.bz2
- [[email protected] ~]# tar xf httpd-2.4.37.tar.bz2
- [[email protected] ~]# cd httpd-2.4.37
- [[email protected] httpd-2.4.37]# ./configure --prefix=/usr/local/apache --sysconfdir=/etc/httpd24 --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
- [[email protected] httpd-2.4.37]# make && make install
- //LoadModule mpm_NAME_module modules/mod_mpm_NAME.so
- //NAME 有三种, 分别是:
- prefork
- event
- worker
- [[email protected] conf.modules.d]# pwd
- /etc/httpd/conf.modules.d
- [[email protected] conf.modules.d]# ls
- 00-base.conf 00-lua.conf 00-proxy.conf 01-CGI.conf
- 00-dav.conf 00-mpm.conf 00-systemd.conf
- [[email protected] conf.modules.d]# VIM 00-mpm.conf
- LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
- IP:192.168.1.1
- Network/mask:192.168.1.0/255.255.255.0
- Network/Length:192.168.1.0/24
- /var/www/HTML/www>
- Require not ip 192.168.1.20
- Require all granted
- // 设置主机名
- [[email protected] ~]# VIM /etc/httpd/conf/httpd.conf
- ......
- ServerAdmin [email protected]
- ServerName gives the name and port that the server uses to identify itself.
- This can often be determined automatically, but we recommend you specify
- If your host doesn't have a registered DNS name, enter its IP address here.
- ServerName www.example.com:80 // 取消此行前面的 #号
- ......
- [[email protected] ~]# VIM /etc/httpd/conf/httpd.conf
- // 在配置文件的最后加上如下内容
- [[email protected] ~]# tail -25 /etc/httpd/conf/httpd.conf
- #virtual host 1 # 虚拟主机 1 的配置
- ServerName www.wangqing.com
- DocumentRoot "/var/www/html/www"
- ErrorLog "/var/log/httpd/www/error_log"
- CustomLog "/var/log/httpd/www/access_log" combined
- Require all granted
- Require not ip 192.168.1
- 172.16.12.128:80>
- ServerName blog.wangqing.com DocumentRoot "/var/www/html/blog" ErrorLog
- "/var/log/httpd/blog/error_log" CustomLog "/var/log/httpd/blog/access_log"
- combined
- /var/www/HTML/blog>
- Require all granted
- // 创建网页目录并修改属主属组 [[email protected] ~]# cd /var/www/HTML/ [[email protected]
- HTML]# ls [[email protected] HTML]# mkdir www blog [[email protected] HTML]#
- ll total 0 drwxr-xr-x 2 root root 6 Aug 5 16:56 blog drwxr-xr-x 2 root
- root 6 Aug 5 16:56 www [[email protected] HTML]# chown -R apache.apache
- blog [[email protected] HTML]# chown -R apache.apache www [[email protected]
- HTML]# ll total 0 drwxr-xr-x 2 apache apache 6 Aug 5 16:56 blog drwxr-xr-x
- 2 apache apache 6 Aug 5 16:56 www // 创建网页 [[email protected] HTML]# pwd
- /var/www/HTML [[email protected] HTML]# ls blog www [[email protected]
- HTML]# echo 'hello welcome to visit www'> www/index.HTML [[email protected]
- HTML]# echo 'hello welcome to visit blog'> blog/index.HTML // 创建相应网页的日志目录
- [[email protected] ~]# mkdir /var/log/httpd/{www,blog} [[email protected]
- ~]# ll /var/log/httpd/ total 0 drwxr-xr-x 2 root root 6 Aug 5 09:11 blog
- drwxr-xr-x 2 root root 6 Aug 5 09:11 www [[email protected] ~]# chown -R
- apache.apache /var/log/httpd/ // 启动服务并查看是否有 80 端口 [[email protected] ~]#
- systemctl start httpd [[email protected] ~]# ss -antl State Recv-Q Send-Q
- Local Address:Port Peer Address:Port LISTEN 0 128 :22:LISTEN 0 100 127.0.0.1:25:LISTEN
- 0 128 :::80 ::: LISTEN 0 128 :::22 :::LISTEN 0 100 ::1:25 ::: // 在客户机上验证
- ~ cat /etc/hosts
- Host Database
- localhost is used to configure the loopback interface
- 127.0.0.1 localhost
- 255.255.255.255 broadcasthost
- ::1 localhost
- 118.31.33.0 zabbix.forevercq.com
- 0.0.0.0 account.jetbrains.com
- // 添加以下 2 行
- 172.16.12.128 www.wangqing.com
- 172.16.12.128 blog.wangqing.com
- LoadModule ssl_module modules/mod_ssl.so
- Include /etc/httpd24/extra/httpd-vhosts.conf
- Include /etc/httpd24/extra/httpd-ssl.conf
- bison.x86_64 0:3.0.4-1.el7 byacc.x86_64 0:1.9.20130304-3.el7 cscope.x86_64 0:15.8-10.el7
- ctags.x86_64 0:5.8-13.el7 diffstat.x86_64 0:1.57-4.el7 doxygen.x86_64 1:1.8.5-3.el7
- elfutils.x86_64 0:0.168-8.el7 flex.x86_64 0:2.5.37-3.el7 gcc-gfortran.x86_64 0:4.8.5-16.el7
- Git.x86_64 0:1.8.3.1-11.el7 indent.x86_64 0:2.2.11-13.el7 intltool.noarch 0:0.50.2-7.el7
- patch.x86_64 0:2.7.1-8.el7 patchutils.x86_64 0:0.3.3-4.el7 rcs.x86_64 0:5.9.0-5.el7
- RedHat-rpm-config.noarch 0:9.1.0-76.el7 rpm-build.x86_64 0:4.11.3-25.el7 rpm-sign.x86_64 0:4.11.3-25.el7
- subversion.x86_64 0:1.7.14-10.el7 swig.x86_64 0:2.0.10-5.el7 systemtap.x86_64 0:3.1-3.el7
- 2.
- [[email protected] sh]# groupadd -r apache
- 3
- [[email protected] ~]# cd /usr/src
- [[email protected] src]# ls
- apr-1.6.3.tar.bz2 apr-util-1.6.1.tar.bz2 debug kernels
- [[email protected] src]# tar xf apr-1.6.3.tar.bz2
- [[email protected] src]# tar xf apr-1.6.3.tar.bz2
- [[email protected] src]# cd apr-1.6.3
- apr-1.6.3/ apr-1.6.3.tar.bz2
- #$RM "$cfgfile"
- [[email protected] apr-1.6.3]#./configure --prefix=/usr/local/apr
- config.status: executing libtool commands
- config.status: executing default commands
- config.status: include/apr.h is unchanged
- config.status: include/arch/unix/apr_private.h is unchanged
- [[email protected] apr-1.6.3]# make && make install
- done
- /usr/bin/install -c -m 644 build/apr_rules.out /usr/local/apr/build-1/apr_rules.mk
- /usr/bin/install -c -m 644 /usr/src/apr-1.6.3/build/apr_common.m4 /usr/local/apr/build-1
- /usr/bin/install -c -m 644 /usr/src/apr-1.6.3/build/find_apr.m4 /usr/local/apr/build-1
- /usr/bin/install -c -m 755 apr-config.out /usr/local/apr/bin/apr-1-config
- 4.
- [[email protected] src]# ls
- apr-1.6.3 apr-1.6.3.tar.bz2 apr-util-1.6.1.tar.bz2 debug kernels
- [[email protected] src]# tar xf apr-util-1.6.1.tar.bz2
- [[email protected] src]# cd apr-util-1.6.1
- [[email protected] apr-util-1.6.1]# ./configure --prefix=/usr/local/apr-util/ --with-apr=/usr/local/apr
- config.status: creating test/Makefile
- config.status: creating include/private/apu_config.h
- config.status: executing default commands
- [[email protected] apr-util-1.6.1]# make && make install
- /usr/bin/install -c -m 644 aprutil.exp /usr/local/apr-util//lib
- /usr/bin/install -c -m 755 apu-config.out /usr/local/apr-util//bin/apu-1-config
- 5.
- [[email protected] ~]# tar xf httpd-2.4.34.tar.bz2
- [[email protected] ~]# cd httpd-2.4.34
- [[email protected] httpd-2.4.34]# ls
- ABOUT_APACHE BuildAll.d
- [[email protected] httpd-2.4.34]# ./configure --prefix=/usr/local/apache --sysconfdir=/etc/httpd24 --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
- Server Version: 2.4.34
- Install prefix: /usr/local/apache
- C compiler: gcc -std=gnu99
- CFLAGS: -g -O2 -pthread
- CPPFLAGS: -DLINUX -D_REENTRANT -D_GNU_SOURCE
- LDFLAGS:
- LIBS:
- C preprocessor: gcc -E
- 6
- [[email protected] ~]# cd /usr/local/apache/htdocs/
- [[email protected] htdocs]# ls
- [[email protected] htdocs]# echo "hello ni hao .."> index.HTML
- [[email protected] ~]# /usr/local/apache/bin/apachectl restart
来源: http://www.bubuko.com/infodetail-3113556.html