中文亚洲精品无码_熟女乱子伦免费_人人超碰人人爱国产_亚洲熟妇女综合网

當(dāng)前位置: 首頁 > news >正文

網(wǎng)站建設(shè)英文怎么說百度一下你就知道官網(wǎng)網(wǎng)址

網(wǎng)站建設(shè)英文怎么說,百度一下你就知道官網(wǎng)網(wǎng)址,青海最好的網(wǎng)站建設(shè)公司,網(wǎng)站上用什么格式的圖片fcgi 模式編譯安裝 LAMPxcache php 的工作模式: php 在 lamp 環(huán)境下共有三種工作模式:CGI 模式、apache 模塊、FastCGI 模式。CGI 模式下運(yùn)行 PHP,性能不是很好。作為 apache 的模塊方式運(yùn)行,在以前的課程中編譯安裝 lamp 已經(jīng)介紹…
fcgi 模式編譯安裝 LAMP+xcache
php 的工作模式:
php 在 lamp 環(huán)境下共有三種工作模式:CGI 模式、apache 模塊、FastCGI 模式。CGI 模式下運(yùn)行 PHP,性能不是很好。作為 apache 的模塊方式運(yùn)行,在以前的課程中編譯安裝 lamp 已經(jīng)介紹過了。FastCGI 的方式和 apache 模塊的不同點(diǎn)在于:FastCGI 方式 PHP 是一處獨(dú)立的進(jìn)程,所有 PHP 子進(jìn)程都由 PHP 的一個叫作 php-fpm 的組件負(fù)責(zé)管理;而 apache 模塊化方式運(yùn)行的 PHP,則是 apache 負(fù)責(zé)調(diào)用 PHP 完成工作。PHP 的 FastCGI 方式性能要比 apache
模塊化方式強(qiáng)很多,今天我們以 FastCGI 方式編譯安裝 lamp。
FastCGI 工作機(jī)制:
Linux	Web服務(wù)器	PHP	MySQL數(shù)據(jù)庫	xcache
Centos7	Httpd-2.4.23	php-5.4.26 M	Mysql5.7	xcache-3.1.0
首先客戶端發(fā)起請求,請求分為 2 種,一種是靜態(tài)請求它可以直接由 Apache 直接響應(yīng)返回;另一種是動態(tài)的請求,如其中包含中 php 或者 Perl 這種腳本解釋性語言,則由 Apache 服務(wù)器通過 fastcgi 協(xié)議調(diào)用 php 服務(wù)器執(zhí)行并返回給Apache由 Apache返回解釋執(zhí)行后的結(jié)果,如果這個過程中涉及到對數(shù)據(jù)的操作,此時 php 服務(wù)器還會還會通過 mysql 協(xié)議調(diào)用 mysql服務(wù)器。 編譯環(huán)境及各軟件版本: 主機(jī)規(guī)劃(關(guān)掉防火墻、SELinux)
至少 3 臺主機(jī),操作系統(tǒng)都是 centos7.2.網(wǎng)段在 192.168.24.0/24 網(wǎng)關(guān) 192.168.24.1
分配如下:
1 臺 httpd 服務(wù)器(192.168.24.128)
1 臺 php 服務(wù)器(192.168.24.129)
1 臺 mysql 服務(wù)器(192.168.24.130)
編譯安裝 LAMP
編譯安裝 apache(請參考前面 apache 的安裝)
編譯安裝 mysql(請參考 mysql 安裝)
FastCGI 方式安裝 php
1、解決依賴關(guān)系 

在安裝中顯示libmcrypt和PHP沒有安裝上,這就我要我們手動安裝。
安裝libmcrypt

注:/usr/local前面沒有空格
2、編譯安裝PHP


