Nginx的靜態(tài)處理能力很強,但是動態(tài)處理能力不足,因此,在企業(yè)中常用動靜分離技術(shù);
成都一家集口碑和實力的網(wǎng)站建設(shè)服務(wù)商,擁有專業(yè)的企業(yè)建站團(tuán)隊和靠譜的建站技術(shù),十余年企業(yè)及個人網(wǎng)站建設(shè)經(jīng)驗 ,為成都近千家客戶提供網(wǎng)頁設(shè)計制作,網(wǎng)站開發(fā),企業(yè)網(wǎng)站制作建設(shè)等服務(wù),包括成都營銷型網(wǎng)站建設(shè),品牌網(wǎng)站建設(shè),同時也為不同行業(yè)的客戶提供成都做網(wǎng)站、成都網(wǎng)站設(shè)計的服務(wù),包括成都電商型網(wǎng)站制作建設(shè),裝修行業(yè)網(wǎng)站制作建設(shè),傳統(tǒng)機械行業(yè)網(wǎng)站建設(shè),傳統(tǒng)農(nóng)業(yè)行業(yè)網(wǎng)站制作建設(shè)。在成都做網(wǎng)站,選網(wǎng)站制作建設(shè)服務(wù)商就選成都創(chuàng)新互聯(lián)公司。
靜態(tài)頁面交給Nginx處理,動態(tài)頁面交給PHP-FPM模塊或Apache處理;
為方便實驗直接用yum安裝,不用手工編譯安裝。用兩臺虛擬機,分別搭建LAMP架構(gòu)和Nginx服務(wù)。
[root@localhost ~]# yum install httpd httpd-devel -y
.........//省略安裝過程
[root@localhost ~]#
[root@localhost ~]# systemctl start httpd.service //開啟服務(wù)
[root@localhost ~]#
[root@localhost ~]# firewall-cmd --permanent --zone=public --add-service=http //放通http服務(wù)
success
[root@localhost ~]# firewall-cmd --permanent --zone=public --add-service=https //放通https服務(wù)
success
[root@localhost ~]# firewall-cmd --reload //重載防火墻
success
[root@localhost ~]#
MariaDB數(shù)據(jù)庫管理系統(tǒng)是MySQL的一個分支,主要由開源社區(qū)在維護(hù),采用GPL授權(quán)許可 MariaDB的目的是完全兼容MySQL,包括API和命令行,使之能輕松成為MySQL的代替品。
[root@localhost ~]# yum install mariadb mariadb-server mariadb-libs mariadb-devel -y
...........//省略安裝過程
[root@localhost ~]#
[root@localhost ~]# systemctl start mariadb.service
[root@localhost ~]#
[root@localhost ~]# mysql_secure_installation //對數(shù)據(jù)庫進(jìn)行設(shè)置
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
In order to log into MariaDB to secure it, we'll need the current
password for the root user. If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.
Enter current password for root (enter for none): //給root管理員設(shè)定密碼,直接回車
OK, successfully used password, moving on...
Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.
Set root password? [Y/n] y //是否設(shè)置,選擇y
New password: //輸入新密碼
Re-enter new password: //再次輸入新密碼
Password updated successfully!
Reloading privilege tables..
... Success!
By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment.
Remove anonymous users? [Y/n] n //是否刪除匿名用戶,選擇n
... skipping.
Normally, root should only be allowed to connect from 'localhost'. This
ensures that someone cannot guess at the root password from the network.
Disallow root login remotely? [Y/n] n //是否拒絕root用戶遠(yuǎn)程登陸,選擇n
... skipping.
By default, MariaDB comes with a database named 'test' that anyone can
access. This is also intended only for testing, and should be removed
before moving into a production environment.
Remove test database and access to it? [Y/n] n //是否刪除測試數(shù)據(jù)庫,選擇n
... skipping.
Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.
Reload privilege tables now? [Y/n] y //是否加載權(quán)限列表,選擇y
... Success!
Cleaning up...
All done! If you've completed all of the above steps, your MariaDB
installation should now be secure.
Thanks for using MariaDB!
[root@localhost ~]#
[root@localhost ~]# yum -y install php
.......//省略過程
[root@localhost ~]#
[root@localhost ~]# yum install php-mysql -y
........//省略過程
[root@localhost ~]#
[root@localhost ~]# yum install -y php-gd php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-snmp php-soap curl curl-devel php-bcmath
........//省略過程
[root@localhost ~]#
[root@localhost ~]# cd /var/www/html/
[root@localhost html]# ls
[root@localhost html]# vim index.php
<?php
phpinfo();
?>
[root@localhost html]#
[root@nginx nginx-1.12.2]# service nginx start //開啟服務(wù)
[root@nginx nginx-1.12.2]# netstat -ntap | grep 80 //查看端口
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 58696/nginx: master
[root@nginx nginx-1.12.2]#
[root@nginx nginx-1.12.2]# systemctl stop firewalld.service //關(guān)閉防火墻
[root@nginx nginx-1.12.2]# setenforce 0
[root@nginx nginx-1.12.2]#
[root@nginx nginx-1.12.2]# yum install elinks -y
..........//省略安裝過程
[root@nginx nginx-1.12.2]#
[root@nginx nginx-1.12.2]# elinks http://192.168.52.132/
[root@nginx nginx-1.12.2]#
CentOS7系統(tǒng)配置Nginx服務(wù)+Apache動靜分離(實戰(zhàn)?。?/a>
當(dāng)前鏈接:http://muchs.cn/article26/ihdpcg.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站設(shè)計公司、商城網(wǎng)站、網(wǎng)站排名、服務(wù)器托管、全網(wǎng)營銷推廣、關(guān)鍵詞優(yōu)化
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)