首页 > 系统相关 >centos安装httpd发布静态网页(一)

centos安装httpd发布静态网页(一)

时间:2023-11-08 10:00:47浏览次数:34  
标签:httpd 00 网页 x86 centos 64 el7 2.4

html网页发布到服务器上,需要安装httpd或者nginx之类。本文以apache httpd为例。

安装

[root@VM-0-5-centos zjd]# yum install httpd
Loaded plugins: fastestmirror, langpacks
Determining fastest mirrors
docker-ce-stable                                                                                                                                              | 3.5 kB  00:00:00
epel                                                                                                                                                          | 4.7 kB  00:00:00
extras                                                                                                                                                        | 2.9 kB  00:00:00
os                                                                                                                                                            | 3.6 kB  00:00:00
updates                                                                                                                                                       | 2.9 kB  00:00:00
(1/3): docker-ce-stable/7/x86_64/primary_db                                                                                                                   | 118 kB  00:00:00
(2/3): epel/7/x86_64/primary_db                                                                                                                               | 7.0 MB  00:00:00
(3/3): epel/7/x86_64/updateinfo                                                                                                                               | 1.0 MB  00:00:00
Resolving Dependencies
--> Running transaction check
---> Package httpd.x86_64 0:2.4.6-99.el7.centos.1 will be installed
--> Processing Dependency: httpd-tools = 2.4.6-99.el7.centos.1 for package: httpd-2.4.6-99.el7.centos.1.x86_64
--> Processing Dependency: /etc/mime.types for package: httpd-2.4.6-99.el7.centos.1.x86_64
--> Processing Dependency: libaprutil-1.so.0()(64bit) for package: httpd-2.4.6-99.el7.centos.1.x86_64
--> Processing Dependency: libapr-1.so.0()(64bit) for package: httpd-2.4.6-99.el7.centos.1.x86_64
--> Running transaction check
---> Package apr.x86_64 0:1.4.8-7.el7 will be installed
---> Package apr-util.x86_64 0:1.5.2-6.el7_9.1 will be installed
---> Package httpd-tools.x86_64 0:2.4.6-99.el7.centos.1 will be installed
---> Package mailcap.noarch 0:2.1.41-2.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=====================================================================================================================================================================================
 Package                                    Arch                                  Version                                               Repository                              Size
=====================================================================================================================================================================================
Installing:
 httpd                                      x86_64                                2.4.6-99.el7.centos.1                                 updates                                2.7 M
Installing for dependencies:
 apr                                        x86_64                                1.4.8-7.el7                                           os                                     104 k
 apr-util                                   x86_64                                1.5.2-6.el7_9.1                                       updates                                 92 k
 httpd-tools                                x86_64                                2.4.6-99.el7.centos.1                                 updates                                 94 k
 mailcap                                    noarch                                2.1.41-2.el7                                          os                                      31 k

Transaction Summary
=====================================================================================================================================================================================
Install  1 Package (+4 Dependent packages)

Total download size: 3.0 M
Installed size: 10 M
Is this ok [y/d/N]: y
Downloading packages:
(1/5): apr-1.4.8-7.el7.x86_64.rpm                                                                                                                             | 104 kB  00:00:00
(2/5): apr-util-1.5.2-6.el7_9.1.x86_64.rpm                                                                                                                    |  92 kB  00:00:00
(3/5): httpd-tools-2.4.6-99.el7.centos.1.x86_64.rpm                                                                                                           |  94 kB  00:00:00
(4/5): httpd-2.4.6-99.el7.centos.1.x86_64.rpm                                                                                                                 | 2.7 MB  00:00:00
(5/5): mailcap-2.1.41-2.el7.noarch.rpm                                                                                                                        |  31 kB  00:00:00
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                7.5 MB/s | 3.0 MB  00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : apr-1.4.8-7.el7.x86_64                                                                                                                                            1/5
  Installing : apr-util-1.5.2-6.el7_9.1.x86_64                                                                                                                                   2/5
  Installing : httpd-tools-2.4.6-99.el7.centos.1.x86_64                                                                                                                          3/5
  Installing : mailcap-2.1.41-2.el7.noarch                                                                                                                                       4/5
  Installing : httpd-2.4.6-99.el7.centos.1.x86_64                                                                                                                                5/5
  Verifying  : httpd-2.4.6-99.el7.centos.1.x86_64                                                                                                                                1/5
  Verifying  : mailcap-2.1.41-2.el7.noarch                                                                                                                                       2/5
  Verifying  : apr-1.4.8-7.el7.x86_64                                                                                                                                            3/5
  Verifying  : httpd-tools-2.4.6-99.el7.centos.1.x86_64                                                                                                                          4/5
  Verifying  : apr-util-1.5.2-6.el7_9.1.x86_64                                                                                                                                   5/5

Installed:
  httpd.x86_64 0:2.4.6-99.el7.centos.1

Dependency Installed:
  apr.x86_64 0:1.4.8-7.el7             apr-util.x86_64 0:1.5.2-6.el7_9.1             httpd-tools.x86_64 0:2.4.6-99.el7.centos.1             mailcap.noarch 0:2.1.41-2.el7

Complete!

配置自动启动

[root@VM-0-5-centos zjd]# systemctl enable httpd.service
Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service.
[root@VM-0-5-centos zjd]# systemctl is-enabled httpd.service
enabled
[root@VM-0-5-centos zjd]# systemctl start httpd.service
[root@VM-0-5-centos zjd]# systemctl status httpd.service
● httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
   Active: active (running) since Tue 2023-11-07 15:14:09 CST; 5s ago
     Docs: man:httpd(8)
           man:apachectl(8)
 Main PID: 6407 (httpd)
   Status: "Processing requests..."
    Tasks: 6
   Memory: 2.8M
   CGroup: /system.slice/httpd.service
           ├─6407 /usr/sbin/httpd -DFOREGROUND
           ├─6408 /usr/sbin/httpd -DFOREGROUND
           ├─6409 /usr/sbin/httpd -DFOREGROUND
           ├─6410 /usr/sbin/httpd -DFOREGROUND
           ├─6411 /usr/sbin/httpd -DFOREGROUND
           └─6412 /usr/sbin/httpd -DFOREGROUND

