天天看點

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

将寫好的網頁上傳到這個路徑下即可。

繼續閱讀