一、安裝httpd
1、yum install httpd -y
2、啟動服務:systemctl start httpd
3、設置開機啟動:systemctl enable
?
二、安裝mariadb
1、yum groupinstall mariadb
2、啟動服務:systemctl start mariadb
3、設置開機啟動:systemctl enable mariadb
?
三、安裝php
1、yum install php
2、yum install php-mysql php-gd libjpeg* php-ldap php-odbc? php-pear php-xml php-xmlrpc php-mbstring php-bcmath php-mhash
3、重啟服務: systemctl restart httpd,systemctl restart httpd
?
四、安裝ngnix
1 、安裝依賴文件:yum install gcc-c++? pcre pcre-devel zlib zlib-devel -y
2、下載nginx: wget? http://nginx.org/download/nginx-1.9.8
3、解壓文件: tar? -zxvf? nginx1.9.8.tar.gz
4、cd /nginx1.9.8
5、./configure,接著是make? ,? make install
6、啟動服務:/usr/local/nginx/sbin/nginx? , 然后查看啟動情況 :? ps -aux |grep
?
五、添加防火墻
1、firewall-cmd? --permanent? --add-rich-rule="rule family=ipv4 service name=http source address=10.0.0.0/24 accept"
2、firewall-cmd --reload
?
六、測試頁制作:
1、/var/www/html/里添加文件為index.php,然后在里面創建添加代碼: <?php? echo "hello wolrd"?? >
?
七、windows下訪問 :? http://10.0.0.21/index.php
?