天天看点

CentOS 6.5 部署 Apache 服务器(httpd)

配置IP

[[email protected] ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0

TYPE=Ethernet

PROXY_METHOD=none

BROWSER_ONLY=no

BOOTPROTO=static

IPADDR=10.1.7.57

NETMASK=255.255.255.0

GATEWAY=10.1.7.254

DNS1=10.1.11.10

DNS2=10.1.11.100

DEFROUTE=yes

IPV4_FAILURE_FATAL=no

IPV6INIT=yes

IPV6_AUTOCONF=yes

IPV6_DEFROUTE=yes

IPV6_FAILURE_FATAL=no

IPV6_ADDR_GEN_MODE=stable-privacy

NAME=eth0

UUID=a963d2b1-b84c-45ba-b34f-485e2ed00181

DEVICE=eth0

ONBOOT=yes

配置yum源

[[email protected] ~]# cat /etc/yum.repos.d/CentOS-Base.repo

[base_local]

name=CentOS-KaTeX parse error: Expected 'EOF', got '#' at position 19: …easever - Base #̲mirrorlist=http…releasever&arch=KaTeX parse error: Expected 'EOF', got '&' at position 9: basearch&̲repo=os&infra=infra

baseurl=http://10.1.11.13/Centos/7/x86_64/base7/

gpgcheck=0

enable=1

priority=1

#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

安装httpd、启动httpd、设置开机自启动httpd

[[email protected] ~]# yum install httpd

[[email protected] ~]# systemctl start httpd

[[email protected] ~]# systemctl enable httpd

查看防火墙状态并关闭防火墙

[[email protected] ~]# firewall-cmd --state

running

[[email protected] ~]# systemctl stop firewalld.service

[[email protected] ~]# systemctl disable firewalld.service

Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.

Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.

访问IP成功进入Apache服务器
CentOS 6.5 部署 Apache 服务器(httpd)
默认网页文件路径

/var/www/html

将写好的网页上传到这个路径下即可。

继续阅读