tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN
4365/nginx: master
➢ 部署两台 lamp 节点(两台节点配置相同,在此列举一台的配置);
[root@lamp1 ~]# yum -y install httpd mariadb-server mysql php-mysql php
[root@lamp1 ~]# sed -i '/short_open/s/Off/On/g' /etc/php.ini
[root@lamp1 ~]# systemctl start mariadb
[root@lamp1 ~]# systemctl start httpd
[root@lamp1 ~]# systemctl enable httpd
[root@lamp1 ~]# systemctl enable mariadb
[root@lamp1 ~]# cat <<END >>/var/www/html/index.php
<?php
phpinfo();
?>
END
[root@lamp1 ~]# mysqladmin -u root password 123123
[root@lamp1 ~]# mysql -uroot -p123123
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 3
Server version: 5.5.56-MariaDB MariaDB Server
Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> exit
➢ 安装配置后端存储节点的 nfs 服务并设置共享的数据;
[root@st ~]# yum -y install rpcbind nfs-utils
[root@st ~]# mkdir /opt/nginx
[root@st ~]# mkdir /opt/lamp
[root@st ~]# cat /etc/exports
/opt/nginx 192.168.100.0/24(rw,sync,no_root_squash)
/opt/lamp 192.168.100.0/24(rw,sync,no_root_squash)
[root@st ~]# chmod 777 /opt/nginx/