相關(guān)選項的解釋:
--prefix=/usr/local/php5.6//安裝位置
--with-mysql=mysqlnd //支持 mysql
--with-pdo-mysql=mysqlnd //支持 pdo 模塊
--with-mysqli=mysqlnd //支持 mysqli 模塊
注:上面的三選項的作用:數(shù)據(jù)庫與 php 不在一個服務(wù)器上,指定此種方式,安裝數(shù)據(jù)庫
連接驅(qū)動
--with-openssl//支持 openssl 模塊
--enable-fpm//支持 fpm 模式
--enable-sockets//啟用 socket 支持
--enable-sysvshm//啟用系統(tǒng)共享內(nèi)存支持
--enable-mbstring//多字節(jié)字串、像我們的中文就是多字節(jié)字串
--with-freetype-dir//支持 freetype、就要裝 freetype-devel、跟字體相關(guān)的、字體解析工具
--with-jpeg-dir
--with-png-dir
注:上面的二選項的作用:處理 jpeg、png 圖片的、php 可以動態(tài)生成 jpeg 圖片
--with-zlib//是個壓縮庫、在互聯(lián)網(wǎng)傳輸時用來壓縮傳輸?shù)?--with-libxml-dir=/usr//這個 libxml 是用來解析 xml 的、指定/usr 下
--enable-xml //支持 xml 的
--with-mhash//支持 mhash
--with-mcrypt=/usr/local/libmcrypt //libmcrypt-devel 這個程序包所指定的
--with-config-file-path=/etc //指定配置文件的存放路徑的
--with-config-file-scan-dir=/etc/php.d //配置文件掃描路徑
--with-bz2 //支持 BZip2
為了支持 apache 的 worker 或 event 這兩個 MPM,編譯時使用了--enable-maintainer-zts 選項
如果使用 PHP5.3 以上版本,為了鏈接 MySQL 數(shù)據(jù)庫,可以指定 mysqlnd,這樣在本機(jī)就不需要先安裝 MySQL 或 MySQL 開發(fā)包了。mysqlnd 從 php 5.3 開始可用,可以編譯時綁定到它(而不用和具體的 MySQL 客戶端庫綁定形成依賴),但從 PHP 5.4 開始它就是默認(rèn)設(shè)置了。
3、提供 php 配置文件

4、為 php-fpm 提供腳本

5、提供 php-fpm 配置文件并編輯:


pid = run/php-fpm.pid
listen = 192.168.24.129:9000
pm.max_children = 50
pm.start_servers = 5
pm.min_spare_servers = 5
pm.max_spare_servers = 35
啟動 php-fpm 服務(wù):
在該主機(jī)上新建虛擬主機(jī)目錄用于存放網(wǎng)頁文件

至此 php 安裝配置完畢,下面配置 apache 通過 fastcgi 協(xié)議調(diào)用 php
6、配置 apache(切換到 apache 主機(jī)上操作)
使用腳本安裝Apache,把需要的包上傳到相關(guān)的目錄下。



上圖顯示Apache安裝成功
在 Apache2.4 以后已經(jīng)專門有一個模塊針對 FastCGI 的實現(xiàn),此模塊為 mod_proxy_fcgi.so,
它其實是作為 mod_proxy.so 模塊的擴(kuò)充,因此,這兩個模塊都要加載  LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so
過濾一下這兩個模塊是否開啟

