准备工作

1、关闭防火墙和SELinux

2、基础安装的系统,安装以下命令

yum install  gcc make autoconf gcc-c++ glibc glibc-devel pcre pcre-devel openssl openssl-devel systemd-devel zlib-devel  vim lrzsz tree tmux lsof tcpdump wget net-tools iotop bc bzip2 zip unzip nfs-utils man-pages

3、下载httpd2.4,虚拟机下载可能会很慢,本机下载好上传的虚拟机中

[root@centos8/data]$wget https://dlcdn.apache.org/httpd/httpd-2.4.53.tar.bz2

4、查看下载或上传好的安装包,解压

[root@centos8/data]$ls
httpd-2.4.53.tar.bz2
[root@centos8/data]$tar xf httpd-2.4.53.tar.bz2
[root@centos8/data]$ls
httpd-2.4.53 httpd-2.4.53.tar.bz2

5、进入httpd-2.4.53目录查看

[root@centos8/data]$cd httpd-2.4.53/
[root@centos8/data/httpd-2.4.53]$ls
ABOUT_APACHE BuildBin.dsp docs InstallBin.dsp modules ROADMAP
acinclude.m4 buildconf emacs-style LAYOUT NOTICE server
Apache-apr2.dsw CHANGES httpd.dep libhttpd.dep NWGNUmakefile srclib
Apache.dsw changes-entries httpd.dsp libhttpd.dsp os support
apache_probes.d CMakeLists.txt httpd.mak libhttpd.mak README test
ap.d config.layout httpd.spec LICENSE README.CHANGES VERSIONING
build configure include Makefile.in README.cmake
BuildAll.dsp configure.in INSTALL Makefile.win README.platforms

6、编译安装

1)建立安装目录

[root@centos8~]$midir /usr/local/apache2

2)安装

[root@centos8/data/httpd-2.4.53]$./configure --prefix=/usr/local/apache2/ --sysconfdir=/etc/httpd --enable-ssl    #指定安装路径,配置文件路径
[root@centos8/data/httpd-2.4.53]$echo $?                                             #检测生成编译文件是否成功
0
[root@centos8/data/httpd-2.4.53]$make                                                                      
[root@centos8/data/httpd-2.4.53]$echo $?
0
[root@centos8/data/httpd-2.4.53]$make install                                        
[root@centos8/data/httpd-2.4.53]$echo $?
0

7、配置环境

[root@centos8/data/httpd-2.4.53]$echo 'PATH=/usr/local/apache2/bin:$PATH' > /etc/profile.d/httpd.sh

[root@centos8/data/httpd-2.4.53]$. /etc/profile.d/httpd.sh
[root@centos8/data/httpd-2.4.53]$apachectl start
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using fe80::250:56ff:fe33:298d. Set the 'ServerName' directive globally to suppress this message
[root@centos8/data/httpd-2.4.53]$

8、指定用apache用户运行

[root@centos8~]$clear
[root@centos8~]$useradd -r -s /sbin/nologin -d /var/www -c Apache -u 48 apache
[root@centos8~]$vim /etc/httpd/httpd.conf
[root@centos8~]$apachectl restart           #配置生效和验证
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using fe80::250:56ff:fe33:298d. Set the 'ServerName' directive globally to suppress this message
[root@centos8~]$ps aux | tail -6
root 26483 0.0 0.0 0 0 ? I 14:02 0:00 [kworker/1:0-ata_sff]
apache 26487 0.0 0.3 1321352 7728 ? Sl 14:02 0:00 /usr/local/apache2//bin/httpd -k start
apache 26488 0.0 0.3 1321352 7728 ? Sl 14:02 0:00 /usr/local/apache2//bin/httpd -k start
apache 26489 0.0 0.5 1321352 11808 ? Sl 14:02 0:00 /usr/local/apache2//bin/httpd -k start
root 26575 0.0 0.1 58740 3828 pts/0 R+ 14:03 0:00 ps aux
root 26576 0.0 0.0 7348 888 pts/0 S+ 14:03 0:00 tail -6

9浏览器访问

