VMware配置Linux中APPache服务器

【软件】

  VMware    SecureCRT  

【镜像文件】

  Centos6.8   APPache软件包

【步骤】

  1.将所需文件通过SCRT传入到虚拟机中

VMware配置Linux中APPache服务器

VMware配置Linux中APPache服务器

2.挂载镜像

  2.1 将镜像挂载到mnt目录下

 mount -o loop CentOS-6.8-i386-bin-DVD1.iso  /mnt/

  

  2.2 创建空目录

mkdir /opt/centos

 

  2.3 将挂载的镜像文件移入到/opt/centos

cp -rvf /mnt/* /opt/centos

3.创建本地yum源

  

  3.1 移除或者删除本地yum源

     不想删除就创建一个空目录移到过去,不过实验环境,没必要,所以直接删除,不过最好备份吧

rm -rvf /etc/yum.repos.d/*

  

  3.2  创建yum源

vi /etc/yum.repos.d/centos.repo

  [centos]
  name=centos
  gpgcheck=0
  enabled=1
  baseurl=file:///opt/centos

  

3.3  清除缓存

yum clean all

3.4  查看安装包

 yum list

4.关闭防火墙

service iptables stop   //关闭防火墙
chkconfig iptables off //关闭开机自启 === 永久关闭防火墙

vi /etc/selinux/config 
  SELINUX=disabled

5.安装软件

 

5.1 安装c语言编译器

yum install -y install gcc   

5.2  解压httpd的安装包

 tar -zxvf httpd-2.2.9.tar.gz 

5.3  cd到解压目录

cd httpd-2.2.9

5.4  检测系统环境生成Makefile

 ./configure  --prefix=/usr/local/apache2

5.5 编译

make

5.6 编译安装

make install

5.7 启动

/usr/local/apache2/bin/apachectl  start

6.编辑html页面

 

6.1 编辑html页面

vi /usr/local/apache2/htdocs/index.html 
<!DOCTYPE html>
<html lang="en">
<head>
        <meta charset="UTF-8">
        <title>Hello</title>
</head>
<body>
        <h1>name--->IP</h1>
</body>
</html>