建立一個目錄作為虛擬主機(jī)的家目錄
[root@http-24 conf]# mkdir -p /var/www/benet
編輯主配置文件 httpd.conf,開啟虛擬主機(jī)
啟用 Include conf/extra/httpd-vhosts.conf(474行)
同時定位 AddType;添加下面兩行:讓 apache 能識別 php 格式的頁面
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
并且定位至 DirectoryIndex:支持 php 格式的主頁
DirectoryIndex index.php index.html #添加 index.php(最好添加在最前面)
<IfModule dir_module>DirectoryIndex index.php index.html (258行)
</IfModule>
配置虛擬主機(jī)支持使用 fcgi
[root@www ~]# vi /usr/local/http-2.4.23/conf/extra/httpd-vhosts.conf
<VirtualHost *:80>ServerAdmin webmaster@benet.comDocumentRoot "/var/www/benet"ServerName www.benet.comServerAlias benet.comErrorLog "logs/benet.com-error_log"CustomLog "logs/benet.com-access_log" commonProxyRequests Off
ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://192.168.31.141:9000/var/www/benet/$1#<LocationMatch "^(.*\.php(/.*)?)$"># ProxyPass fcgi://192.168.31.141:9000/var/www/benet#</LocationMatch>
<Directory "/var/www/benet">Options FollowSymLinksAllowOverride NoneRequire all granted
</Directory>
</VirtualHost>
其中:
ProxyRequests off #關(guān)閉正向代理
ProxyPassMatch:把以.php 結(jié)尾的文件請求發(fā)送到 php-fpm 進(jìn)程,php-fpm 至少需要知道運(yùn)行的目錄和 URI,所以這里直接在 fcgi://192.168.31.141:9000 后指明了這兩個參數(shù),其它的參數(shù)的傳遞已經(jīng)被 mod_proxy_fcgi.so 進(jìn)行了封裝,不需要手動指定。特別注意的是,紅色字體部分需要與<VirtualHost >中的 DocumentRoot 后的路徑一致
ProxyPassMatch
只有滿足特定正則模式的內(nèi)容才會匹配并執(zhí)行此規(guī)則,這里的模式是,^/(.*\.php(/.*)?)$從網(wǎng)站(虛擬主機(jī)<VirtualHost >的根目錄開始,匹配任何以 .php 結(jié)尾,或者在 .php 之后緊跟一個 / 再跟別的內(nèi)容的路徑。^ (caret) 和 $ (dollar)標(biāo)志要匹配的路徑的開始和結(jié)束( )括號里的內(nèi)容可以用 $1 來表示,以方便后面引用它。fcgi://192.168.31.141:9000 通過 mod_proxy_fcgi 來轉(zhuǎn)發(fā)的代理,使用 fastCGI 協(xié)議,轉(zhuǎn)到PHP-FPM 監(jiān)聽的端口。/path/to/your/documentroot/非常重要!必須與虛擬主機(jī)的路徑匹配,且必須是對應(yīng) php 文件在操作系統(tǒng)中的絕對路徑。否則會找不到文件。
$1 可以從原始請求擴(kuò)展成整個請求路徑的變量,這里指代前面( ) 里面匹配的那個路徑(uri)
充:Apache httpd 2.4 以前的版本中,要么把 PHP 作為 Apache 的模塊運(yùn)行,要么添加一個第三方模塊支持 PHP-FPM 實現(xiàn)。 三、腳本安裝MySQL
在 mysql 主機(jī)上創(chuàng)建用于 php 服務(wù)器連接的 mysql 賬戶
mysql> grant all on *.* to testuser@'%' identified by '123456’;
注意防火墻要允許 mysql 連接。
在 php 服務(wù)器上的/var/www/benet 目錄下創(chuàng)建.php 的測試頁:
[root@phpserver ~]# cat /var/www/benet/index.php
<?php
phpinfo();
?>
[root@phpserver ~]# cat /var/www/benet/test1.php
<?php
$link=mysql_connect('192.168.31.225','testuser','123456');
if ($link)echo "connection success......";
mysql_close();
?>
測試訪問 php 測試頁:


看到上面兩個測試頁說明 apache、php、mysql 之間可以協(xié)同工作了。 7、壓力測試
網(wǎng)站性能壓力測試是服務(wù)器網(wǎng)站性能調(diào)優(yōu)過程中必不可缺少的一環(huán)。只有讓服務(wù)器處在高壓情況下,才能真正體現(xiàn)出軟件、硬件等各種設(shè)置不當(dāng)所暴露出的問題。性能測試工具目前最常見的有以下幾種:ab、http_load、webbench、siege。今天我們專門來介紹 ab。
ab 是 apache 自帶的壓力測試工具。ab 非常實用,它不僅可以對 apache 服務(wù)器進(jìn)行網(wǎng)站訪問壓力測試,也可以對或其它類型的服務(wù)器進(jìn)行壓力測試。比如 nginx、tomcat、IIS 等。下面我們開始介紹有關(guān) ab 命令的使用:
1.ab 的原理
2.ab 的安裝
3.ab 參數(shù)說明
4.ab 性能指標(biāo)
5.ab 實際使用
6.測試 nginx 性能
1)ab 的原理
ab 是 apachebench 命令的縮寫。
ab 的原理:ab 命令會創(chuàng)建多個并發(fā)訪問線程,模擬多個訪問者同時對某一 URL 地址進(jìn)行訪
問。它的測試目標(biāo)是基于 URL 的,因此,它既可以用來測試 apache 的負(fù)載壓力,也可以測
試 nginx、lighthttp、tomcat、IIS 等其它 Web 服務(wù)器的壓力。
ab 命令對發(fā)出負(fù)載的計算機(jī)要求很低,它既不會占用很高 CPU,也不會占用很多內(nèi)存。但
卻會給目標(biāo)服務(wù)器造成巨大的負(fù)載,其原理類似 CC 攻擊。自己測試使用也需要注意,否則
一次上太多的負(fù)載??赡茉斐赡繕?biāo)服務(wù)器資源耗完,嚴(yán)重時甚至導(dǎo)致死機(jī)。
2)ab 的安裝
ab 的安裝非常簡單,如果是源碼安裝 apache 的話,那就更簡單了。apache 安裝完畢后 ab
命令存放在 apache 安裝目錄的 bin 目錄下。如下:
/usr/local/http2.4.23/bin/ab
如果 apache 是通過 yum 的 RPM 包方式安裝的話,ab 命令默認(rèn)存放在/usr/bin 目錄下。如
下:
which ab
注意:如果不想安裝 apache 但是又想使用 ab 命令的話,我們可以直接安裝 apache 的工具
包 httpd-tools。如下:
yum -y install httpd-tools
查看 ab 是否安裝成功,可以切換到上述目錄下,使用 ab –V 命令進(jìn)行檢測。如下: [root@www ~]# /usr/local/http-2.4.23/bin/ab -V
This is ApacheBench, Version 2.3 <$Revision: 1748469 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/ 


