美文网首页
自知则知之

自知则知之

作者: 竝離 | 来源:发表于2019-01-10 09:32 被阅读0次

转载:https://blog.csdn.net/ITYang_/article/details/53907937

linux服务器下nginx与apache共存

思路:

将nginx作为代理服务器和web服务器使用,nginx监听80端口,apache监听除80端口以外的端口,这里使用8080端口.
过程

方案:

1.在linux一经搭建好环境先后安装了nginx和apache,默认端口号都是:80
2.一般客户请求的服务器端口默认为80所以nginx作为静态页端口设置:80;Apache设置为:8080(在httpd.conf文件中修改listen:8080)
3.配置nginx转发请求

nginx配置添加:

server {
            listen          80;
            server_name www.one.guapi.com  one.guapi.com;
           
       location / {
                        proxy_pass          http://127.0.0.1:8080;
                        proxy_redirect      off;
                        proxy_set_header Host $host;
                        proxy_set_header X-Real-IP $remote_addr;
                        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                      }
      }

httpd.conf添加

<virtualhost *:8080>
ServerName        www.one.guapi.com
ServerAlias         www.one.guapi.com one.guapi.com
DocumentRoot    /www/one
DirectoryIndex    index.php   index.html
<Directory /www/guapi>
Options +Includes +FollowSymLink -Indexes
AllowOverride     All
Order                Deny,Allow
Allow         from All
</Directory>
</virtualhost>

nginx下网站配置添加:

server { 
          listen              80;
          server_name     two.guapi.com www.two.guapi.com;
          root                /www/two;
          location           /{
                  index index.html index.php;
                  if (!-e $request_filename) {
                      rewrite ^(.*)$  /index.php?s=$1     last;
                      break;
                  }
                  
           location ~\.php(.*)$ {
                  fastcgi_pass    127.0.0.1:9000;
                  fastcgi_index   index.php;
                  fastcgi_split_path_info  ^((?U).+\.php)(/?.+)$;
                  fastcgi_param   SCRIPT_FILENAME    $document_root$fastcgi_script_name;
                  fastcgi_param   PATH_INFO   fastcgi_path_info;
                  fastcgi_param   PATH_TRANSLATED     $document_root$fastcgi_path_info;
                  include             fastcgi_params;
  }
  ```

相关文章

  • 自知则知之

    转载:https://blog.csdn.net/ITYang_/article/details/53907937...

  • 知悔

    自满而不自知,知之则愕然,而后气闷郁结,懊悔不已。然知错难改,回环往复,苦恼至极。悲哉,悲哉!

  • 道德经七十至七十三章:莫知、善知、自爱、善谋

    道德经七十至七十三章 莫知、善知、自爱、善谋 莫知、善知,即自知之明。自知,知晓宇宙之宏伟,自己之渺小;明知道之博...

  • 我所喜欢的古文精句(七)

    1.物无非彼,物无非是;自彼则不见,自知则知之。故曰:彼出于是,是亦因彼。 ...

  • 彩霞领读记(四)

    欲知平直,则必准绳;欲知方圆,则必规矩;人主欲自知,则必直士。 ...

  • 二十二:正反合

    《齐物论》 物无非彼,物无非是。自彼则不见,自知shi则知之。故曰:彼出于是,是亦因彼...

  • 诽谤与华表

    “欲知平直,则必准绳;欲知方圆,则必规矩;人主欲自知,则必直士。故天子立辅弼,设师保,所以举过也。夫人故不能自知,...

  • 叹之

    尽其用,则自知;无知却享天成者,耻之。人若知彼,复求何言。天道已然,然不知者甚多。理当何存,心向而安!叹之,感之。

  • 阅读笔记‖看淡恩怨,顺其自然

    《庄子》曰:“物无非彼,物无非是,自彼则不见,自知则知之。” 自我就像人与人之间的一道坎,以一己之...

  • 自省到通达

    省,俭,约,通,达。 多自省则多自知,自知明则行易俭。 行俭则事约,简约通大道。 得道则达学,达则不朽易。 圣人之...

网友评论

      本文标题:自知则知之

      本文链接:https://www.haomeiwen.com/subject/pojorqtx.html