一. 添加数据库管理工具phpMyAdmin
- 因为我的压缩包是zip格式,在解压的过程中提示了我没有unzip这个命令。所以先进行安装然后再解压
[root@server1 ~]# yum install unzip -y
[root@server1 ~]# unzip phpMyAdmin-5.0.2-all-languages.zip
- mv 移动到 /usr/local/lamp/nginx/html 下
二. 设置nginx
- 直接访问www.westos.org也可,直接访问172.25.14.1也可以
- 修改配置文件
[root@server1 ~]# cd /usr/local/lamp/nginx/conf
[root@server1 conf]# vim nginx.conf
location / {
root html;
index index.php index.html index.htm;
}
[root@server1 conf]# cd ../sbin
[root@server1 sbin]# nginx
[root@server1 sbin]# cd -
[root@server1 conf]# nginx -t
[root@server1 conf]# nginx -s reload
三. 设置php
[root@server1 ~]# /usr/local/lamp/php/lib
[root@server1 lib]# ls
php php.ini
[root@server1 lib]# vim php.ini
1058 pdo_mysql.default_socket= /data/mysql/mysql.sock
1167 mysqli.default_socket = /data/mysql/mysql.sock
[root@server1 lib]# /etc/init.d/php-fpm start
[root@server1 lib]# /etc/init.d/php-fpm restart
注意
nginx :
- nginx
- nginx -s reload
php:
- /etc/init.d/php-fpm start
此时可以进行登陆访问