Linux-编译安装http-实验的更多相关文章

  1. 【转】linux 编译安装nginx,配置自启动脚本

    linux 编译安装nginx,配置自启动脚本 本文章来给各位同学介绍一篇关于linux 编译安装nginx,配置自启动脚本教程,希望有需要了解的朋友可一起来学习学习哦. 在公司的suse服务器装ng ...

  2. linux 编译安装nginx,配置自启动脚本

    本文章来给各位同学介绍一篇关于linux 编译安装nginx,配置自启动脚本教程,希望有需要了解的朋友可一起来学习学习哦. 在公司的suse服务器装nginx,记录下安装过程: 参照这篇文章:Linu ...

  3. linux 编译安装PHP模块

    本文移到:http://www.phpgay.com/Article/detail/classid/6/id/54.html  linux 编译安装PHP模块 1.首先你要有你服务器上安装的PHP的版 ...

  4. [CentOS_7.4]Linux编译安装ffmpeg

    [CentOS_7.4]Linux编译安装ffmpeg   安装过程: 下载安装源,配置,编译,安装,设置环境变量. # wget http://www.ffmpeg.org/releases/ffm ...

  5. 转:Linux 编译安装 Mysql5.7

    http://broqiang.com/2017/04/18/Mysql-Install-5.7.18-Linux-Compile/ 原文 Linux 编译安装 Mysql5.7 Ubuntu 下快速 ...

  6. Linux编译安装Apache+PHP

    Linux编译安装Apache+PHP 来自:自学it网,http://www.zixue.it/. 1]编译安装Apache+PHP 1.安装程序依赖库和开发环境   为了省事把所需要的库文件全都安 ...

  7. Linux编译安装Qt 5.4.1(-qt-xcb是必须要指定的,卸载自带的gcc等)

    转载请注明文章:Linux编译安装Qt 5.4.1 出处:多客博图 很久不写文章了,过程很简单,但是操作很多,简单说吧. 前言: 操作系统CentOS 6.6,64位的. 1.安装gcc 4.8.4, ...

  8. Linux 编译安装、压缩打包、定时任务

    目录 Linux 编译安装 知识储备: wget命令 编译安装 Linux 压缩打包 gzip压缩 bzip2压缩 tar打包 Linux 定时任务 相关文件及操作 Linux 编译安装 编译安装就是 ...

  9. Linux 编译安装内核

    一.简介 内核,是一个操作系统的核心.它负责管理系统的进程.内存.设备驱动程序.文件和网络系统,决定着系统的性能和稳定性.Linux作为一个自由软件,在广大爱好者的支持下,内核版本不断更新.新的内核修 ...

  10. LINUX 编译安装 PHP 环境

    今天终于有时间 总结一下 linux 的编译安装 php 环境同学给我发了他写的文档 ,基本就可以实现编译安装了我同学文章地址: http://penghui.link/articles/2016/0 ...

随机推荐

  1. 如何使用双重检查锁定在 Java 中创建线程安全的单例?

    这个 Java 问题也常被问: 什么是线程安全的单例,你怎么创建它.好吧,在Java 5之前的版本, 使用双重检查锁定创建单例 Singleton 时,如果多个线程试图同时创建 Singleton 实 ...

  2. 在Spring AOP 中,关注点和横切关注的区别是什么?

    关注点是应用中一个模块的行为,一个关注点可能会被定义成一个我们想实现的一个功能. 横切关注点是一个关注点,此关注点是整个应用都会使用的功能,并影响整个应用,比如日志,安全和数据传输,几乎应用的每个模块 ...

  3. spring 支持哪些 ORM 框架 ?

    Hibernate iBatis JPA JDO OJB

  4. Bootstrap Javascript组件,模态框级联open解决方案

    <script type="text/javascript"> top.global={zIndex:null}; $("body>div[data-m ...

  5. ctfhub web信息泄露备份文件下载(vim缓存 Ds-Store)

    Vim缓存 进入环境由于不懂得vim是什么借鉴大佬的博客 网页提示flag在index.php中我们按着这个思路去找 将文件保存下来因为是swp文件我们用kail进行打开 使用vim -r index ...

  6. MTK平台电路设计01

    一.资料 获取途径MTK官网.一牛网 二.

  7. 【论文简读】 Deep web data extraction based on visual

    <Deep web data extraction based on visual information processing>作者 J Liu 上海海事大学 2017 AIHC会议登载 ...

  8. 聊一聊Web端的即时通讯

    聊一聊Web端的即时通讯 Web端实现即时通讯的方法有哪些? - 短轮询 长轮询 iframe流 Flash Socket 轮询 客户端定时向服务器发送Ajax请求,服务器接到请求后马上返回响应信息并 ...

  9. linux安装mongodb磁盘空间不足

    Insufficient free space for journal filesPlease make at least 3379MB available in /export/servers/mo ...

  10. 安装并使用Junit

    在Eclipse中配置Junit的方法有两种方式: 第一种方法: 1.下载junit的jar包,目前它的版本是junit3.8.1,可以从www.junit.org上下载. 2.在要使用Junit的p ...