Linux--Apache网站服务器

一.Apache的基础简介
阿帕奇用来提供超文本传输协议:http://
阿帕奇的基础信息
主配置目录: /etc/httpd/conf
主配置文件: /etc/httpd/conf/httpd.conf
子配置目录: /etc/httpd/conf.d/
子配置文件: /etc/httpd/conf.d/*.conf ## 在子配置目录中所有的以.conf结尾的文件
默认发布目录: /var/www/html
默认发布文件: /var/www/html/index.html ##默认发布目录中index.html文件名称固定
默认端口: 80
二.阿帕奇的安装与测试
前提条件:在阿帕器服务器安装前必须保证强制和级selinux处于开启状态,yum源派至正常,火墙处于打开状态

[root@localhost ~]# getenforce  ##Selinux处于开启状态
Enforcing
[root@localhost ~]# ifconfig  ##网络正常,属于静态网络
ens3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 172.25.4.105  netmask 255.255.255.0  broadcast 172.25.4.255
        inet6 fe80::5054:ff:fedb:c711  prefixlen 64  scopeid 0x20<link>
        ether 52:54:00:db:c7:11  txqueuelen 1000  (Ethernet)
        RX packets 105  bytes 9935 (9.7 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 97  bytes 13472 (13.1 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
[root@localhost ~]# yum repolist  ##yum源配置正常
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-
              : manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
repo id                              repo name                            status
!westos                              rhel7.3                              4,751
repolist: 4,751

[root@localhost yum.repos.d]# yum install httpd -y  ##安装httpd服务
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Resolving Dependencies
--> Running transaction check
---> Package httpd.x86_64 0:2.4.6-45.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

======================================================================================================================================================
 Package                          Arch                              Version                                   Repository                         Size
======================================================================================================================================================
Installing:
 httpd                            x86_64                            2.4.6-45.el7                              westos                            1.2 M

Transaction Summary
======================================================================================================================================================
Install  1 Package

Total download size: 1.2 M
Installed size: 3.7 M
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : httpd-2.4.6-45.el7.x86_64                                                                                                          1/1 
  Verifying  : httpd-2.4.6-45.el7.x86_64                                                                                                          1/1 

Installed:
  httpd.x86_64 0:2.4.6-45.el7                                                                                                                         
Complete!
[root@localhost ~]# systemctl start httpd  ##开启服务
[root@localhost ~]# systemctl enable httpd  ##设置为开机自启
[root@localhost ~]# firewall-cmd --list-all  ##列出火墙信息
public (active)
  target: default
  icmp-block-inversion: no
  interfaces: ens3
  sources: 
  services: dhcpv6-client ftp ssh  ##无http则需要添加
  ports: 
  protocols: 
  masquerade: no
  forward-ports: 
  sourceports: 
  icmp-blocks: 
  rich rules: 
[root@localhost ~]# firewal
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值