虚拟主机的配置&https配置

三种虚拟主机的配置&&https配置

配置之前的操作

安装apache

[root@localhost ~]# yum -y install gcc gcc-c++ wget make pcre-devel openssl openssl-devel libtool expat-devel    //现将我们所需要用到的东西统一安装
[root@localhost ~]# useradd -r -M -s /sbin/nologin apache

解压安装包

[root@localhost ~]# wget https://mirrors.bfsu.edu.cn/apache/httpd/httpd-2.4.46.tar.gz
[root@localhost ~]# wget https://mirrors.bfsu.edu.cn/apache/apr/apr-1.7.0.tar.gz
[root@localhost ~]# wget https://mirrors.bfsu.edu.cn/apache/apr/apr-util-1.6.1.tar.gz

[root@localhost ~]# tar xf httpd-2.4.46.tar.gz 
[root@localhost ~]# tar xf apr-util-1.6.1.tar.gz 
[root@localhost ~]# tar xf apr-1.7.0.tar.gz

编辑配置文件

[root@localhost ~]#cd apr-1.7.0/
[root@localhost-1.7.0]# vim configure

  cfgfile=${ofile}T
   trap "$RM \"$cfgfile\"; exit 1" 1 2 15
   $RM "$cfgfile"
   (。。。)将这一行删除或者行首的#删除,取消注释
   cat <<_LT_EOF >> "$cfgfile
[root@localhost apr-1.7.0]# ./configure --prefix=/usr/local/apr   //编译到指定路径
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
Configuring APR library
Platform: x86_64-pc-linux-gnu
checking for working mkdir -p... yes
APR Version: 1.7.0
checking for chosen layout... apr
checking for gcc... gcc
checking whether the C compiler works... yes
.......
[root@localhost apr-1.7.0]# make && make install   //编译并安装
make[1]: 进入目录“/root/apr-1.7.0”
/bin/sh /root/apr-1.7.0/libtool --silent --mode=compile gcc -g -O2 -pthread -
DHAVE_CONFIG_H -DLINUX -D_REENTRANT -D_GNU_SOURCE -I./include -I/root/apr1.7.0/include/arch/unix -I./include/arch/unix -I/root/apr-1.7.0/include/arch/unix
-I/root/apr-1.7.0/include -I/root/apr-1.7.0/include/private -I/root/apr1.7.0/include/private -o encoding/apr_encode.lo -c encoding/apr_encode.c &&
touch encoding/apr_encode.lo
/root/apr-1.7.0/build/mkdir.sh tools/bin/sh /root/apr-1.7.0/libtool --silent --mode=compile gcc -g -O2 -pthread -
DHAVE_CONFIG_H -DLINUX -D_REENTRANT -D_GNU_SOURCE -I./include -I/root/apr1.7.0/include/arch/unix -I./include/arch/unix -I/root/apr-1.7.0/include/arch/unix
-I/root/apr-1.7.0/include -I/root/apr-1.7.0/include/private -I/root/apr1.7.0/include/private -o t
.......

[root@xkq apr-1.7.0]# cd /usr/src/apr-util-1.6.1 
[root@xkq apr-util-1.6.1]# ./configure --prefix=/usr/local/apr-util --withapr=/usr/local/apr
[root@xkq apr-util-1.6.1]# make && make install
make[1]: 进入目录“/root/apr-util-1.6.1”
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -
pthread -DHAVE_CONFIG_H -DLINUX -D_REENTRANT -D_GNU_SOURCE -I/root/apr-util1.6.1/include -I/root/apr-util-1.6.1/include/private -
I/usr/local/apr/include/apr-1 -o buckets/apr_brigade.lo -c
buckets/apr_brigade.c && touch buckets/apr_brigade.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -
pthread -DHAVE_CONFIG_H -DLINUX -D_REENTRANT -D_GNU_SOURCE -I/root/apr-util1.6.1/include -I/root/apr-util-1.6.1/include/private -
I/usr/local/apr/include/apr-1 -o buckets/apr_buckets.lo -c
buckets/apr_buckets.c && touch buckets/apr_buckets.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -
pthread -DHAVE_CONFIG_H -DLINUX -D_REENTRANT -D_GNU_SOURCE -I/root/apr-util1.6.1/include -I/root/apr-util-1.6.1/include/private -
I/usr/local/apr/include/apr-1 -o buckets/apr_buckets_alloc.lo -c
buckets/apr_buckets_alloc.c && touch buckets/apr_buckets_alloc.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -
pthread -DHAVE_CONFIG_H -DLINUX -D_REENTRANT -D_GNU_SOURCE -I/root/apr-util1.6.1/include -I/root/apr-util-1.6.1/include/private -
I/usr/local/apr/include/apr-1 -o buckets/apr_buckets_eos.lo -c
buckets/apr_buckets_eos.c && touch buckets/apr_buckets_eos.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -
pthread -DHAVE_CONFIG_H -DLINUX -D_REENTRANT -D_GNU_SOURCE -I/root/apr-util1.6.1/include -
...........

[root@localhost httpd-2.4.46]# ./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


checking for chosen layout... Apache
checking for working mkdir -p... yes
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
configure:
configure: Configuring Apache Portable Runtime library...
configure:
checking for APR... yes
setting CC to "gcc"
setting CPP to "gcc -E"
.......
.......
.......
configure:summaryofbuildoptions:
ServerVersion:2.4.43
Installprefix:/usr/local/apache
Ccompiler:gcc

CFLAGS:              -g-O2-pthread
CPPFLAGS:            -DLINUX-D_REENTRANT-D_GNU_SOURCE
LDFLAGS:
LIBS:
Cpreprocessor:        gcc-E

//出现上述表示没有出错

[root@localhost httpd-2.4.46]#make && make install
Making all in srclib
make[1]: 进入目录“/root/httpd-2.4.46/srclib”
make[1]: 离开目录“/root/httpd-2.4.46/srclib”
Making all in os
make[1]: 进入目录“/root/httpd-2.4.46/os”
Making all in unix
make[2]: 进入目录“/root/httpd-2.4.46/os/unix”
make[3]: 进入目录“/root/httpd-2.4.46/os/unix”
/usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread
-DLINUX -D_REENTRANT -D_GNU_SOURCE -I. -I/root/httpd-2.4.46/os/unix -
I/root/httpd-2.4.46/include -I/usr/local/apr/include/apr-1 -I/usr/local/aprutil/include/apr-1 -I/root/httpd-2.4.46/modules/aaa -I/root/httpd2.4.46/modules/cache -I/root/httpd-2.4.46/modules/core -I/root/httpd2.4.46/modules/database -I/root/h
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值