準備工作:主機1、雙網卡:外–172.16.252.187 內–192.168.42.140
主機2:192.168.42. 145
主機3:172.16.251.112
主機4:192.168.42.141
在主機2上:
安裝httpd yum install -y php-fpm php-mysql php php-mbstring php-mcrypt
編輯網頁文件:vim /var/www/html/index.php
編輯php-fpm配置文件
開啟fpm systemctl start php-fpm
ss -ntl 查看9000端口打開
簽證:找一臺主機 做CA主機 cd /etc/pki/CA
touch index.txt serial
echo 01 > serial
在web服務器上:
scp nginx.csr 172.16.251.112:/tmp/
在CA上:
scp certs/nginx.crt 172.16.252.187:/etc/nginx/ssl/
在web主機上:
將nginx.key nginx.crt 都放在 /etc/nginx/ssl/目錄下
主機1即web服務器上:
安裝Nginx—-yum install -y nginx
編輯配置文件:vim vim /etc/nginx/conf.d/ilinux.conf
在windows主機上測試
將生成的證書導入瀏覽器之前訪問:
導入證書:
在windows主機上修改hosts文件,解析主機名:
C:\Windows\System32\drivers\etc
用記事本打開hosts,加入
172.16.252.187 www.ilinux.io
訪問:
在主機2上部署pma
在主機3上:
yum install -y mariadb-server
vim /etc/my.cnf.d/server.cnf
systemctl start nariadb 、 ss -ntl 查看打開3306端口
mysql_secure_installation 為數據庫設置密碼和其他選項
測試:
原創文章,作者:Immortals、zcy,如若轉載,請注明出處:http://www.www58058.com/78940