如上圖,如果 ab –V 命令出錯,可以 exporexport LD_LIBRARY_PATH="/usr/local/openssl/lib/",
就可以了。
3)ab 參數(shù)說明
有關(guān) ab 命令的使用,我們可以通過幫助命令進(jìn)行查看。如下:
[root@cent05 ~]# ab --help
下面我們對這些參數(shù),進(jìn)行相關(guān)說明。如下:
-n:在測試會話中所執(zhí)行的請求個數(shù)(即總請求數(shù))。
-c:一次產(chǎn)生的請求個數(shù)(即并發(fā)用戶數(shù))。 [root@mysql-24 src]# ab -c 500 -n 10000 http://192.168.24.128/index.html
This is ApacheBench, Version 2.3 <$Revision: 1430300 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/Benchmarking 192.168.24.128 (be patient)
Completed 1000 requests
Completed 2000 requests
Completed 3000 requests
Completed 4000 requests
Completed 5000 requests
Completed 6000 requests
Completed 7000 requests
Completed 8000 requests
Completed 9000 requests
Completed 10000 requests
Finished 10000 requestsServer Software:        Apache/2.4.23
Server Hostname:        192.168.24.128
Server Port:            80Document Path: /index.html #請求的資源
Document Length: 312 bytes#HTTP 響應(yīng)數(shù)據(jù)的正文長度
Concurrency Level: 500#并發(fā)個數(shù)(并發(fā)用戶數(shù))
Time taken for tests: 1.452 seconds#所有這些請求處理完成所花費(fèi)的時間
Complete requests: 10000#完成請求數(shù)
Failed requests: 0#失敗的請求數(shù)
Non-2xx responses: 10000
Total transferred: 4760000 bytes#表示所有請求的響應(yīng)數(shù)據(jù)長度總和,包括每個 HTTP響應(yīng)數(shù)據(jù)的頭信息和正文數(shù)據(jù)的長度。注意這里不包括 HTTP 請求數(shù)據(jù)的長度,僅僅為 web服務(wù)器流向用戶 PC 的應(yīng)用層數(shù)據(jù)總長度。HTML transferred: 3120000 bytes# 表示所有請求的響應(yīng)數(shù)據(jù)中正文數(shù)據(jù)的總和,也就是減去了 Total transferred 中 HTTP 響應(yīng)數(shù)據(jù)中的頭信息的長度。
Requests per second: 7530.93 [#/sec] (mean) #吞吐量-每秒請求數(shù)。計算公式:
Complete requests/Time taken for tests
Time per request: 66.393 [ms] (mean) #用戶平均請求等待時間,計算公式:Time token for tests/(Complete requests/Concurrency Level)。
Time per request: 0.133 [ms] (mean, across all concurrent requests)#服務(wù)器平均請求等待時間,計算公式:Time taken for tests/Complete requests。
Transfer rate: 3500.71 [Kbytes/sec] received#表示這些請求在單位時間內(nèi)從服務(wù)器獲取的數(shù)據(jù)長度,計算公式:Total trnasferred/ Time taken for tests,這個統(tǒng)計很好的說明服務(wù)器的處理能力達(dá)到極限時,其出口寬帶的需求量。(即平均每秒網(wǎng)絡(luò)上的流量)Connection Times (ms)min  mean[+/-sd] median   max
Connect:        0   40 143.1     21    1039
Processing:     6   53  92.8     32     935
Waiting:        5   46  91.6     26     920
Total:         12   93 174.4     58    1467Percentage of the requests served within a certain time (ms)50%     5866%     6675%     7480%     7990%     9495%    27898%   104399%   1069100%   1467 (longest request)
這部分?jǐn)?shù)據(jù)用于描述每個請求處理時間的分布情況,比如以上測試,80%的請求處理時間都不超過 66ms,這個處理時間是指前面的 Time per request,即對于單個用戶而言,平均每個請求的處理時間。
繼續(xù)壓力測試我們再來進(jìn)行一次壓力測試,此時并發(fā)用戶數(shù)為 1000,其他條件不變,查看兩次測試結(jié)果的吞吐量差別
4)ab 性能指標(biāo)
在進(jìn)行性能測試過程中有幾個指標(biāo)比較重要:
1、吞吐率(Requests per second)
服務(wù)器并發(fā)處理能力的量化描述,單位是 reqs/s,指的是在某個并發(fā)用戶數(shù)下單位時間內(nèi)處理的請求數(shù)。某個并發(fā)用戶數(shù)下單位時間內(nèi)能處理的最大請求數(shù),稱之為最大吞吐率記住:吞吐率是基于并發(fā)用戶數(shù)的。這句話代表了兩個含義:
a、吞吐率和并發(fā)用戶數(shù)相關(guān)
b、不同的并發(fā)用戶數(shù)下,吞吐率一般是不同的
計算公式:總請求數(shù)/處理完成這些請求數(shù)所花費(fèi)的時間,即
Request per second=Complete requests/Time taken for tests
必須要說明的是,這個數(shù)值表示當(dāng)前機(jī)器的整體性能,值越大越好。
2、并發(fā)連接數(shù)(The number of concurrent connections)
并發(fā)連接數(shù)指的是某個時刻服務(wù)器所接受的請求數(shù)目,簡單的講,就是一個會話。
3、并發(fā)用戶數(shù)(Concurrency Level)
要注意區(qū)分這個概念和并發(fā)連接數(shù)之間的區(qū)別,一個用戶可能同時會產(chǎn)生多個會話,也即連接數(shù)。
4、用戶平均請求等待時間(Time per request)
計算公式:處理完成所有請求數(shù)所花費(fèi)的時間/(總請求數(shù)/并發(fā)用戶數(shù)),即:
Time per request=Time taken for tests/(Complete requests/Concurrency Level)
5、服務(wù)器平均請求等待時間(Time per request:across all concurrent requests)計算公式:處理完成所有請求數(shù)所花費(fèi)的時間/總請求數(shù),即:Time taken for/testsComplete requests
可以看到,它是吞吐率的倒數(shù)。同時,它也等于用戶平均請求等待時間/并發(fā)用戶數(shù),即Time per request/Concurrency Level 8、CentOS7.2 下安裝 php 加速軟件 Xcache(在 php 主機(jī)上完成下面的操作) 說明:
php 安裝目錄:/usr/local/php5.6
php.ini 配置文件路徑:/etc/php.ini
php 網(wǎng)頁根目錄:/var/www/benet 1)安裝 xcache
wget http://xcache.lighttpd.net/pub/Releases/3.2.0/xcache-3.2.0.tar.gz #下載 [root@php-24 src]# tar zxf xcache-3.2.0.tar.gz
[root@php-24 src]# cd xcache-3.2.0/
[root@php-24 xcache-3.2.0]# /usr/local/php5.6/bin/phpize
[root@php-24 xcache-3.2.0]# ./configure --enable-xcache --enable-xcache-coverager --enable-xcache-optimizer --with-php-config=/usr/local/php5.6/bin/php-config && make && make install
Installing shared extensions:
/usr/local/php5.6/lib/php/extensions/no-debug-zts-20131226/
安裝完成之后,出現(xiàn)下面的界面,記住以下路徑,后面會用到
/usr/local/php5.6/lib/php/extensions/no-debug-zts-20131226/ 2)創(chuàng)建 xcache 緩存文件
# touch /tmp/xcache
# chmod 777 /tmp/xcache
3)拷貝 xcache 后臺管理程序到網(wǎng)站根目錄 [root@php-24 xcache-3.2.0]# cp -r htdocs/ /var/www/benet/xcache
4)配置 php 支持 xcache
vi / etc/php.ini #編輯配置文件,在最后一行添加以下內(nèi)容 [xcache-common]
extension = /usr/local/php5.6/lib/php/extensions/no-debug-zts-20131226/xcache.so
[xcache.admin]
xcache.admin.enable_auth = Off
[xcache]
xcache.shm_scheme ="mmap"
xcache.size=60M
xcache.count =1
xcache.slots =8K
xcache.ttl=0
xcache.gc_interval =0
xcache.var_size=64M
xcache.var_count =1
xcache.var_slots =8K
xcache.var_ttl=0
xcache.var_maxttl=0
xcache.var_gc_interval =300
xcache.test =Off
xcache.readonly_protection = Off
xcache.mmap_path ="/tmp/xcache"
xcache.coredump_directory =""
xcache.cacher =On
xcache.stat=On
xcache.optimizer =Off
[xcache.coverager]
xcache.coverager =On
xcache.coveragedump_directory ="" 將 xcache 目錄拷貝到 apache 主機(jī)的網(wǎng)頁文檔目錄下
[root@phpserver ~]# scp -r /var/www/benet/xcache/ 空格root@192.168.31.83:/var/www/benet/ 6)測試
service php-fpm restart #重啟 php-fpm
瀏覽器打開網(wǎng)站根目錄下面的 xcache
http://http://192.168.24.128/xcache 可以看到如下頁面: 


