1 修改网卡配置,启动网卡:
vi /etc/sysconfig/network-scripts/ifcfg-ensxxxxxxxxx
2 设置开机启动
ONBOOT=yes 修改为 yes
3 重启网卡
systemctl restart network
4 查看IP
ip addr
5 更新yum源
yum update
6 安装 ssh
yum install openssh-server
基础服务器配置完成,就可以通过xshell 进行了。
7 安装nginx
7.1 因为centos 不支持 yum安装 nginx,需要先添加 nginx 的yum 源。
rpm -ivh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
7.2 通过yum info nginx 检查是否有这个信息。
然后直接执行 yum install nginx 就可以了。
8 安装php7 默认不支持php7
8.1 安装 epel-release
rpm -ivh http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-9.noarch.rpm
8.2 安装 php7的yum源
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
8.3 安装php7
yum install php70w
8.4 安装php-fpm
yum install php70w-fpm php70w-opcache
8.5 启动 php-fpm
systemctl start php-fpm
9 安装mysql
9.1 调整mysql 地址:
rpm -ivh http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
yum install mysql-community-server
9.2 重启mysql
service mysql restart
9.3 免密码登录 默认密码为空
9.4 安装扩展mysql
yum install php70w-mysql
10 重启 nginx
service nginx restart
修改配置文件:
default.conf
安装工具:
yum install wget
yum install net-tools
yum install traceroute
这样就可以使用 netstat 方式了:
如果本地可以正常,局域网无法访问,可以关闭防火墙。
systemctl stop firewalld.service
如果本地可以正常,局域网无法访问,可以关闭防火墙。
systemctl stop firewalld.service
修改默认的 nginx 里面的 default.conf 配置,让 其支持 php
设置 nginx php-fpm 启动,注意防火墙