日韩久久久精品,亚洲精品久久久久久久久久久,亚洲欧美一区二区三区国产精品 ,一区二区福利

安裝Nginx

張軍 0

張軍博客


Nginx (engine x) 是一個(gè)高性能的HTTP和反向代理web服務(wù)器,同時(shí)也提供了IMAP/POP3/SMTP服務(wù)。Nginx是由伊戈?duì)枴べ愃饕驗(yàn)槎砹_斯訪問(wèn)量第二的Rambler.ru站點(diǎn)(俄文:Рамблер)開(kāi)發(fā)的,第一個(gè)公開(kāi)版本0.1.0發(fā)布于2004年10月4日。 其將源代碼以類BSD許可證的形式發(fā)布,因它的穩(wěn)定性、豐富的功能集、示例配置文件和低系統(tǒng)資源的消耗而聞名。2011年6月1日,nginx 1.0.4發(fā)布。 Nginx是一款輕量級(jí)的Web 服務(wù)器/反向代理服務(wù)器及電子郵件(IMAP/POP3)代理服務(wù)器,在BSD-like 協(xié)議下發(fā)行。其特點(diǎn)是占有內(nèi)存少,并發(fā)能力強(qiáng),事實(shí)上nginx的并發(fā)能力確實(shí)在同類型的網(wǎng)頁(yè)服務(wù)器中表現(xiàn)較好,中國(guó)大陸使用nginx網(wǎng)站用戶有:百度、京東、新浪、網(wǎng)易、騰訊、淘寶等。

1   下載安裝軟

nginx-1.8.0.tar.gz

pcre-8.35.tar.gz

 

2         預(yù)先安裝軟件

error:configure: error: You need a C++ compiler for C++ support.

------------------------------------------

解決:yum install -y gcc gcc-c++

------------------------------------------

error:./configure: error: SSL modules require the OpenSSL library.

------------------------------------------

解決:yum -y install openssl openssl-devel

------------------------------------------

error:./nginx: error while loading shared libraries: libpcre.so.1: cannot open shared object file: No such file or directory

------------------------------------------

解決:32位系統(tǒng) [root@sever lib]# ln -s /usr/local/lib/libpcre.so.1 /lib

解決:64位系統(tǒng) [root@sever lib]# ln -s /usr/local/lib/libpcre.so.1 /lib6

  


3   安裝Nginx所需的pcre庫(kù)


#tar zxvf pcre-8.10.tar.gz

#cd pcre-8.10/

#./configure && make && make install cd ../

   

4   安裝Nginx

#tar zxvf nginx-0.8.46.tar.gz


#cd nginx-0.8.46/ ./configure --user=nginx --group=nginx   --prefix=/usr/local/nginx --with-http_stub_status_module   --with-http_ssl_module


#make && make install cd ../

   

5         安裝日志

427  ll

428  cd /

429  ll

430  cd root

431  ll

432  cd /soft

433  mkdir /soft

434  ll

435  cd /soft

436  ll

437  pwd

438  ll

439  tar zxvf   nginx-1.8.0.tar.gz

440  tar zxvf   pcre-8.35.tar.gz

441  ll

442  rm -rf *.gz

443  ll

444  cd pcre-8.35/

445  ll

446  ./configure &&   make && make install

447  yum list

448  yum install -y gcc   gcc-c++

449  ./configure &&   make && make install

450  cd /var/cache/yum

451  ll

452  cd /soft/

453  ll

454  cd nginx-1.8.0/

455  ll

456  ./configure --user=nginx   --group=nginx --prefix=/usr/local/nginx --with-http_stub_status_module   --with-http_ssl_module

457  make && make   install

458  cat /user

459  cat /etc/passwd

460  cat /etc/group

461  groupadd -g 503 nginx

462  useradd -g nginx -d   /home/nginx -s /bin/bash -m nginx -u 1005

463  ./configure   --user=nginx --group=nginx --prefix=/usr/local/nginx   --with-http_stub_status_module --with-http_ssl_module

464  apt-get install openssl

465  apt -get install   openssl

