Nginx的靜態(tài)處理能力很強(qiáng),但是動(dòng)態(tài)處理能力不足,因此,在企業(yè)中常用動(dòng)靜分離技術(shù);
10年積累的成都網(wǎng)站建設(shè)、網(wǎng)站設(shè)計(jì)經(jīng)驗(yàn),可以快速應(yīng)對(duì)客戶對(duì)網(wǎng)站的新想法和需求。提供各種問題對(duì)應(yīng)的解決方案。讓選擇我們的客戶得到更好、更有力的網(wǎng)絡(luò)服務(wù)。我雖然不認(rèn)識(shí)你,你也不認(rèn)識(shí)我。但先網(wǎng)站設(shè)計(jì)后付款的網(wǎng)站建設(shè)流程,更有寧都免費(fèi)網(wǎng)站建設(shè)讓你可以放心的選擇與我們合作。靜態(tài)頁面交給Nginx處理,動(dòng)態(tài)頁面交給PHP-FPM模塊或Apache處理;
為方便實(shí)驗(yàn)直接用yum安裝,不用手工編譯安裝。用兩臺(tái)虛擬機(jī),分別搭建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的一個(gè)分支,主要由開源社區(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 //對(duì)數(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 //是否刪除測(cè)試數(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]#
另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)cdcxhl.cn,海內(nèi)外云服務(wù)器15元起步,三天無理由+7*72小時(shí)售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國(guó)服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡(jiǎn)單易用、服務(wù)可用性高、性價(jià)比高”等特點(diǎn)與優(yōu)勢(shì),專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場(chǎng)景需求。
當(dāng)前名稱:CentOS7系統(tǒng)配置Nginx服務(wù)+Apache動(dòng)靜分離(實(shí)戰(zhàn)?。?創(chuàng)新互聯(lián)
當(dāng)前網(wǎng)址:http://muchs.cn/article40/dgcdeo.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站內(nèi)鏈、ChatGPT、用戶體驗(yàn)、定制開發(fā)、做網(wǎng)站、關(guān)鍵詞優(yōu)化
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容