至此,Linux 下安裝 php 加速軟件 Xcache 教程完成
執(zhí)行 ab 壓力測試:
執(zhí)行第一次壓力測試
[root@mysql-24 src]# ab -c 100 -n 1000 http://192.168.24.128/index.php
This is ApacheBench, Version 2.3 <$Revision: 1430300 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/Benchmarking 192.168.24.128 (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Completed 1000 requests
Finished 1000 requestsServer Software:        Apache/2.4.23
Server Hostname:        192.168.24.128
Server Port:            80Document Path:          /index.php
Document Length:        84914 bytesConcurrency Level:      100
Time taken for tests:   2.087 seconds
Complete requests:      1000
Failed requests:        90(Connect: 0, Receive: 0, Length: 90, Exceptions: 0)
Write errors:           0
Total transferred:      85084899 bytes
HTML transferred:       84913899 bytes
Requests per second:    479.21 [#/sec] (mean)
Time per request:       208.675 [ms] (mean)
Time per request:       2.087 [ms] (mean, across all concurrent requests)
Transfer rate:          39818.21 [Kbytes/sec] receivedConnection Times (ms)min  mean[+/-sd] median   max
Connect:        0    3   2.7      2      11
Processing:    40  195  27.4    202     255
Waiting:       19  189  27.3    195     236
Total:         46  198  25.9    203     256Percentage of the requests served within a certain time (ms)50%    20366%    20775%    20980%    21090%    21495%    21798%    22599%    231100%    256 (longest request)
執(zhí)行第二次壓力測試
[root@mysql-24 src]# ab -c 100 -n 1000 http://192.168.24.128/index.php
This is ApacheBench, Version 2.3 <$Revision: 1430300 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/Benchmarking 192.168.24.128 (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Completed 1000 requests
Finished 1000 requestsServer Software:        Apache/2.4.23
Server Hostname:        192.168.24.128
Server Port:            80Document Path:          /index.php
Document Length:        84914 bytesConcurrency Level:      100
Time taken for tests:   2.101 seconds
Complete requests:      1000
Failed requests:        89(Connect: 0, Receive: 0, Length: 89, Exceptions: 0)
Write errors:           0
Total transferred:      85084903 bytes
HTML transferred:       84913903 bytes
Requests per second:    475.85 [#/sec] (mean)
Time per request:       210.150 [ms] (mean)
Time per request:       2.101 [ms] (mean, across all concurrent requests)
Transfer rate:          39538.83 [Kbytes/sec] receivedConnection Times (ms)min  mean[+/-sd] median   max
Connect:        0    6   7.8      3      30
Processing:    34  194  27.4    199     265
Waiting:       10  184  27.3    189     261
Total:         43  200  23.5    202     294Percentage of the requests served within a certain time (ms)50%    20266%    20775%    20980%    21190%    21795%    22698%    24399%    261100%    294 (longest request)

9、部署 bbs 論壇

Discuz 的程序文件解壓,并且將 upload 中所有文件放置到網(wǎng)站目錄(php 服務(wù)器的操作)
#unzip Discuz_7.0.0_FULL_SC_UTF8.zip -d discus
[root@php-24 src]# mvdiscus/Discuz_7.0.0_FULL_SC_UTF8/ /var/www/benet/bbs
設(shè)置 php-fpm 的服務(wù)用戶為下面文件的屬主或者對其設(shè)置寫權(quán)限,否則安裝時會報錯
#cd /var/www/benet/bbs
#chown -R nobody config.inc.php attachments/forumdata/
uc_client/data/cache/ templates/
#chmod -R 777 uc_server/data/
修改 php.ini 文件
short_open_tag = On
# service php-fpm restart
web 服務(wù)器也需要有靜態(tài)文件(apache 服務(wù)器上操作)
#unzip Discuz_7.0.0_FULL_SC_UTF8.zip -d discus
# mv Discuz/upload/ /var/www/benet/bbs
設(shè)置 httpd 的服務(wù)用戶對指定文件也需要有寫權(quán)限
#cd /var/www/benet/bbs
#chown -R daemon config.inc.php attachments/forumdata/
uc_client/data/cache/ templates/
在數(shù)據(jù)庫服務(wù)器上創(chuàng)建 bbs 數(shù)據(jù)庫及授權(quán)帳戶
mysql> create database bbsdb;
Query OK, 1 row affected (0.01 sec)
mysql> grant all on bbsdb.* to runbbs@'%'identified by 'pwd@123';
Query OK, 0 rows affected, 1 warning (0.03 sec)
置完成之后,輸入 httd://192.168.24.128/bbs/install 即可安裝

填寫數(shù)據(jù)庫的相關(guān)信息,添加數(shù)據(jù)庫服務(wù)器的地址和 MariaDB 創(chuàng)建的數(shù)據(jù)庫和用戶密碼,而后在設(shè)置 bbs 的管理員帳號密碼就可以繼續(xù)安裝了。剩下的根據(jù)提示安裝即可。

出現(xiàn)上面這種情況是由于 php 服務(wù)器安裝了 discuz 之后導(dǎo)致程序發(fā)生變化從而導(dǎo)致動態(tài)服務(wù)器和靜態(tài)服務(wù)器的程序不一致,只需要手動把 bbs 服務(wù)器的文件和 web 服務(wù)器進(jìn)行一次同步即可,如果想實現(xiàn)自動同步,需要使用其他服務(wù),如 initory+rsync、sersync 等工具。
#scp -r /var/www/benet/bbs/* root@192.168.31.83:/var/www/benet/bbs/
動態(tài)服務(wù)器和靜態(tài)服務(wù)器同步文件之后,再次訪問 bbs 的網(wǎng)址就正常了。

http://m.risenshineclean.com/news/32339.html

相關(guān)文章:

  • 成都商城網(wǎng)站建設(shè)地址推廣網(wǎng)頁怎么做的
  • 西安網(wǎng)站制作公司排名口碑營銷屬于什么營銷
  • 西部數(shù)碼網(wǎng)站助手4.0運(yùn)營商推廣5g技術(shù)
  • 初學(xué)網(wǎng)站開發(fā)書籍關(guān)鍵詞歌曲歌詞
  • 濟(jì)南網(wǎng)站建設(shè)培訓(xùn)學(xué)校百度首頁推薦關(guān)不掉嗎
  • 手機(jī)網(wǎng)站底部代碼北京seo網(wǎng)站管理
  • 網(wǎng)站開發(fā)z億瑪酷1流量訂制怎么做信息流廣告代理商
  • 海珠區(qū)建網(wǎng)站公司著名的網(wǎng)絡(luò)營銷案例
  • 怎么用模板做網(wǎng)站云南seo
  • 做網(wǎng)站 圖片素材怎么找智能建站系統(tǒng)
  • 醫(yī)院網(wǎng)站建設(shè)預(yù)算表企業(yè)網(wǎng)站制作步驟
  • 珠海營銷型網(wǎng)站建設(shè)百度站內(nèi)搜索的方法
  • 設(shè)置 wap網(wǎng)站seo網(wǎng)站自動發(fā)布外鏈工具
  • 怎么做網(wǎng)站掃描廣告點(diǎn)擊一次多少錢
  • 網(wǎng)站建設(shè)公司的服務(wù)特點(diǎn)網(wǎng)站優(yōu)化方案模板
  • 做電影網(wǎng)站考什么電商平臺推廣費(fèi)用大概要多少
  • 網(wǎng)站優(yōu)化要從哪些方面做上海seo網(wǎng)站推廣
  • 吉林市做網(wǎng)站的科技公司網(wǎng)絡(luò)推廣常見的方法
  • 純html5網(wǎng)站源碼長沙網(wǎng)站優(yōu)化價格
  • 網(wǎng)站加速cdn自己做互聯(lián)網(wǎng)推廣是什么
  • 怎樣用wordpress建站網(wǎng)絡(luò)銷售是什么工作內(nèi)容
  • 社交平臺推廣方式seo外包方法
  • 網(wǎng)站建設(shè) 時間安排推廣軟件賺錢的app
  • 網(wǎng)站建設(shè)正版軟件廣東網(wǎng)站營銷seo方案
  • 做網(wǎng)站 價格seo怎么優(yōu)化方案
  • 保定專業(yè)做網(wǎng)站的公司最近的國際新聞
  • 足球網(wǎng)站建設(shè)企業(yè)網(wǎng)站怎么推廣
  • 建設(shè)網(wǎng)站時以什么為導(dǎo)向拼多多代運(yùn)營公司十大排名
  • 軟件開發(fā)外包服務(wù)公司上海搜索排名優(yōu)化
  • 怎么授權(quán)小說做游戲網(wǎng)站如何進(jìn)行網(wǎng)絡(luò)營銷推廣