多重保护,提升读写,提高利用率
云物理机性能卓越、满足核心高性能应用场景
服务器托管性能可控、资源独享、物理资源隔离
镜像标准镜像、服务集成镜像,自定义镜像
本地快照定期对数据备份,以防数据丢失
以Centos7.1为例:
安装 CentOS 7 EPE 源:
[root@localhost ~]# yum -y install epel-release
安装源后可以安装nginx服务
[root@localhost ~]# yum -y install nginx
启动nginx 服务,并设为自启动
[root@localhost ~]# systemctl start nginx
[root@localhost ~]# systemctl enable nginx
安装完成后在浏览器中输入配好的域名或IP如下图证明已经安装完成
http://server_domain_name_or_IP/
添加如下nginx配置:
[root@localhost ~]# vi /etc/nginx/conf.d/default.conf
server {
listen 80;
server_name localhost;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
下面安装MySQL (mariadb-server ):
[root@localhost ~]# yum -y install mariadb-server mariadb
[root@localhost ~]# systemctl start mariadb
[root@localhost ~]# systemctl enable mariadb
下面执行mysql_secure_installation 来初始化数据库并设置root密码:
下面开始安装php:
[root@localhost ~]# yum -y install php php-mysql php-fpm
[root@localhost ~]# vi /etc/php.ini
修改php的参数cgi.fix_pathinfo 避免nginx文件类型错误解析漏洞
修改php-fpm的监听,使用sock方式
[root@localhost ~]# vi /etc/php-fpm.d/www.conf
修改php-fpm使用nginx帐户运行
启动php-fpm,并设置成自动开机启动
[root@localhost ~]# systemctl start php-fpm
[root@localhost ~]# systemctl enable php-fpm
Nginx的php配置升级成
[root@localhost ~]# vi /etc/nginx/conf.d/default.conf
server {
listen 80;
server_name _;
# note that these lines are originally from the "location /" block
root /usr/share/nginx/html;
index index.php index.html index.htm;
location / {
try_files $uri $uri/ =404;
}
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
重启nginx,新建php 的测试web页面
[root@localhost ~]# systemctl restart nginx
[root@localhost ~]# vi /usr/share/nginx/html/test.php
然后直接输入 http://yourserver_IP/test.php
出现如下页面显示,即表示这套安装环境已部署完成
Copyright © 2011-2024 Biggeryun.com. All Rights Reserved. 比格云 版权所有
工信部可信云云主机服务认证 | 国家信息安全等级保护三级认证 | 《中华人民共和国增值电信业务经营许可证》B1-20172466 | 沪ICP备12023723号-6 | 沪公网安备 31011502006948号 拒绝网络谣言 清朗网络环境