本文实例讲述了Centos7.3服务器搭建LNMP环境的方法。分享给大家供大家参考,具体如下:
需求:在Centos7.3下搭建LNMP环境
1. 关闭防火墙和selinux
打开文件selinux
vim /etc/sysconfig/selinux
将文件中SELINUX=enforcing改为disabled,然后执行”setenforce 0″不用重启地关闭selinux。
SELINUX=disabled
关闭放火墙
systemctl stop firewalld.service
2.安装软件
2.1 MYSQL安装
下载mysql的repo源
wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
安装mysql-community-release-el7-5.noarch.rpm包
rpm -ivh mysql-community-release-el7-5.noarch.rpm
安装MYSQL
sudo yum install -y mysql-server
更改MYSQL用户权限:
sudo chown -R root:root /var/lib/mysql
重启服务:
systemctl restart mysql.service
登录,并修改密码:
mysql -u root mysql > use mysql; mysql > update user set password=password(‘123456‘) where user='root'; mysql > flush privilgegs; mysql > exit;
2.2 nginx安装
下载对应当前系统版本的nginx包
复制代码 代码如下:wget http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
建立nginx的yum仓库(默认yum是没有nginx的)
rpm -ivh nginx-release-centos-7-0.el7.ngx.noarch.rpm
下载并安装nginx
"htmlcode">systemctl start nginx.service2.3 安装php
rpm 安装 Php7 相应的 yum源
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm安装php7.0
yum install -y php70w安装php扩展
复制代码 代码如下:yum install -y php70w-mysql.x86_64 php70w-gd.x86_64 php70w-ldap.x86_64 php70w-mbstring.x86_64 php70w-mcrypt.x86_64安装PHP FPM
yum install -y php70w-fpm3. 修改配置文件
3.1修改Nginx配置文件
nginx配置文件位置:(/etc/nginx/conf.d/default.conf)
vim /etc/nginx/conf.d/default.conf修改 root目录,可自定义:
root /forest/nginxDir/html;修改配置php解析:
location ~.php$ { root /forest/nginxDir/html; "color: #0000ff">/etc/php-fpm.d/www.conf)修改
user =nginx group=nginx4.放入测试文件
cd /forest/nginxDir/html echo 'hello eric' >index.php5.启动服务
5.1 启动nginx服务:
systemctl start nginx.service查看启动状态:
systemctl status nginx看到以下字眼说明启动成功!
"htmlcode">
systemctl start php-fpm.service查看启动状态:
systemctl status php-fpm.service看到以下字眼说明启动成功!
"font-size: medium">6.测试
在浏览器打开192.168.44.129:80/index.php
看到 hello eric 就大功告成~
希望本文所述对大家CentOS服务器配置有所帮助。
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
RTX 5090要首发 性能要翻倍!三星展示GDDR7显存
三星在GTC上展示了专为下一代游戏GPU设计的GDDR7内存。
首次推出的GDDR7内存模块密度为16GB,每个模块容量为2GB。其速度预设为32 Gbps(PAM3),但也可以降至28 Gbps,以提高产量和初始阶段的整体性能和成本效益。
据三星表示,GDDR7内存的能效将提高20%,同时工作电压仅为1.1V,低于标准的1.2V。通过采用更新的封装材料和优化的电路设计,使得在高速运行时的发热量降低,GDDR7的热阻比GDDR6降低了70%。
更新日志
- 群星《前途海量 电影原声专辑》[FLAC/分轨][227.78MB]
- 张信哲.1992-知道新曲与精丫巨石】【WAV+CUE】
- 王翠玲.1995-ANGEL【新艺宝】【WAV+CUE】
- 景冈山.1996-我的眼里只有你【大地唱片】【WAV+CUE】
- 群星《八戒 电影原声带》[320K/MP3][188.97MB]
- 群星《我的阿勒泰 影视原声带》[320K/MP3][139.47MB]
- 纪钧瀚《胎教古典音乐 钢琴与大提琴的沉浸时光》[320K/MP3][148.91MB]
- 刘雅丽.2001-丽花皇后·EMI精选王【EMI百代】【FLAC分轨】
- 齐秦.1994-黄金十年1981-1990CHINA.TOUR.LIVE精丫上华】【WAV+CUE】
- 群星.2008-本色·百代音乐人创作专辑【EMI百代】【WAV+CUE】
- 群星.2001-同步过冬AVCD【环球】【WAV+CUE】
- 群星.2020-同步过冬2020冀待晴空【环球】【WAV+CUE】
- 沈雁.1986-四季(2012梦田复刻版)【白云唱片】【WAV+CUE】
- 纪钧瀚《胎教古典音乐 钢琴与大提琴的沉浸时光》[FLAC/分轨][257.88MB]
- 《国语老歌 怀旧篇 3CD》[WAV/分轨][1.6GB]