这篇记录在 PC 主机上安装 CentOS 7.3 Minimal 时遇到的坑,以及后续 LAMP 环境的基础配置。
硬件环境
- CPU:i7 3770K OC 4.5GHz
- 内存:8G x1 + 4G x2 DDR3 1600
- 主板:Z77
- 显卡:GTX970
安装过程里的坑
制作好镜像后用 U 盘启动出现黑屏。尝试重做镜像无效,后来拔掉独显改用集显后正常进入安装流程。安装语言建议选择英文,中文环境在当时容易遇到兼容问题。
更新系统
yum update
yum upgrade关闭 SELinux
vi /etc/selinux/configSELINUX=disabled添加 EPEL 源
wget http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -ivh epel-release-latest-7.noarch.rpm安装 PHP 7 与 PHP-FPM
yum install php70w
yum install php70w-fpm
systemctl start php-fpm
systemctl enable php-fpm安装 Apache
yum install httpd
yum install mod_ssl
systemctl start httpd
systemctl enable httpd安装 MySQL 5.7
wget https://dev.mysql.com/get/mysql57-community-release-el7-9.noarch.rpm
rpm -ivh mysql57-community-release-el7-9.noarch.rpm
yum install mysql-community-server
systemctl start mysqld
systemctl enable mysqld
grep "password" /var/log/mysqld.log拿到初始密码后登录并修改密码。MySQL 5.7 默认启用密码安全策略,不建议使用简单密码。