Nov 07 15:14:09 VM-0-5-centos systemd[1]: Starting The Apache HTTP Server...
Nov 07 15:14:09 VM-0-5-centos httpd[6407]: AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using ::1. Set the 'ServerName' direc...his message
Nov 07 15:14:09 VM-0-5-centos systemd[1]: Started The Apache HTTP Server.
Hint: Some lines were ellipsized, use -l to show in full.

编写静态页面

[root@VM-0-5-centos zjd]# vi /var/www/
cgi-bin/ html/
[root@VM-0-5-centos zjd]# vi /var/www/html/index.html
[root@VM-0-5-centos zjd]# mkdir -p /var/www/html/zjd/
[root@VM-0-5-centos zjd]# vi /var/www/html/zjd/index.html

zjd/index.html内容如下

<!DOCTYPE html>
<html>
    <head>
        <title>sss</title>
    </head>
    <body>
        <h2>222</h2>
    </body>
</html>

centos安装httpd发布静态网页(一)_httpd

标签:httpd,00,网页,x86,centos,64,el7,2.4
From: https://blog.51cto.com/u_15621957/8245356

相关文章

  • centos7.6 安装MySQL 5.6
    1.添加MySQL5.6的Yum存储库:sudovim/etc/yum.repos.d/mysql56.repo[mysql56-community]name=MySQL5.6CommunityServerbaseurl=http://repo.mysql.com/yum/mysql-5.6-community/el/7/$basearch/enabled=1gpgcheck=02.安装MySQL5.6:sudoyuminstallmysql-server3......
  • centos 安装etcd|待优化
    下载https://github.com/etcd-io/etcd/releases/download/v3.5.0/etcd-v3.5.0-linux-amd64.tar.gz安装解压cd/usr/local/srctarzxvfetcd-v3.5.0-linux-amd64.tar.gzmvetcd-v3.5.0-linux-amd64etcd-v3.5.0配置vi/etc/profileexportPATH=$PATH:/usr/local/src/etcd-v3.5......
  • CentOS怎么安装最新版本docker
    环境查看[root@localhost~]#cat/etc/redhat-releaseCentOSLinuxrelease7.9.2009(Core)[root@localhost~]#uname-aLinuxlocalhost.localdomain3.10.0-1160.el7.x86_64#1SMPMonOct1916:18:59UTC2020x86_64x86_64x86_64GNU/Linux安装docker#更新源......
  • centOS6.5 gitlab安装 记录
    很久很久以前的服务器系统版本是centOS6.5感觉会有坑上篇yum源下载问题已解决记录下安装gitLab的过程:安装C编译器yum-yinstallgcc(查下系统里面是否有安装)1.安装配置依赖项sudoyuminstall curl openssh-serveropenssh-clientspostfixcronie2.启动postfix邮......
  • VUE监听网页关闭和隐藏显示(页签关闭调用某一个接口)
    mounted(){this.id=this.$route.query.id;window.addEventListener("beforeunload",async(e)=>awaitthis.beforeunloadHandler(e));window.addEventListener("unload",(e)=>this.unloadHandle......
  • centos7 安装 ffmpeg踩坑后纪
    从网上看了一篇在LINUX上安装FFMPEG作为流媒体服务器的文章后,不知深浅的照着教程来学,一个坑接一个坑。1、我看的教程原文,写的非常好,;https://www.jianshu.com/p/b1680d3ecd4f2、修路填坑之旅(小白的电脑什么都没有装); 首先,先要安装gcc,再要安装x264,还要装yasm  错误1,......
  • centOS6.5 无法使用yum源的问题 removing mirrorlist with no valid mirrors: /var/ca
     一次在临时服务器执行yum命令出现报错问题:removingmirrorlistwithnovalidmirrors:/var/cache/yum/x86_64/6/base/mirrorlist.txt ......1、修改fastestmirror.conf的配置参数sed-i"s|enabled=1|enabled=0|g"/etc/yum/pluginconf.d/fastestmirror.conf2、备份......
  • 旅游管理与推荐系统Python+Django网页平台+协同过滤推荐算法
    一、介绍旅游管理与推荐系统。本系统使用Python作为主要编程语言,前端采用HTML、CSS、BootStrap等技术实现界面展示平台的开发,后端使用Django框架处理用户响应请求,并使用Ajax等技术实现前后端的数据通信。本系统主要功能有:系统分为两个角色:用户和管理员对于用户角色可以进行登......
  • centos7安装docker compose
    1、安装docker-compose前需要先安装docker2、下载地址:https://github.com/docker/compose/releases/tag/v2.23.03、下载对应的版本,我下载的docker-compose-linux-x86_644、放到对应的目录,我看网上有几个都是放到/usr/local/bin中,虽然不明白为什么要放到这里,反正就随大流了5、......
  • centos 6更改yum
    环境:OS:Centos6 1.备份现有repo仓库mv/etc/yum.repos.d/CentOS-Base.repo/etc/yum.repos.d/CentOS-Base.repo.backup2.使用阿里云仓库repocurl-o/etc/yum.repos.d/CentOS-Base.repohttps://www.xmpan.com/Centos-6-Vault-Aliyun.repo--insecurecurlhttp://www.xmpan......