466  yum install openssl   openssl-devel

468  ./configure   --user=nginx --group=nginx --prefix=/usr/local/nginx   --with-http_stub_status_module --with-http_ssl_module

469  yum -y install openssl   openssl-devel

470  ./configure   --user=nginx --group=nginx --prefix=/usr/local/nginx   --with-http_stub_status_module --with-http_ssl_module

471  make && make   install

472  cd /usr/local/nginx/

473  ll

474  cd sbin

475  ll

476  ./nginx

477  ln -s   /usr/local/lib/libpcre.so.1 /lib64

478  ./nginx

479  ps -ef|grep nginx

480  mkdir -p /web/baidu   /web/sina

481  cd /web

482  tree web

483  ll

484  cd ..

485  tree web

486  ls

487  cd web

488  ll

489  cd baidu/

490  ll

491  vi index.html

492  cd ../sina/

493  vi index.html

494  ll

495  cd /

496  ll

497  cd /usr/local/nginx/

498  ll

499  cd conf/

500  ll

501  pwd

502  cp nginx.conf   nginx.conf.20150911

503  vi nginx.conf

504  pkill nginx

505  pkill -HUP nginx

506  cd /web/baidu/

507  ll

508  chmod +x index.html

509  cd ../sina/

510  chmod +x index.html

511  ll

512  pkill nginx

513  pkill -HUP nginx

514  netstat -an | grep 80

515  netstat -an | grep :80

516  cd /usr/local/nginx/

517  ll

518  cd sbin/

519  ./nginx

520  netstat -an | grep :80

521  cd /web/baidu/

522  ll

523  vi index.html

524  cd /usr/local/nginx/

525  ll

526  cd logs/

527  ll

528  more error.log

529  more baidu.access.log

530  history

 

6         配置nginx配置文件

server {


        listen       80;


        server_name  www.baidu.com;


        access_log  logs/baidu.access.log  main;


        location / {


            root   /web/baidu;


            index  index.html index.htm;


        }


    }


    server {


        listen       80;


        server_name  www.sina.com;


        access_log  logs/sina.access.log  main;


        location / {


            root     /web/sina;


            index  index.html index.htm;


        }


}

 

7         配置本地DNS服務(wù)器

輸入命令: drivers

輸入命令:C:\Windows\System32\drivers\etc\hosts 

192.168.1.124 www.baidu.com

192.168.1.124 www.sina.com

 


8         訪問(wèn)頁(yè)面

張軍博客

 

 

 

9         結(jié)束



更多文章、技術(shù)交流、商務(wù)合作、聯(lián)系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號(hào)聯(lián)系: 360901061

您的支持是博主寫作最大的動(dòng)力,如果您喜歡我的文章,感覺(jué)我的文章對(duì)您有幫助,請(qǐng)用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點(diǎn)擊下面給點(diǎn)支持吧,站長(zhǎng)非常感激您!手機(jī)微信長(zhǎng)按不能支付解決辦法:請(qǐng)將微信支付二維碼保存到相冊(cè),切換到微信,然后點(diǎn)擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對(duì)您有幫助就好】

您的支持是博主寫作最大的動(dòng)力,如果您喜歡我的文章,感覺(jué)我的文章對(duì)您有幫助,請(qǐng)用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長(zhǎng)會(huì)非常 感謝您的哦!!!

發(fā)表我的評(píng)論
最新評(píng)論 總共0條評(píng)論
主站蜘蛛池模板: 肃北| 余干县| 云林县| 乌鲁木齐县| 宜兰县| 西畴县| 莱芜市| 金阳县| 南川市| 隆安县| 嵊泗县| 朝阳市| 永平县| 临沭县| 西城区| 西平县| 贡山| 稻城县| 宁安市| 绿春县| 南涧| 七台河市| 江门市| 黄龙县| 玛沁县| 绍兴县| 电白县| 民权县| 绥江县| 富宁县| 建水县| 谢通门县| 梅州市| 井冈山市| 磴口县| 阿荣旗| 苍溪县| 嘉荫县| 金川县| 安陆市| 深水埗区|