Nginx1-准备

环境准备

配置本地yum

  1. 在虚拟机上挂载CentOS镜像文件

    1
    mount -t iso9660 /dev/sr0 /opt/centos
  2. vi /etc/yum.repos.d/local.repo

    1
    2
    3
    4
    5
    [local]
    name=local
    baseurl=file:///opt/centos
    enabled=1
    gpgcheck=0
  3. 更新

    1
    2
    3
    4
    5
    6
    7
    [root@kangvcar ~]# yum clean all
    Loaded plugins: fastestmirror
    Cleaning repos: local
    Cleaning up everything
    Cleaning up list of fastest mirrors
    [root@kangvcar ~]# yum makecache //把yum源缓存到本地,加快软件的搜索好安装速度
    [root@kangvcar ~]# yum list //列出包

配置阿里云yum

1
2
cd  /etc/yum.repos.d/
wget http://mirrors.aliyun.com/repo/Centos-7.repo

如果wget命令不生效,说明还没有安装wget工具,输入yum -y install wget 回车进行安装。

1
2
3
4
5
mv  CentOs-Base.repo CentOs-Base.repo.bak
mv Centos-7.repo CentOs-Base.repo
yum clean all
yum makecache
yum update

安装必须包

1
2
yum -y install gcc gcc-c++ autoconf pcre pcre-devel make automake
yum -y install wget httpd-tools vim

关闭selinux

查看selinux状态

1
getenforce

临时关闭selinux

1
setenforce 0

创建一些目录(非必须)

1
2
3
4
5
6
cd opt
mkdir app
mkdir download
mkdir logs
mkdir work
mkdir backup