Linux企业运维(二)nginx

文章目录

  • 写在之前
  • 一、nginx简介
  • 二、nginx的安装
  • 三、利用nginx实现负载均衡
  • 四、nginx的平滑升级
  • 五、nginx限流
  • 六、nginx配置管理

写在之前

高可用:高可用(High availability,缩写为 HA),是指系统无中断地执行其功能的能力,代表系统的可用性程度。

一、nginx简介

Nginx 是一个很强大的高性能Web和反向代理服务,它具有很多非常优越的特性;
Nginx作为负载均衡服务:Nginx 既可以在内部直接支持 Rails 和 PHP 程序对外进行服务,也可以支持作为 HTTP代理服务对外进行服务。
支持 SSL 和 TLSSNI。
Nginx 是一个安装非常的简单、配置文件非常简洁(还能够支持perl语法)、Bug非常少的服务。Nginx 启动特别容易,并且几乎可以做到7*24不间断运行,即使运行数个月也不需要重新启动。你还能够不间断服务的情况下进行软件版本的升级。

二、nginx的安装

首先进行解压

tar zxf nginx-1.21.1.tar.gz

安装依赖性

yum install -y gcc pcre-devel  openssl-devel

对源码进行编译,在这一部分,我们可以根据自己的需求进行编译

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

然后我们进行make、make install 进行安装
源码编译三部曲:进行完解压之后,condigure;make;make install
这些进行完之后,我们的nginx已经安装成功,nginx的开启非常简单,直接nginx命令就可以开启,开启之后,我们可以通过查看80端口来检查是否开启,也可以ps进行查看进程

[root@server1 conf]#  netstat -antlp | grep :80
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      10134/nginx: master 

 10134 ?        Ss     0:00 nginx: master process nginx
 10170 ?        R      0:00 [kworker/1:1]
 10177 ?        S      0:00 nginx: worker process
 10178 ?        S      0:00 nginx: worker process

以上两种方式都可以看到nginx已经开启
我们可以对其做一个软连接,方便我们使用

 ln -s /usr/local/nginx/sbin/nginx /usr/local/bin/

三、利用nginx实现负载均衡

打开nginx的配置文件,添加用户、用户组
首先添加nginx用户

useradd -M -d /usr/local/nginx/ -s /sbin/nologin nginx
user nginx nginx;
worker_processes  2;

#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

我们可以将cpu与进程进行捆绑,也就是一个cpu对应一个进程,01 10 代表一个cpu开启时另一个关闭,以此类推,多个cpu也可以用这种方式来进行捆绑

user nginx nginx;
worker_processes  2;
worker_cpu_affinity 01 10;

我们在nginx.conf中添加负载均衡,可以给某台真实主机添加权重,比如给10主机配置权重为2,那么在需求分配的时候,10主机就会是3主机二倍的响应

http {
        upstream westos {
        server 192.168.110.10:8000 weight=2;
        server 192.168.110.3:80;
        }
    include       mime.types;
    default_type  application/octet-stream;

我们再给我们想要设置负载均衡的网站代理到我们设置的负载均衡上,这个时候我们再次访问这个网址,就会被认为访问代理的负载均衡器而按照权重分配给真实主机(首先要添加解析)

 server {
                listen 80;
                server_name www.westos.org;
                location / {
                        proxy_pass http://westos;
                }
        }

效果如下,1.1的响应是1.3的两倍,说明我们利用nginx实现了负载均衡

[root@server5 ~]# for i in {1..10}; do curl www.westos.org;done
server1.3
server1.1
server1.1
server1.3
server1.3
server1.1
server1.1
server1.3
server1.1
server1.1

如果我们此时停掉真实主机中的一台,再次测试会发现调度器自动将所有的需求分配给正常运行的真实主机,在这一点上nginx要更加合理

[root@server1 ~]# curl 192.168.110.3
server1.3

[root@server5 ~]# for i in {1..10}; do curl www.westos.org;done
server1.3
server1.3
server1.3
server1.3
server1.3
server1.3
server1.3
server1.3
server1.3
server1.3

那如果所有的真实主机都down了,再次测试就会报错、

[root@server5 ~]# curl www.westos.org

502 Bad Gateway<<span class="token operator">/</span>title><<span class="token operator">/</span>head>
<body>
<center><h1>502 Bad Gateway<<span class="token operator">/</span>h1><<span class="token operator">/</span>center>
<hr><center>nginx/1<span class="token punctuation">.</span>21<span class="token punctuation">.</span>1<<span class="token operator">/</span>center>
<<span class="token operator">/</span>body>
<<span class="token operator">/</span>html>

</code></pre> 
  <p>这个时候我们就得添加备机,以防止出现这种情况,我们可以将本机设置为备机,那么在真实主机全部down的时候,再次测试,就不会出现502报错</p> 
  <pre><code class="prism language-powershell">http <span class="token punctuation">{</span>
        upstream westos <span class="token punctuation">{</span>
        server 192<span class="token punctuation">.</span>168<span class="token punctuation">.</span>110<span class="token punctuation">.</span>10:8000 weight=2<span class="token punctuation">;</span>
        server 192<span class="token punctuation">.</span>168<span class="token punctuation">.</span>110<span class="token punctuation">.</span>3:80<span class="token punctuation">;</span>
        server 127<span class="token punctuation">.</span>0<span class="token punctuation">.</span>0<span class="token punctuation">.</span>1:80 backup<span class="token punctuation">;</span>
        <span class="token punctuation">}</span>

</code></pre> 
  <pre><code class="prism language-powershell"><span class="token namespace">[root@server5 ~]</span><span class="token comment"># curl www.westos.org</span>
<<span class="token operator">!</span>DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!<<span class="token operator">/</span>title>
<style>
    body <span class="token punctuation">{</span>
        width: 35em<span class="token punctuation">;</span>
        margin: 0 auto<span class="token punctuation">;</span>
        font-family: Tahoma<span class="token punctuation">,</span> Verdana<span class="token punctuation">,</span> Arial<span class="token punctuation">,</span> sans-serif<span class="token punctuation">;</span>
    <span class="token punctuation">}</span>
<<span class="token operator">/</span>style>
<<span class="token operator">/</span>head>
<body>
<h1>Welcome to nginx!<<span class="token operator">/</span>h1>
<p><span class="token keyword">If</span> you see this page<span class="token punctuation">,</span> the nginx web server is successfully installed and
working<span class="token punctuation">.</span> Further configuration is required<span class="token punctuation">.</span><<span class="token operator">/</span>p>

<p><span class="token keyword">For</span> online documentation and support please refer to
<a href=<span class="token string">"http://nginx.org/"</span>>nginx<span class="token punctuation">.</span>org<<span class="token operator">/</span>a><span class="token punctuation">.</span><br/>
Commercial support is available at
<a href=<span class="token string">"http://nginx.com/"</span>>nginx<span class="token punctuation">.</span>com<<span class="token operator">/</span>a><span class="token punctuation">.</span><<span class="token operator">/</span>p>

<p><em>Thank you <span class="token keyword">for</span> <span class="token keyword">using</span> nginx<span class="token punctuation">.</span><<span class="token operator">/</span>em><<span class="token operator">/</span>p>
<<span class="token operator">/</span>body>
<<span class="token operator">/</span>html>

</code></pre> 
  <p>如果我们需要用到sticky算法,就需要进行升级,这个时候再次进行源码编译就不需要make install,因为已经不是第一次安装,这个算法是会将来自同一个地址的请求全部分配给同一台主机,以满足有些需求;</p> 
  <h1>四、nginx的平滑升级</h1> 
  <p>有些时候我们使用的nginx版本需要更新,但是我们又因为某些原因不能关闭nginx,所以就需要进行平滑升级,在开启nginx的同时,对其进行升级<br> 首先tar新的版本</p> 
  <pre><code class="prism language-powershell">258  tar zxf nginx-1<span class="token punctuation">.</span>21<span class="token punctuation">.</span>6<span class="token punctuation">.</span>tar<span class="token punctuation">.</span>gz 
  259  cd nginx-1<span class="token punctuation">.</span>21<span class="token punctuation">.</span>6/

</code></pre> 
  <p>进入目录之后进行源码编译,但是不要进行make install ,因为我们是进行升级,升级完之后,发现现在的nginx只有900多k,比之前的5.9M大大减小</p> 
  <pre><code class="prism language-powershell"><span class="token namespace">[root@server1 nginx-1.21.6]</span><span class="token comment"># ls</span>
auto  CHANGES  CHANGES<span class="token punctuation">.</span>ru  conf  configure  contrib  html  LICENSE  Makefile  man  objs  README  src
<span class="token namespace">[root@server1 nginx-1.21.6]</span><span class="token comment"># cd objs/</span>
<span class="token namespace">[root@server1 objs]</span><span class="token comment"># du -h nginx</span>
940K	nginx

</code></pre> 
  <p>但是此时我们采用du -h查看nginx版本的时候发现还是原来的版本,并没有进行更新,所以这个时候我们要继续进行以下操作,首先我们以防万一,对原来的二进制nginx进行复制</p> 
  <pre><code class="prism language-powershell"><span class="token namespace">[root@server1 sbin]</span><span class="token comment"># cp nginx nginx.old</span>
<span class="token namespace">[root@server1 sbin]</span><span class="token comment"># ls</span>
nginx  nginx<span class="token punctuation">.</span>old

</code></pre> 
  <p>然后对原来的nginx进行覆盖,但是在覆盖的过程中会发现显示在忙,这个时候我们可以采取-f强制覆盖,加\的原因是忽略隐藏,直接执行现在的命令</p> 
  <pre><code class="prism language-powershell"><span class="token namespace">[root@server1 ~]</span><span class="token comment"># cd nginx-1.21.6/</span>
<span class="token namespace">[root@server1 nginx-1.21.6]</span><span class="token comment"># ls</span>
auto  CHANGES  CHANGES<span class="token punctuation">.</span>ru  conf  configure  contrib  html  LICENSE  Makefile  man  objs  README  src
<span class="token namespace">[root@server1 nginx-1.21.6]</span><span class="token comment"># cd objs/</span>
<span class="token namespace">[root@server1 objs]</span><span class="token comment"># cp nginx /usr/local/nginx/sbin/nginx</span>
<span class="token function">cp</span>: overwrite ‘<span class="token operator">/</span>usr/local/nginx/sbin/nginx’? yes
<span class="token function">cp</span>: cannot create regular file ‘<span class="token operator">/</span>usr/local/nginx/sbin/nginx’: Text file busy

</code></pre> 
  <p>但是我们在覆盖之后再次查看依旧是原来的版本,这是因为这些都存在于内存中,内存中并未改变,所以我们需要使用kill -USR2 加进程号来开启新版本进程,并且用kill -WINCH 加进程号终止原来的worker进程</p> 
  <pre><code class="prism language-powershell"><span class="token namespace">[root@server1 objs]</span><span class="token comment"># \cp -f nginx /usr/local/nginx/sbin/nginx</span>
<span class="token namespace">[root@server1 objs]</span><span class="token comment"># curl -I localhost</span>
HTTP/1<span class="token punctuation">.</span>1 200 OK
Server: nginx/1<span class="token punctuation">.</span>21<span class="token punctuation">.</span>1
Date: Thu<span class="token punctuation">,</span> 29 Sep 2022 02:00:30 GMT
Content-<span class="token function">Type</span>: text/html
Content-Length: 612
Last-Modified: Fri<span class="token punctuation">,</span> 23 Sep 2022 23:13:57 GMT
Connection: keep-alive
ETag: <span class="token string">"632e3db5-264"</span>
Accept-Ranges: bytes


</code></pre> 
  <pre><code class="prism language-powershell"><span class="token namespace">[root@server1 sbin]</span><span class="token comment"># ps ax | grep nginx</span>
 18566 ?        Ss     0:00 nginx: master <span class="token keyword">process</span> <span class="token operator">/</span>usr/local/nginx/sbin/nginx
 18567 ?        S      0:00 nginx: worker <span class="token keyword">process</span>
 18568 ?        S      0:00 nginx: worker <span class="token keyword">process</span>
 22493 pts/0    R+     0:00 grep <span class="token operator">--</span>color=auto nginx
<span class="token namespace">[root@server1 sbin]</span><span class="token comment"># kill -USR2 18566</span>
<span class="token namespace">[root@server1 sbin]</span><span class="token comment"># ps ax | grep nginx</span>
 18566 ?        Ss     0:00 nginx: master <span class="token keyword">process</span> <span class="token operator">/</span>usr/local/nginx/sbin/nginx
 18567 ?        S      0:00 nginx: worker <span class="token keyword">process</span>
 18568 ?        S      0:00 nginx: worker <span class="token keyword">process</span>
 22495 ?        S      0:00 nginx: master <span class="token keyword">process</span> <span class="token operator">/</span>usr/local/nginx/sbin/nginx
 22496 ?        S      0:00 nginx: worker <span class="token keyword">process</span>
 22497 ?        S      0:00 nginx: worker <span class="token keyword">process</span>
 22499 pts/0    R+     0:00 grep <span class="token operator">--</span>color=auto nginx
<span class="token namespace">[root@server1 sbin]</span><span class="token comment"># kill -WINCH 18566</span>
<span class="token namespace">[root@server1 sbin]</span><span class="token comment"># ps ax | grep nginx</span>
 18566 ?        Ss     0:00 nginx: master <span class="token keyword">process</span> <span class="token operator">/</span>usr/local/nginx/sbin/nginx
 22495 ?        S      0:00 nginx: master <span class="token keyword">process</span> <span class="token operator">/</span>usr/local/nginx/sbin/nginx
 22496 ?        S      0:00 nginx: worker <span class="token keyword">process</span>
 22497 ?        S      0:00 nginx: worker <span class="token keyword">process</span>
 22503 pts/0    S+     0:00 grep <span class="token operator">--</span>color=auto nginx
<span class="token namespace">[root@server1 sbin]</span><span class="token comment"># ps ax | grep nginx</span>
 18566 ?        Ss     0:00 nginx: master <span class="token keyword">process</span> <span class="token operator">/</span>usr/local/nginx/sbin/nginx
 22495 ?        S      0:00 nginx: master <span class="token keyword">process</span> <span class="token operator">/</span>usr/local/nginx/sbin/nginx
 22496 ?        S      0:00 nginx: worker <span class="token keyword">process</span>
 22497 ?        S      0:00 nginx: worker <span class="token keyword">process</span>
 22505 pts/0    S+     0:00 grep <span class="token operator">--</span>color=auto nginx

</code></pre> 
  <p>这个时候可以看见老进程中的worker进程已经全部终止,这个时候再去查看版本,就会发现已经更改</p> 
  <pre><code class="prism language-powershell"><span class="token namespace">[root@server1 sbin]</span><span class="token comment"># curl -I localhost</span>
HTTP/1<span class="token punctuation">.</span>1 200 OK
Server: nginx/1<span class="token punctuation">.</span>21<span class="token punctuation">.</span>6
Date: Thu<span class="token punctuation">,</span> 29 Sep 2022 02:05:27 GMT
Content-<span class="token function">Type</span>: text/html
Content-Length: 612
Last-Modified: Fri<span class="token punctuation">,</span> 23 Sep 2022 23:13:57 GMT
Connection: keep-alive
ETag: <span class="token string">"632e3db5-264"</span>
Accept-Ranges: bytes

</code></pre> 
  <p>如果在我们升级之后又需要用到老版本,那么就要进行回滚;我们首先将原来复制的nginx.old复制给nginx然后用kill -HUP唤醒原进程,并且采用kill -WINCH 来回收新进程中的worker进程,这个时候就完成了版本回滚</p> 
  <pre><code class="prism language-powershell"><span class="token namespace">[root@server1 sbin]</span><span class="token comment"># \cp -f nginx.old nginx</span>
<span class="token namespace">[root@server1 sbin]</span><span class="token comment"># kill -HUP 18566</span>
<span class="token namespace">[root@server1 sbin]</span><span class="token comment"># curl -I localhost</span>
HTTP/1<span class="token punctuation">.</span>1 200 OK
Server: nginx/1<span class="token punctuation">.</span>21<span class="token punctuation">.</span>6
Date: Thu<span class="token punctuation">,</span> 29 Sep 2022 10:31:13 GMT
Content-<span class="token function">Type</span>: text/html
Content-Length: 612
Last-Modified: Fri<span class="token punctuation">,</span> 23 Sep 2022 23:13:57 GMT
Connection: keep-alive
ETag: <span class="token string">"632e3db5-264"</span>
Accept-Ranges: bytes

<span class="token namespace">[root@server1 sbin]</span><span class="token comment"># ps ax | grep nginx</span>
 18566 ?        Ss     0:00 nginx: master <span class="token keyword">process</span> <span class="token operator">/</span>usr/local/nginx/sbin/nginx
 22495 ?        S      0:00 nginx: master <span class="token keyword">process</span> <span class="token operator">/</span>usr/local/nginx/sbin/nginx
 22496 ?        S      0:00 nginx: worker <span class="token keyword">process</span>
 22497 ?        S      0:00 nginx: worker <span class="token keyword">process</span>
 22710 ?        S      0:00 nginx: worker <span class="token keyword">process</span>
 22711 ?        S      0:00 nginx: worker <span class="token keyword">process</span>
 22715 pts/0    R+     0:00 grep <span class="token operator">--</span>color=auto nginx
<span class="token namespace">[root@server1 sbin]</span><span class="token comment"># kill -WINCH 22495</span>
<span class="token namespace">[root@server1 sbin]</span><span class="token comment"># curl -I localhost</span>
HTTP/1<span class="token punctuation">.</span>1 200 OK
Server: nginx/1<span class="token punctuation">.</span>21<span class="token punctuation">.</span>1
Date: Thu<span class="token punctuation">,</span> 29 Sep 2022 10:31:43 GMT
Content-<span class="token function">Type</span>: text/html
Content-Length: 612
Last-Modified: Fri<span class="token punctuation">,</span> 23 Sep 2022 23:13:57 GMT
Connection: keep-alive
ETag: <span class="token string">"632e3db5-264"</span>
Accept-Ranges: bytes

</code></pre> 
  <h1>五、nginx限流</h1> 
  <p>我们有的时候需要nginx帮助我们对文件传输或者下载进行限流,这个时候我们可以采用以下方法来实现</p> 
  <p>比如我们在nginx.conf中添加以下内容,控制download中并发量为1</p> 
  <pre><code class="prism language-powershell"> limit_conn_zone <span class="token variable">$binary_remote_addr</span> zone=addr:10m<span class="token punctuation">;</span>
</code></pre> 
  <pre><code class="prism language-powershell">  location <span class="token operator">/</span>download/ <span class="token punctuation">{</span>
                limit_conn addr 1<span class="token punctuation">;</span>
        <span class="token punctuation">}</span>

</code></pre> 
  <p>在这时进行压力测试,-c10,结果会显示有部分错误</p> 
  <pre><code class="prism language-powershell"> ab <span class="token operator">-</span>c10 <span class="token operator">-</span>n 10 http:<span class="token operator">/</span><span class="token operator">/</span>192<span class="token punctuation">.</span>168<span class="token punctuation">.</span>110<span class="token punctuation">.</span>2/download/R8<span class="token punctuation">.</span>jpg
</code></pre> 
  <pre><code class="prism language-powershell">Concurrency Level:      10
Time taken <span class="token keyword">for</span> tests:   0<span class="token punctuation">.</span>007 seconds
Complete requests:      10
Failed requests:        4

</code></pre> 
  <p>如果我们将并发改为1,就不会出现错误</p> 
  <pre><code class="prism language-powershell"><span class="token namespace">[root@server5 sbin]</span><span class="token comment"># ab -c1 -n 10 http://192.168.110.2/download/R8.jpg</span>
</code></pre> 
  <p>刚刚我们限制了并发连接数,现在我们可以限制请求速率,例如限制每秒一个</p> 
  <pre><code class="prism language-powershell">
        limit_conn_zone <span class="token variable">$binary_remote_addr</span> zone=addr:10m<span class="token punctuation">;</span>
        limit_req_zone <span class="token variable">$binary_remote_addr</span> zone=one:10m rate=1r/s<span class="token punctuation">;</span>

    server <span class="token punctuation">{</span>
        listen       80<span class="token punctuation">;</span>
        server_name  localhost<span class="token punctuation">;</span>

        <span class="token comment">#charset koi8-r;</span>

        <span class="token comment">#access_log  logs/host.access.log  main;</span>

        location <span class="token operator">/</span> <span class="token punctuation">{</span>
            root   html<span class="token punctuation">;</span>
            index  index<span class="token punctuation">.</span>html index<span class="token punctuation">.</span>htm<span class="token punctuation">;</span>
        <span class="token punctuation">}</span>

        location <span class="token operator">/</span>download/ <span class="token punctuation">{</span>
                limit_conn addr 1<span class="token punctuation">;</span>
                limit_req zone=one<span class="token punctuation">;</span>
        <span class="token punctuation">}</span>

</code></pre> 
  <p>进行压测会发现报错,因为我们要处理10个请求,但是限制了每秒一个而且并发为1</p> 
  <pre><code class="prism language-powershell">Time taken <span class="token keyword">for</span> tests:   0<span class="token punctuation">.</span>010 seconds
Complete requests:      10
Failed requests:        5

</code></pre> 
  <p>我们再添加一个限制,就是让超出速率限制的请求进行排队,而burst的值就是排队的最大数量</p> 
  <pre><code class="prism language-powershell">  location <span class="token operator">/</span>download/ <span class="token punctuation">{</span>
                limit_conn addr 1<span class="token punctuation">;</span>
                limit_req zone=one burst=5<span class="token punctuation">;</span>
        <span class="token punctuation">}</span>


</code></pre> 
  <pre><code class="prism language-powershell">Concurrency Level:      1
Time taken <span class="token keyword">for</span> tests:   5<span class="token punctuation">.</span>017 seconds

</code></pre> 
  <p>也可以进行限制带宽</p> 
  <pre><code class="prism language-powershell">location <span class="token operator">/</span>download/ <span class="token punctuation">{</span>
                limit_conn addr 1<span class="token punctuation">;</span>
                limit_req zone=one burst=5<span class="token punctuation">;</span>
                limit_rate 50k<span class="token punctuation">;</span>
        <span class="token punctuation">}</span>

</code></pre> 
  <p>可以看见,限制带宽之后,处理十张照片花费的时间大大增多,我们可以根据需求来对带宽进行限制</p> 
  <pre><code class="prism language-powershell">Concurrency Level:      1
Time taken <span class="token keyword">for</span> tests:   60<span class="token punctuation">.</span>615 seconds
Complete requests:      10

</code></pre> 
  <h1>六、nginx配置管理</h1> 
  <p>我们如果想要下载比较直观方便,可以进行以下设置</p> 
  <pre><code class="prism language-powershell"> location <span class="token operator">/</span>download/ <span class="token punctuation">{</span>
                limit_conn addr 1<span class="token punctuation">;</span>
                limit_req zone=one burst=5<span class="token punctuation">;</span>
                limit_rate 50k<span class="token punctuation">;</span>
                autoindex on<span class="token punctuation">;</span>
        <span class="token punctuation">}</span>


</code></pre> 
  <p>可以看到,之前在访问的时候会直接出现图片,而现在会出现一个目录供我们选择,更加直观方便<br> <a href="http://img.e-com-net.com/image/info8/6e75bf9e0e93432eaedd30fb5e771f1f.jpg" target="_blank"><img src="http://img.e-com-net.com/image/info8/6e75bf9e0e93432eaedd30fb5e771f1f.jpg" alt="Linux企业运维(二)nginx_第1张图片" width="650" height="286" style="border:1px solid black;"></a><br> <strong>日志轮循</strong><br> 写一个脚本,让日志做一个截断</p> 
  <pre><code class="prism language-powershell"><span class="token comment">#! /bin/bash</span>
cd <span class="token operator">/</span>usr/local/nginx/logs && <span class="token function">mv</span> access<span class="token punctuation">.</span>log access_$<span class="token punctuation">(</span>date <span class="token operator">+</span><span class="token operator">%</span>F <span class="token operator">-</span>d <span class="token operator">-</span>1day<span class="token punctuation">)</span><span class="token punctuation">.</span>log
<span class="token function">kill</span> <span class="token operator">-</span>USR1 `<span class="token function">cat</span> <span class="token operator">/</span>usr/local/nginx/logs/nginx<span class="token punctuation">.</span>pid`

</code></pre> 
  <p>crontab -e添加定时任务</p> 
  <pre><code class="prism language-powershell">00 00 <span class="token operator">*</span> <span class="token operator">*</span> <span class="token operator">*</span> <span class="token operator">/</span>opt/nginxlog<span class="token punctuation">.</span>sh
</code></pre> 
  <p>进行测试后会发现,前一天的日志已经被截断,新的日志都放在了今天的新access.log下</p> 
  <pre><code class="prism language-powershell"><span class="token namespace">[root@server1 logs]</span><span class="token comment"># ll</span>
total 72
<span class="token operator">-</span>rw-r-<span class="token operator">-</span>r-<span class="token operator">-</span> 1 root  root 42240 Sep 30 09:39 access_2022-09-29<span class="token punctuation">.</span>log
<span class="token operator">-</span>rw-r-<span class="token operator">-</span>r-<span class="token operator">-</span> 1 nginx root     0 Sep 30 10:19 access<span class="token punctuation">.</span>log
<span class="token operator">-</span>rw-r-<span class="token operator">-</span>r-<span class="token operator">-</span> 1 nginx root 24095 Sep 30 09:38 error<span class="token punctuation">.</span>log
<span class="token operator">-</span>rw-r-<span class="token operator">-</span>r-<span class="token operator">-</span> 1 root  root     6 Sep 30 00:58 nginx<span class="token punctuation">.</span>pid
<span class="token namespace">[root@server1 logs]</span><span class="token comment"># ll</span>
total 84
<span class="token operator">-</span>rw-r-<span class="token operator">-</span>r-<span class="token operator">-</span> 1 root  root 42240 Sep 30 09:39 access_2022-09-29<span class="token punctuation">.</span>log
<span class="token operator">-</span>rw-r-<span class="token operator">-</span>r-<span class="token operator">-</span> 1 nginx root 10500 Sep 30 10:20 access<span class="token punctuation">.</span>log
<span class="token operator">-</span>rw-r-<span class="token operator">-</span>r-<span class="token operator">-</span> 1 nginx root 24095 Sep 30 09:38 error<span class="token punctuation">.</span>log
<span class="token operator">-</span>rw-r-<span class="token operator">-</span>r-<span class="token operator">-</span> 1 root  root     6 Sep 30 00:58 nginx<span class="token punctuation">.</span>pid

</code></pre> 
  <p>对于一些没有必要写入日志的内容我们可以=采用access_log off;来关闭日志写入<br> 也可以对可见主机进行限制,比如允许本机访问而不允许其他主机访问<br> <a href="http://img.e-com-net.com/image/info8/cddeb775022b4ee0a5411fba30df1c2d.jpg" target="_blank"><img src="http://img.e-com-net.com/image/info8/cddeb775022b4ee0a5411fba30df1c2d.jpg" alt="在这里插入图片描述" width="209" height="81"></a><br> <strong>nginx重定向</strong><br> 对于没有开放的域名,我们可以对其设置重定向</p> 
  <pre><code class="prism language-powershell">
    server <span class="token punctuation">{</span>
        listen       80<span class="token punctuation">;</span>
        server_name  localhost<span class="token punctuation">;</span>
        rewrite ^<span class="token punctuation">(</span><span class="token punctuation">.</span><span class="token operator">*</span><span class="token punctuation">)</span> http:<span class="token operator">/</span><span class="token operator">/</span>www<span class="token punctuation">.</span>westos<span class="token punctuation">.</span>org permanent<span class="token punctuation">;</span>

</code></pre> 
  <p>也可以设置443重定向</p> 
  <pre><code class="prism language-powershell">  server <span class="token punctuation">{</span>
        listen       443 ssl<span class="token punctuation">;</span>
        server_name  www<span class="token punctuation">.</span>westos<span class="token punctuation">.</span>org<span class="token punctuation">;</span>

        ssl_certificate      cert<span class="token punctuation">.</span>pem<span class="token punctuation">;</span>
        ssl_certificate_key  cert<span class="token punctuation">.</span>pem<span class="token punctuation">;</span>

        ssl_session_cache    shared:SSL:1m<span class="token punctuation">;</span>
        ssl_session_timeout  5m<span class="token punctuation">;</span>

        ssl_ciphers  HIGH:<span class="token operator">!</span>aNULL:<span class="token operator">!</span>MD5<span class="token punctuation">;</span>
        ssl_prefer_server_ciphers  on<span class="token punctuation">;</span>

        location <span class="token operator">/</span> <span class="token punctuation">{</span>
            root   html<span class="token punctuation">;</span>
            index  index<span class="token punctuation">.</span>html index<span class="token punctuation">.</span>htm<span class="token punctuation">;</span>
        <span class="token punctuation">}</span>
    <span class="token punctuation">}</span>
        server <span class="token punctuation">{</span>
                listen 80<span class="token punctuation">;</span>
                server_name www<span class="token punctuation">.</span>westos<span class="token punctuation">.</span>org<span class="token punctuation">;</span>
                rewrite ^<span class="token operator">/</span><span class="token punctuation">(</span><span class="token punctuation">.</span><span class="token operator">*</span><span class="token punctuation">)</span>$ https:<span class="token operator">/</span><span class="token operator">/</span>www<span class="token punctuation">.</span>westos<span class="token punctuation">.</span>org/<span class="token variable">$1</span> permanent<span class="token punctuation">;</span>
                <span class="token comment">#location / {</span>
                <span class="token comment">#       proxy_pass http://westos;</span>
                <span class="token comment">#}</span>
        <span class="token punctuation">}</span>
<span class="token punctuation">}</span>

</code></pre> 
  <p>这里再次进行测试会发现已经完成重定向</p> 
  <pre><code class="prism language-powershell"><span class="token namespace">[root@server5 ~]</span><span class="token comment"># curl -I www.westos.org</span>
HTTP/1<span class="token punctuation">.</span>1 301 Moved Permanently
Server: nginx/1<span class="token punctuation">.</span>21<span class="token punctuation">.</span>1
Date: Fri<span class="token punctuation">,</span> 30 Sep 2022 03:01:04 GMT
Content-<span class="token function">Type</span>: text/html
Content-Length: 169
Connection: keep-alive
Location: https:<span class="token operator">/</span><span class="token operator">/</span>www<span class="token punctuation">.</span>westos<span class="token punctuation">.</span>org/

</code></pre> 
  <p><strong>nginx防盗链</strong><br> 我们有的时候访问网站中的内容并不是通过原网站进行访问,这时候就会白白消耗资源,所以可以设置防盗链,如果是通过其他地址访问就会显示错误或者可以将其跳转至其他页面</p> 
  <pre><code class="prism language-powershell">location ~ \<span class="token punctuation">.</span><span class="token punctuation">(</span>jpg<span class="token punctuation">|</span>png<span class="token punctuation">)</span>$ <span class="token punctuation">{</span>
        root html<span class="token punctuation">;</span>
        valid_referers none blocked www<span class="token punctuation">.</span>westos<span class="token punctuation">.</span>org<span class="token punctuation">;</span>
        <span class="token keyword">if</span> <span class="token punctuation">(</span><span class="token variable">$invalid_referer</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
                <span class="token keyword">return</span> 403<span class="token punctuation">;</span>
                <span class="token comment">#rewrite ^/http://www2.westos.org/R8.jpg;</span>
        <span class="token punctuation">}</span>
        <span class="token punctuation">}</span>

</code></pre> 
 </div> 
</div>
                            </div>
                        </div>
                    </div>
                    <!--PC和WAP自适应版-->
                    <div id="SOHUCS" sid="1598843222967222272"></div>
                    <script type="text/javascript" src="/views/front/js/chanyan.js"></script>
                    <!-- 文章页-底部 动态广告位 -->
                    <div class="youdao-fixed-ad" id="detail_ad_bottom"></div>
                </div>
                <div class="col-md-3">
                    <div class="row" id="ad">
                        <!-- 文章页-右侧1 动态广告位 -->
                        <div id="right-1" class="col-lg-12 col-md-12 col-sm-4 col-xs-4 ad">
                            <div class="youdao-fixed-ad" id="detail_ad_1"> </div>
                        </div>
                        <!-- 文章页-右侧2 动态广告位 -->
                        <div id="right-2" class="col-lg-12 col-md-12 col-sm-4 col-xs-4 ad">
                            <div class="youdao-fixed-ad" id="detail_ad_2"></div>
                        </div>
                        <!-- 文章页-右侧3 动态广告位 -->
                        <div id="right-3" class="col-lg-12 col-md-12 col-sm-4 col-xs-4 ad">
                            <div class="youdao-fixed-ad" id="detail_ad_3"></div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="container">
        <h4 class="pt20 mb15 mt0 border-top">你可能感兴趣的:(Linux企业运维,nginx,运维,linux)</h4>
        <div id="paradigm-article-related">
            <div class="recommend-post mb30">
                <ul class="widget-links">
                    <li><a href="/article/1835513699826233344.htm"
                           title="android系统selinux中添加新属性property" target="_blank">android系统selinux中添加新属性property</a>
                        <span class="text-muted">辉色投像</span>

                        <div>1.定位/android/system/sepolicy/private/property_contexts声明属性开头:persist.charge声明属性类型:u:object_r:system_prop:s0图12.定位到android/system/sepolicy/public/domain.te删除neverallow{domain-init}default_prop:property</div>
                    </li>
                    <li><a href="/article/1835509391361667072.htm"
                           title="Linux下QT开发的动态库界面弹出操作(SDL2)" target="_blank">Linux下QT开发的动态库界面弹出操作(SDL2)</a>
                        <span class="text-muted">13jjyao</span>
<a class="tag" taget="_blank" href="/search/QT%E7%B1%BB/1.htm">QT类</a><a class="tag" taget="_blank" href="/search/qt/1.htm">qt</a><a class="tag" taget="_blank" href="/search/%E5%BC%80%E5%8F%91%E8%AF%AD%E8%A8%80/1.htm">开发语言</a><a class="tag" taget="_blank" href="/search/sdl2/1.htm">sdl2</a><a class="tag" taget="_blank" href="/search/linux/1.htm">linux</a>
                        <div>需求:操作系统为linux,开发框架为qt,做成需带界面的qt动态库,调用方为java等非qt程序难点:调用方为java等非qt程序,也就是说调用方肯定不带QApplication::exec(),缺少了这个,QTimer等事件和QT创建的窗口将不能弹出(包括opencv也是不能弹出);这与qt调用本身qt库是有本质的区别的思路:1.调用方缺QApplication::exec(),那么我们在接口</div>
                    </li>
                    <li><a href="/article/1835504596898902016.htm"
                           title="linux sdl windows.h,Windows下的SDL安装" target="_blank">linux sdl windows.h,Windows下的SDL安装</a>
                        <span class="text-muted">奔跑吧linux内核</span>
<a class="tag" taget="_blank" href="/search/linux/1.htm">linux</a><a class="tag" taget="_blank" href="/search/sdl/1.htm">sdl</a><a class="tag" taget="_blank" href="/search/windows.h/1.htm">windows.h</a>
                        <div>首先你要下载并安装SDL开发包。如果装在C盘下,路径为C:\SDL1.2.5如果在WINDOWS下。你可以按以下步骤:1.打开VC++,点击"Tools",Options2,点击directories选项3.选择"Includefiles"增加一个新的路径。"C:\SDL1.2.5\include"4,现在选择"Libaryfiles“增加"C:\SDL1.2.5\lib"现在你可以开始编写你的第</div>
                    </li>
                    <li><a href="/article/1835503712899002368.htm"
                           title="linux中sdl的使用教程,sdl使用入门" target="_blank">linux中sdl的使用教程,sdl使用入门</a>
                        <span class="text-muted">Melissa Corvinus</span>
<a class="tag" taget="_blank" href="/search/linux%E4%B8%ADsdl%E7%9A%84%E4%BD%BF%E7%94%A8%E6%95%99%E7%A8%8B/1.htm">linux中sdl的使用教程</a>
                        <div>本文通过一个简单示例讲解SDL的基本使用流程。示例中展示一个窗口,窗口里面有个随机颜色快随机移动。当我们鼠标点击关闭按钮时间窗口关闭。基本步骤如下:1.初始化SDL并创建一个窗口。SDL_Init()初始化SDL_CreateWindow()创建窗口2.纹理渲染存储RGB和存储纹理的区别:比如一个从左到右由红色渐变到蓝色的矩形,用存储RGB的话就需要把矩形中每个点的具体颜色值存储下来;而纹理只是一</div>
                    </li>
                    <li><a href="/article/1835502578050363392.htm"
                           title="PHP环境搭建详细教程" target="_blank">PHP环境搭建详细教程</a>
                        <span class="text-muted">好看资源平台</span>
<a class="tag" taget="_blank" href="/search/%E5%89%8D%E7%AB%AF/1.htm">前端</a><a class="tag" taget="_blank" href="/search/php/1.htm">php</a>
                        <div>PHP是一个流行的服务器端脚本语言,广泛用于Web开发。为了使PHP能够在本地或服务器上运行,我们需要搭建一个合适的PHP环境。本教程将结合最新资料,介绍在不同操作系统上搭建PHP开发环境的多种方法,包括Windows、macOS和Linux系统的安装步骤,以及本地和Docker环境的配置。1.PHP环境搭建概述PHP环境的搭建主要分为以下几类:集成开发环境:例如XAMPP、WAMP、MAMP,这</div>
                    </li>
                    <li><a href="/article/1835501948011376640.htm"
                           title="使用 FinalShell 进行远程连接(ssh 远程连接 Linux 服务器)" target="_blank">使用 FinalShell 进行远程连接(ssh 远程连接 Linux 服务器)</a>
                        <span class="text-muted">编程经验分享</span>
<a class="tag" taget="_blank" href="/search/%E5%BC%80%E5%8F%91%E5%B7%A5%E5%85%B7/1.htm">开发工具</a><a class="tag" taget="_blank" href="/search/%E6%9C%8D%E5%8A%A1%E5%99%A8/1.htm">服务器</a><a class="tag" taget="_blank" href="/search/ssh/1.htm">ssh</a><a class="tag" taget="_blank" href="/search/linux/1.htm">linux</a>
                        <div>目录前言基本使用教程新建远程连接连接主机自定义命令路由追踪前言后端开发,必然需要和服务器打交道,部署应用,排查问题,查看运行日志等等。一般服务器都是集中部署在机房中,也有一些直接是云服务器,总而言之,程序员不可能直接和服务器直接操作,一般都是通过ssh连接来登录服务器。刚接触远程连接时,使用的是XSHELL来远程连接服务器,连接上就能够操作远程服务器了,但是仅用XSHELL并没有上传下载文件的功能</div>
                    </li>
                    <li><a href="/article/1835493373906087936.htm"
                           title="libyuv之linux编译" target="_blank">libyuv之linux编译</a>
                        <span class="text-muted">jaronho</span>
<a class="tag" taget="_blank" href="/search/Linux/1.htm">Linux</a><a class="tag" taget="_blank" href="/search/linux/1.htm">linux</a><a class="tag" taget="_blank" href="/search/%E8%BF%90%E7%BB%B4/1.htm">运维</a><a class="tag" taget="_blank" href="/search/%E6%9C%8D%E5%8A%A1%E5%99%A8/1.htm">服务器</a>
                        <div>文章目录一、下载源码二、编译源码三、注意事项1、银河麒麟系统(aarch64)(1)解决armv8-a+dotprod+i8mm指令集支持问题(2)解决armv9-a+sve2指令集支持问题一、下载源码到GitHub网站下载https://github.com/lemenkov/libyuv源码,或者用直接用git克隆到本地,如:gitclonehttps://github.com/lemenko</div>
                    </li>
                    <li><a href="/article/1835489588169240576.htm"
                           title="ARM驱动学习之5 LEDS驱动" target="_blank">ARM驱动学习之5 LEDS驱动</a>
                        <span class="text-muted">JT灬新一</span>
<a class="tag" taget="_blank" href="/search/%E5%B5%8C%E5%85%A5%E5%BC%8F/1.htm">嵌入式</a><a class="tag" taget="_blank" href="/search/C/1.htm">C</a><a class="tag" taget="_blank" href="/search/%E5%BA%95%E5%B1%82/1.htm">底层</a><a class="tag" taget="_blank" href="/search/arm%E5%BC%80%E5%8F%91/1.htm">arm开发</a><a class="tag" taget="_blank" href="/search/%E5%AD%A6%E4%B9%A0/1.htm">学习</a><a class="tag" taget="_blank" href="/search/%E5%8D%95%E7%89%87%E6%9C%BA/1.htm">单片机</a>
                        <div>ARM驱动学习之5LEDS驱动知识点:•linuxGPIO申请函数和赋值函数–gpio_request–gpio_set_value•三星平台配置GPIO函数–s3c_gpio_cfgpin•GPIO配置输出模式的宏变量–S3C_GPIO_OUTPUT注意点:DRIVER_NAME和DEVICE_NAME匹配。实现步骤:1.加入需要的头文件://Linux平台的gpio头文件#include//三</div>
                    </li>
                    <li><a href="/article/1835485681187647488.htm"
                           title="【华为OD技术面试真题精选 - 非技术题】 -HR面,综合面_华为od hr面" target="_blank">【华为OD技术面试真题精选 - 非技术题】 -HR面,综合面_华为od hr面</a>
                        <span class="text-muted">一个射手座的程序媛</span>
<a class="tag" taget="_blank" href="/search/%E7%A8%8B%E5%BA%8F%E5%91%98/1.htm">程序员</a><a class="tag" taget="_blank" href="/search/%E5%8D%8E%E4%B8%BAod/1.htm">华为od</a><a class="tag" taget="_blank" href="/search/%E9%9D%A2%E8%AF%95/1.htm">面试</a><a class="tag" taget="_blank" href="/search/%E8%81%8C%E5%9C%BA%E5%92%8C%E5%8F%91%E5%B1%95/1.htm">职场和发展</a>
                        <div>最后的话最近很多小伙伴找我要Linux学习资料,于是我翻箱倒柜,整理了一些优质资源,涵盖视频、电子书、PPT等共享给大家!资料预览给大家整理的视频资料:给大家整理的电子书资料:如果本文对你有帮助,欢迎点赞、收藏、转发给朋友,让我有持续创作的动力!网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。需要这份系统化的资料的朋友,可以点击这里获</div>
                    </li>
                    <li><a href="/article/1835482277870661632.htm"
                           title="简介Shell、zsh、bash" target="_blank">简介Shell、zsh、bash</a>
                        <span class="text-muted">zhaosuningsn</span>
<a class="tag" taget="_blank" href="/search/Shell/1.htm">Shell</a><a class="tag" taget="_blank" href="/search/zsh/1.htm">zsh</a><a class="tag" taget="_blank" href="/search/bash/1.htm">bash</a><a class="tag" taget="_blank" href="/search/shell/1.htm">shell</a><a class="tag" taget="_blank" href="/search/linux/1.htm">linux</a><a class="tag" taget="_blank" href="/search/bash/1.htm">bash</a>
                        <div>Shell是Linux和Unix的外壳,类似衣服,负责外界与Linux和Unix内核的交互联系。例如接收终端用户及各种应用程序的命令,把接收的命令翻译成内核能理解的语言,传递给内核,并把内核处理接收的命令的结果返回给外界,即Shell是外界和内核沟通的桥梁或大门。Linux和Unix提供了多种Shell,其中有种bash,当然还有其他好多种。Mac电脑中不但有bash,还有一个zsh,预装的,据说</div>
                    </li>
                    <li><a href="/article/1835479000600899584.htm"
                           title="Linux MariaDB使用OpenSSL安装SSL证书" target="_blank">Linux MariaDB使用OpenSSL安装SSL证书</a>
                        <span class="text-muted">Meta39</span>
<a class="tag" taget="_blank" href="/search/MySQL/1.htm">MySQL</a><a class="tag" taget="_blank" href="/search/Oracle/1.htm">Oracle</a><a class="tag" taget="_blank" href="/search/MariaDB/1.htm">MariaDB</a><a class="tag" taget="_blank" href="/search/Linux/1.htm">Linux</a><a class="tag" taget="_blank" href="/search/Windows/1.htm">Windows</a><a class="tag" taget="_blank" href="/search/ssl/1.htm">ssl</a><a class="tag" taget="_blank" href="/search/linux/1.htm">linux</a><a class="tag" taget="_blank" href="/search/mariadb/1.htm">mariadb</a>
                        <div>进入到证书存放目录,批量删除.pem证书警告:确保已经进入到证书存放目录find.-typef-iname\*.pem-delete查看是否安装OpenSSLopensslversion没有则安装yuminstallopensslopenssl-devel开启SSL编辑/etc/my.cnf文件(没有的话就创建,但是要注意,在/etc/my.cnf.d/server.cnf配置了datadir的,</div>
                    </li>
                    <li><a href="/article/1835469294436184064.htm"
                           title="【从浅识到熟知Linux】Linux发展史" target="_blank">【从浅识到熟知Linux】Linux发展史</a>
                        <span class="text-muted">Jammingpro</span>
<a class="tag" taget="_blank" href="/search/%E4%BB%8E%E6%B5%85%E5%AD%A6%E5%88%B0%E7%86%9F%E7%9F%A5Linux/1.htm">从浅学到熟知Linux</a><a class="tag" taget="_blank" href="/search/linux/1.htm">linux</a><a class="tag" taget="_blank" href="/search/%E8%BF%90%E7%BB%B4/1.htm">运维</a><a class="tag" taget="_blank" href="/search/%E6%9C%8D%E5%8A%A1%E5%99%A8/1.htm">服务器</a>
                        <div>归属专栏:从浅学到熟知Linux个人主页:Jammingpro每日努力一点点,技术变化看得见文章前言:本篇文章记录Linux发展的历史,因在介绍Linux过程中涉及的其他操作系统及人物,本文对相关内容也有所介绍。文章目录Unix发展史Linux发展史开源Linux官网企业应用情况发行版本在学习Linux前,我们可能都会问Linux从哪里来?它是如何发展的。但在介绍Linux之前,需要先介绍一下Un</div>
                    </li>
                    <li><a href="/article/1835467782687387648.htm"
                           title="linux 发展史" target="_blank">linux 发展史</a>
                        <span class="text-muted">种树的猴子</span>
<a class="tag" taget="_blank" href="/search/%E5%86%85%E6%A0%B8/1.htm">内核</a><a class="tag" taget="_blank" href="/search/java/1.htm">java</a><a class="tag" taget="_blank" href="/search/%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F/1.htm">操作系统</a><a class="tag" taget="_blank" href="/search/linux/1.htm">linux</a><a class="tag" taget="_blank" href="/search/%E5%A4%A7%E6%95%B0%E6%8D%AE/1.htm">大数据</a>
                        <div>linux发展史说明此前对linux认识模糊一知半解,近期通过学习将自己对于linux的发展总结一下方便大家日后的学习。那Linux是目前一款非常火热的开源操作系统,可是linux是什么时候出现的,又是因为什么样的原因被开发出来的呢。以下将对linux的发展历程进行详细的讲解。目录一、Linux发展背景二、UINIX的诞生三、UNIX的重要分支-BSD的诞生四、Minix的诞生五、GNU与Free</div>
                    </li>
                    <li><a href="/article/1835466523163062272.htm"
                           title="Linux sh命令" target="_blank">Linux sh命令</a>
                        <span class="text-muted">fengyehongWorld</span>
<a class="tag" taget="_blank" href="/search/Linux/1.htm">Linux</a><a class="tag" taget="_blank" href="/search/linux/1.htm">linux</a>
                        <div>目录一.基本语法二.选项2.1-c字符串中读取内容,并执行2.1.1基本用法2.1.2获取当前目录下失效的超链接2.2-x每个命令执行之前,将其打印出来2.3结合Here文档使用一.基本语法⏹Linux和Unix系统中用于执行shell脚本或运行命令的命令。sh[选项][脚本文件][参数...]⏹选项-c:从字符串中读取内容,并执行。-x:在每个命令执行之前,将其打印出来。-s:从标准流中读取内容</div>
                    </li>
                    <li><a href="/article/1835466270955368448.htm"
                           title="Linux vi常用命令" target="_blank">Linux vi常用命令</a>
                        <span class="text-muted">fengyehongWorld</span>
<a class="tag" taget="_blank" href="/search/Linux/1.htm">Linux</a><a class="tag" taget="_blank" href="/search/linux/1.htm">linux</a>
                        <div>参考资料viコマンド(vimコマンド)リファレンス目录一.保存系命令二.删除系命令三.移动系命令四.复制粘贴系命令一.保存系命令⏹保存并退出:wq⏹强制保存并退出:wq!⏹退出(文件未编辑):q⏹强制退出(忽略已编辑内容):q!⏹另存为:w新文件名二.删除系命令⏹删除当前行dd⏹清空整个文档gg:移动到文档顶部dG:删除到最后一行ggdG三.移动系命令⏹移动到文档顶部gg⏹移动到文档底部#方式1G</div>
                    </li>
                    <li><a href="/article/1835452402178813952.htm"
                           title="Linux查看服务器日志" target="_blank">Linux查看服务器日志</a>
                        <span class="text-muted">TPBoreas</span>
<a class="tag" taget="_blank" href="/search/%E8%BF%90%E7%BB%B4/1.htm">运维</a><a class="tag" taget="_blank" href="/search/linux/1.htm">linux</a><a class="tag" taget="_blank" href="/search/%E8%BF%90%E7%BB%B4/1.htm">运维</a>
                        <div>一、tail这个是我最常用的一种查看方式用法如下:tail-n10test.log查询日志尾部最后10行的日志;tail-n+10test.log查询10行之后的所有日志;tail-fn10test.log循环实时查看最后1000行记录(最常用的)一般还会配合着grep用,(实时抓包)例如:tail-fn1000test.log|grep'关键字'(动态抓包)tail-fn1000test.log</div>
                    </li>
                    <li><a href="/article/1835443696431099904.htm"
                           title="笋丁网页自动回复机器人V3.0.0免授权版源码" target="_blank">笋丁网页自动回复机器人V3.0.0免授权版源码</a>
                        <span class="text-muted">希希分享</span>
<a class="tag" taget="_blank" href="/search/%E8%BD%AF%E5%B8%8C%E7%BD%9158soho_cn/1.htm">软希网58soho_cn</a><a class="tag" taget="_blank" href="/search/%E6%BA%90%E7%A0%81%E8%B5%84%E6%BA%90/1.htm">源码资源</a><a class="tag" taget="_blank" href="/search/%E7%AC%8B%E4%B8%81%E7%BD%91%E9%A1%B5%E8%87%AA%E5%8A%A8%E5%9B%9E%E5%A4%8D%E6%9C%BA%E5%99%A8%E4%BA%BA/1.htm">笋丁网页自动回复机器人</a>
                        <div>笋丁网页机器人一款可设置自动回复,默认消息,调用自定义api接口的网页机器人。此程序后端语言使用Golang,内存占用最高不超过30MB,1H1G服务器流畅运行。仅支持Linux服务器部署,不支持虚拟主机,请悉知!使用自定义api功能需要有一定的建站基础。源码下载:https://download.csdn.net/download/m0_66047725/89754250更多资源下载:关注我。安</div>
                    </li>
                    <li><a href="/article/1835434126874865664.htm"
                           title="ubuntu安装wordpress" target="_blank">ubuntu安装wordpress</a>
                        <span class="text-muted">lissettecarlr</span>

                        <div>1安装nginx网上安装方式很多,这就就直接用apt-get了apt-getinstallnginx不用启动啥,然后直接在浏览器里面输入IP:80就能看到nginx的主页了。如果修改了一些配置可以使用下列命令重启一下systemctlrestartnginx.service2安装mysql输入安装前也可以更新一下软件源,在安装过程中将会让你输入数据库的密码。sudoapt-getinstallmy</div>
                    </li>
                    <li><a href="/article/1835432358141063168.htm"
                           title="深入浅出 -- 系统架构之负载均衡Nginx的性能优化" target="_blank">深入浅出 -- 系统架构之负载均衡Nginx的性能优化</a>
                        <span class="text-muted">xiaoli8748_软件开发</span>
<a class="tag" taget="_blank" href="/search/%E7%B3%BB%E7%BB%9F%E6%9E%B6%E6%9E%84/1.htm">系统架构</a><a class="tag" taget="_blank" href="/search/%E7%B3%BB%E7%BB%9F%E6%9E%B6%E6%9E%84/1.htm">系统架构</a><a class="tag" taget="_blank" href="/search/%E8%B4%9F%E8%BD%BD%E5%9D%87%E8%A1%A1/1.htm">负载均衡</a><a class="tag" taget="_blank" href="/search/nginx/1.htm">nginx</a>
                        <div>一、Nginx性能优化到这里文章的篇幅较长了,最后再来聊一下关于Nginx的性能优化,主要就简单说说收益最高的几个优化项,在这块就不再展开叙述了,毕竟影响性能都有多方面原因导致的,比如网络、服务器硬件、操作系统、后端服务、程序自身、数据库服务等,对于性能调优比较感兴趣的可以参考之前《JVM性能调优》中的调优思想。优化一:打开长连接配置通常Nginx作为代理服务,负责分发客户端的请求,那么建议开启H</div>
                    </li>
                    <li><a href="/article/1835428317084348416.htm"
                           title="最简单将静态网页挂载到服务器上(不用nginx)" target="_blank">最简单将静态网页挂载到服务器上(不用nginx)</a>
                        <span class="text-muted">全能全知者</span>
<a class="tag" taget="_blank" href="/search/%E6%9C%8D%E5%8A%A1%E5%99%A8/1.htm">服务器</a><a class="tag" taget="_blank" href="/search/nginx/1.htm">nginx</a><a class="tag" taget="_blank" href="/search/%E8%BF%90%E7%BB%B4/1.htm">运维</a><a class="tag" taget="_blank" href="/search/%E5%89%8D%E7%AB%AF/1.htm">前端</a><a class="tag" taget="_blank" href="/search/html/1.htm">html</a><a class="tag" taget="_blank" href="/search/%E7%AC%94%E8%AE%B0/1.htm">笔记</a>
                        <div>最简单将静态网页挂载到服务器上(不用nginx)如果随便弄个静态网页挂在服务器都要用nignx就太麻烦了,所以直接使用Apache来搭建一些简单前端静态网页会相对方便很多检查Web服务器服务状态:sudosystemctlstatushttpd#ApacheWeb服务器如果发现没有安装web服务器:安装Apache:sudoyuminstallhttpd启动Apache:sudosystemctl</div>
                    </li>
                    <li><a href="/article/1835417097660887040.htm"
                           title="Linux CTF逆向入门" target="_blank">Linux CTF逆向入门</a>
                        <span class="text-muted">蚁景网络安全</span>
<a class="tag" taget="_blank" href="/search/linux/1.htm">linux</a><a class="tag" taget="_blank" href="/search/%E8%BF%90%E7%BB%B4/1.htm">运维</a><a class="tag" taget="_blank" href="/search/CTF/1.htm">CTF</a>
                        <div>1.ELF格式我们先来看看ELF文件头,如果想详细了解,可以查看ELF的manpage文档。关于ELF更详细的说明:e_shoff:节头表的文件偏移量(字节)。如果文件没有节头表,则此成员值为零。sh_offset:表示了该section(节)离开文件头部位置的距离+-------------------+|ELFheader|---++--------->+-------------------</div>
                    </li>
                    <li><a href="/article/1835415332345442304.htm"
                           title="NPM私库搭建-verdaccio(Linux)" target="_blank">NPM私库搭建-verdaccio(Linux)</a>
                        <span class="text-muted">Beam007</span>
<a class="tag" taget="_blank" href="/search/npm/1.htm">npm</a><a class="tag" taget="_blank" href="/search/linux/1.htm">linux</a><a class="tag" taget="_blank" href="/search/%E5%89%8D%E7%AB%AF/1.htm">前端</a>
                        <div>1、安装nodelinux服务器安装nodea)、官网下载所需的node版本https://nodejs.org/dist/v14.21.0/b)、解压安装包若下载的是xxx.tar.xz文件,解压命令为tar-xvfxxx.tar.xzc)、修改环境变量修改:/etc/profile文件#SETPATHFORNODEJSexportNODE_HOME=NODEJS解压安装的路径exportPAT</div>
                    </li>
                    <li><a href="/article/1835400463676174336.htm"
                           title="C++常见知识掌握" target="_blank">C++常见知识掌握</a>
                        <span class="text-muted">nfgo</span>
<a class="tag" taget="_blank" href="/search/c%2B%2B/1.htm">c++</a><a class="tag" taget="_blank" href="/search/%E5%BC%80%E5%8F%91%E8%AF%AD%E8%A8%80/1.htm">开发语言</a>
                        <div>1.Linux软件开发、调试与维护内核与系统结构Linux内核是操作系统的核心,负责管理硬件资源,提供系统服务,它是系统软件与硬件之间的桥梁。主要组成部分包括:进程管理:内核通过调度器分配CPU时间给各个进程,实现进程的创建、调度、终止等操作。使用进程描述符(task_struct)来存储进程信息,包括状态(就绪、运行、阻塞等)、优先级、内存映射等。内存管理:包括物理内存和虚拟内存管理。通过页表映</div>
                    </li>
                    <li><a href="/article/1835399577818198016.htm"
                           title="linux脚本sed替换变量,sed 命令中替换值为shell变量" target="_blank">linux脚本sed替换变量,sed 命令中替换值为shell变量</a>
                        <span class="text-muted">诺坎普之约</span>
<a class="tag" taget="_blank" href="/search/linux%E8%84%9A%E6%9C%ACsed%E6%9B%BF%E6%8D%A2%E5%8F%98%E9%87%8F/1.htm">linux脚本sed替换变量</a>
                        <div>文章目录sed命令中替换值为shell变量替换基本语法sed中替换使用shell变量总结参考文档sed命令中替换值为shell变量替换基本语法大家都是sed有很多用法,最多就应该是替换一些值了。让我们先回忆sed的替换语法。在sed进行替换的时候sed-i's/old/new/g'1.txtecho"hellooldfrank"|sed's/old/new/g'结果如下:hellonewfrank</div>
                    </li>
                    <li><a href="/article/1835398694636187648.htm"
                           title="RK3229_Android9.0_Box 4G模块EC200A调试" target="_blank">RK3229_Android9.0_Box 4G模块EC200A调试</a>
                        <span class="text-muted">suifen_</span>
<a class="tag" taget="_blank" href="/search/%E7%BD%91%E7%BB%9C/1.htm">网络</a>
                        <div>0、kernel修改这部分完全可以参考Linux的移植:RK3588EC200A-CN【4G模块】调试_rkec200a-cn-CSDN博客1、修改device/rockchip/rk322xdiff--gita/device.mkb/device.mkindexec6bfaa..e7c32d1100755---a/device.mk+++b/device.mk@@-105,6+105,8@@en</div>
                    </li>
                    <li><a href="/article/1835390878806536192.htm"
                           title="linux 安装Sublime Text 3" target="_blank">linux 安装Sublime Text 3</a>
                        <span class="text-muted">hhyiyuanyu</span>
<a class="tag" taget="_blank" href="/search/Python%E5%AD%A6%E4%B9%A0/1.htm">Python学习</a><a class="tag" taget="_blank" href="/search/linux/1.htm">linux</a><a class="tag" taget="_blank" href="/search/sublime/1.htm">sublime</a><a class="tag" taget="_blank" href="/search/text/1.htm">text</a>
                        <div>方法/步骤打开官网http://www.sublimetext.com/3,选择64位进行下载执行命令wgethttps://download.sublimetext.com/sublime_text_3_build_3126_x64.tar.bz2进行下载3、下载完成进行解压,执行tar-xvvfsublime_text_3_build_3126_x64.tar.bz解压4、解压完成以后,移动到</div>
                    </li>
                    <li><a href="/article/1835387473346260992.htm"
                           title="2020年最新程序员职业发展路线指南,超详细!" target="_blank">2020年最新程序员职业发展路线指南,超详细!</a>
                        <span class="text-muted">编程流川枫</span>
<a class="tag" taget="_blank" href="/search/11/1.htm">11</a><a class="tag" taget="_blank" href="/search/%E7%BC%96%E7%A8%8B%E8%AF%AD%E8%A8%80/1.htm">编程语言</a><a class="tag" taget="_blank" href="/search/%E7%A8%8B%E5%BA%8F%E5%91%98/1.htm">程序员</a><a class="tag" taget="_blank" href="/search/%E4%BA%92%E8%81%94%E7%BD%91/1.htm">互联网</a><a class="tag" taget="_blank" href="/search/IT/1.htm">IT</a><a class="tag" taget="_blank" href="/search/%E8%81%8C%E4%B8%9A/1.htm">职业</a>
                        <div>【文章来源微信公众号:每天学编程】01、程序员的特性技术出身的职场人特性很明显,与做市场、业务出身的职场人区别尤其明显。IT行业中常见的一些职场角色:老板、项目经理、产品经理、需求分析师、设计师、开发工程师、运维工程师等。开发工程师具有如下特征:1、逻辑思维清晰、严谨和细腻;但是有时不容易转弯,有些程序员容易较劲、钻牛角尖。2、性格偏内向、不善于沟通、表达和交际;但是在网络聊天工具上,有些显为幽默</div>
                    </li>
                    <li><a href="/article/1835382307679203328.htm"
                           title="鲲鹏 ARM 架构 麒麟 Lylin v10 安装 Nginx (离线)" target="_blank">鲲鹏 ARM 架构 麒麟 Lylin v10 安装 Nginx (离线)</a>
                        <span class="text-muted">焚木灵</span>
<a class="tag" taget="_blank" href="/search/arm%E5%BC%80%E5%8F%91/1.htm">arm开发</a><a class="tag" taget="_blank" href="/search/%E6%9E%B6%E6%9E%84/1.htm">架构</a><a class="tag" taget="_blank" href="/search/nginx/1.htm">nginx</a><a class="tag" taget="_blank" href="/search/%E6%9C%8D%E5%8A%A1%E5%99%A8/1.htm">服务器</a>
                        <div>最近做一个银行的项目,银行的服务器是鲲鹏ARM架构的服务器,并且是麒麟v10的系统,这里记录一下在无法访问外网安装Nginx的方法。其他文章:鲲鹏ARM架构麒麟Lylinv10安装Mysql8.3(离线)-CSDN博客鲲鹏ARM架构麒麟Lylinv10安装Node和NVM(离线)-CSDN博客鲲鹏ARM架构麒麟Lylinv10安装Pm2(离线)-CSDN博客鲲鹏ARM架构麒麟Lylinv10安装P</div>
                    </li>
                    <li><a href="/article/1835381929642389504.htm"
                           title="shell脚本中sed命令如何使用变量" target="_blank">shell脚本中sed命令如何使用变量</a>
                        <span class="text-muted">歪歪的酒壶</span>
<a class="tag" taget="_blank" href="/search/linux/1.htm">linux</a>
                        <div>在shell脚本中我们常常需要使用sed命令进行配置文件的更新,但是更新的内容又往往根据环境相关。值并不是固定的。这里我们介绍一种在sed命令中使用变量的方法。比如,在nginx的配置中,我们需要根据环境来更新/etc/nginx/sites-available/default中的目录配置。通常我们采用一个变量,来记录当前环境需要配置的目录比如:dist_dir=/home/dev/code/ui</div>
                    </li>
                    <li><a href="/article/1835379662918873088.htm"
                           title="【从问题中去学习k8s】k8s中的常见面试题(夯实理论基础)(二十八)" target="_blank">【从问题中去学习k8s】k8s中的常见面试题(夯实理论基础)(二十八)</a>
                        <span class="text-muted">向往风的男子</span>
<a class="tag" taget="_blank" href="/search/k8s/1.htm">k8s</a><a class="tag" taget="_blank" href="/search/%E5%AD%A6%E4%B9%A0/1.htm">学习</a><a class="tag" taget="_blank" href="/search/kubernetes/1.htm">kubernetes</a><a class="tag" taget="_blank" href="/search/%E5%AE%B9%E5%99%A8/1.htm">容器</a>
                        <div>本站以分享各种运维经验和运维所需要的技能为主《python零基础入门》:python零基础入门学习《python运维脚本》:python运维脚本实践《shell》:shell学习《terraform》持续更新中:terraform_Aws学习零基础入门到最佳实战《k8》从问题中去学习k8s《docker学习》暂未更新《ceph学习》ceph日常问题解决分享《日志收集》ELK+各种中间件《运维日常》</div>
                    </li>
                                <li><a href="/article/92.htm"
                                       title="log4j对象改变日志级别" target="_blank">log4j对象改变日志级别</a>
                                    <span class="text-muted">3213213333332132</span>
<a class="tag" taget="_blank" href="/search/java/1.htm">java</a><a class="tag" taget="_blank" href="/search/log4j/1.htm">log4j</a><a class="tag" taget="_blank" href="/search/level/1.htm">level</a><a class="tag" taget="_blank" href="/search/log4j%E5%AF%B9%E8%B1%A1%E5%90%8D%E7%A7%B0/1.htm">log4j对象名称</a><a class="tag" taget="_blank" href="/search/%E6%97%A5%E5%BF%97%E7%BA%A7%E5%88%AB/1.htm">日志级别</a>
                                    <div>log4j对象改变日志级别可批量的改变所有级别,或是根据条件改变日志级别。 
 
log4j配置文件: 
 
 

log4j.rootLogger=ERROR,FILE,CONSOLE,EXECPTION
 
#log4j.appender.FILE=org.apache.log4j.RollingFileAppender
log4j.appender.FILE=org.apache.l</div>
                                </li>
                                <li><a href="/article/219.htm"
                                       title="elk+redis 搭建nginx日志分析平台" target="_blank">elk+redis 搭建nginx日志分析平台</a>
                                    <span class="text-muted">ronin47</span>
<a class="tag" taget="_blank" href="/search/elasticsearch/1.htm">elasticsearch</a><a class="tag" taget="_blank" href="/search/kibana/1.htm">kibana</a><a class="tag" taget="_blank" href="/search/logstash/1.htm">logstash</a>
                                    <div>              elk+redis 搭建nginx日志分析平台 
logstash,elasticsearch,kibana 怎么进行nginx的日志分析呢?首先,架构方面,nginx是有日志文件的,它的每个请求的状态等都有日志文件进行记录。其次,需要有个队 列,redis的l</div>
                                </li>
                                <li><a href="/article/346.htm"
                                       title="Yii2设置时区" target="_blank">Yii2设置时区</a>
                                    <span class="text-muted">dcj3sjt126com</span>
<a class="tag" taget="_blank" href="/search/PHP/1.htm">PHP</a><a class="tag" taget="_blank" href="/search/timezone/1.htm">timezone</a><a class="tag" taget="_blank" href="/search/yii2/1.htm">yii2</a>
                                    <div>时区这东西,在开发的时候,你说重要吧,也还好,毕竟没它也能正常运行,你说不重要吧,那就纠结了。特别是linux系统,都TMD差上几小时,你能不痛苦吗?win还好一点。有一些常规方法,是大家目前都在采用的1、php.ini中的设置,这个就不谈了,2、程序中公用文件里设置,date_default_timezone_set一下时区3、或者。。。自己写时间处理函数,在遇到时间的时候,用这个函数处理(比较</div>
                                </li>
                                <li><a href="/article/473.htm"
                                       title="js实现前台动态添加文本框,后台获取文本框内容" target="_blank">js实现前台动态添加文本框,后台获取文本框内容</a>
                                    <span class="text-muted">171815164</span>
<a class="tag" taget="_blank" href="/search/%E6%96%87%E6%9C%AC%E6%A1%86/1.htm">文本框</a>
                                    <div>

<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://w</div>
                                </li>
                                <li><a href="/article/600.htm"
                                       title="持续集成工具" target="_blank">持续集成工具</a>
                                    <span class="text-muted">g21121</span>
<a class="tag" taget="_blank" href="/search/%E6%8C%81%E7%BB%AD%E9%9B%86%E6%88%90/1.htm">持续集成</a>
                                    <div>        持续集成是什么?我们为什么需要持续集成?持续集成带来的好处是什么?什么样的项目需要持续集成?...        持续集成(Continuous integration ,简称CI),所谓集成可以理解为将互相依赖的工程或模块合并成一个能单独运行</div>
                                </li>
                                <li><a href="/article/727.htm"
                                       title="数据结构哈希表(hash)总结" target="_blank">数据结构哈希表(hash)总结</a>
                                    <span class="text-muted">永夜-极光</span>
<a class="tag" taget="_blank" href="/search/%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/1.htm">数据结构</a>
                                    <div>1.什么是hash 
来源于百度百科: 
Hash,一般翻译做“散列”,也有直接音译为“哈希”的,就是把任意长度的输入,通过散列算法,变换成固定长度的输出,该输出就是散列值。这种转换是一种压缩映射,也就是,散列值的空间通常远小于输入的空间,不同的输入可能会散列成相同的输出,所以不可能从散列值来唯一的确定输入值。简单的说就是一种将任意长度的消息压缩到某一固定长度的消息摘要的函数。 
  
</div>
                                </li>
                                <li><a href="/article/854.htm"
                                       title="乱七八糟" target="_blank">乱七八糟</a>
                                    <span class="text-muted">程序员是怎么炼成的</span>

                                    <div>eclipse中的jvm字节码查看插件地址: 
http://andrei.gmxhome.de/eclipse/ 
安装该地址的outline 插件  后重启,打开window下的view下的bytecode视图 
http://andrei.gmxhome.de/eclipse/ 
  
jvm博客: 
http://yunshen0909.iteye.com/blog/2</div>
                                </li>
                                <li><a href="/article/981.htm"
                                       title="职场人伤害了“上司” 怎样弥补" target="_blank">职场人伤害了“上司” 怎样弥补</a>
                                    <span class="text-muted">aijuans</span>
<a class="tag" taget="_blank" href="/search/%E8%81%8C%E5%9C%BA/1.htm">职场</a>
                                    <div> 由于工作中的失误,或者平时不注意自己的言行“伤害”、“得罪”了自己的上司,怎么办呢? 
  在职业生涯中这种问题尽量不要发生。下面提供了一些解决问题的建议: 
  一、利用一些轻松的场合表示对他的尊重 
  即使是开明的上司也很注重自己的权威,都希望得到下属的尊重,所以当你与上司冲突后,最好让不愉快成为过去,你不妨在一些轻松的场合,比如会餐、联谊活动等,向上司问个好,敬下酒,表示你对对方的尊重,</div>
                                </li>
                                <li><a href="/article/1108.htm"
                                       title="深入浅出url编码" target="_blank">深入浅出url编码</a>
                                    <span class="text-muted">antonyup_2006</span>
<a class="tag" taget="_blank" href="/search/%E5%BA%94%E7%94%A8%E6%9C%8D%E5%8A%A1%E5%99%A8/1.htm">应用服务器</a><a class="tag" taget="_blank" href="/search/%E6%B5%8F%E8%A7%88%E5%99%A8/1.htm">浏览器</a><a class="tag" taget="_blank" href="/search/servlet/1.htm">servlet</a><a class="tag" taget="_blank" href="/search/weblogic/1.htm">weblogic</a><a class="tag" taget="_blank" href="/search/IE/1.htm">IE</a>
                                    <div>出处:http://blog.csdn.net/yzhz  杨争   
http://blog.csdn.net/yzhz/archive/2007/07/03/1676796.aspx 
 
一、问题: 
        编码问题是JAVA初学者在web开发过程中经常会遇到问题,网上也有大量相关的</div>
                                </li>
                                <li><a href="/article/1235.htm"
                                       title="建表后创建表的约束关系和增加表的字段" target="_blank">建表后创建表的约束关系和增加表的字段</a>
                                    <span class="text-muted">百合不是茶</span>
<a class="tag" taget="_blank" href="/search/%E6%A0%87%E7%9A%84%E7%BA%A6%E6%9D%9F%E5%85%B3%E7%B3%BB/1.htm">标的约束关系</a><a class="tag" taget="_blank" href="/search/%E5%A2%9E%E5%8A%A0%E8%A1%A8%E7%9A%84%E5%AD%97%E6%AE%B5/1.htm">增加表的字段</a>
                                    <div>  
下面所有的操作都是在表建立后操作的,主要目的就是熟悉sql的约束,约束语句的万能公式 
  
1,增加字段(student表中增加 姓名字段) 
  
alter table 增加字段的表名 add  增加的字段名   增加字段的数据类型

  alter table student add name varchar2(10);
 
  
&nb</div>
                                </li>
                                <li><a href="/article/1362.htm"
                                       title="Uploadify 3.2 参数属性、事件、方法函数详解" target="_blank">Uploadify 3.2 参数属性、事件、方法函数详解</a>
                                    <span class="text-muted">bijian1013</span>
<a class="tag" taget="_blank" href="/search/JavaScript/1.htm">JavaScript</a><a class="tag" taget="_blank" href="/search/uploadify/1.htm">uploadify</a>
                                    <div>一.属性     
属性名称   
默认值   
说明     
auto   
true   
设置为true当选择文件后就直接上传了,为false需要点击上传按钮才上传。     
buttonClass   
”   
按钮样式     
buttonCursor   
‘hand’   
鼠标指针悬停在按钮上的样子     
buttonImage   
null   
浏览按钮的图片的路</div>
                                </li>
                                <li><a href="/article/1489.htm"
                                       title="精通Oracle10编程SQL(16)使用LOB对象" target="_blank">精通Oracle10编程SQL(16)使用LOB对象</a>
                                    <span class="text-muted">bijian1013</span>
<a class="tag" taget="_blank" href="/search/oracle/1.htm">oracle</a><a class="tag" taget="_blank" href="/search/%E6%95%B0%E6%8D%AE%E5%BA%93/1.htm">数据库</a><a class="tag" taget="_blank" href="/search/plsql/1.htm">plsql</a>
                                    <div>/*
 *使用LOB对象
 */
--LOB(Large Object)是专门用于处理大对象的一种数据类型,其所存放的数据长度可以达到4G字节
--CLOB/NCLOB用于存储大批量字符数据,BLOB用于存储大批量二进制数据,而BFILE则存储着指向OS文件的指针

/*
 *综合实例
 */
--建立表空间 
--#指定区尺寸为128k,如不指定,区尺寸默认为64k 
CR</div>
                                </li>
                                <li><a href="/article/1616.htm"
                                       title="【Resin一】Resin服务器部署web应用" target="_blank">【Resin一】Resin服务器部署web应用</a>
                                    <span class="text-muted">bit1129</span>
<a class="tag" taget="_blank" href="/search/resin/1.htm">resin</a>
                                    <div>工作中,在Resin服务器上部署web应用,通常有如下三种方式: 
  
 
 配置多个web-app 
 配置多个http id 
 为每个应用配置一个propeties、xml以及sh脚本文件 
 配置多个web-app 
  
 
 在resin.xml中,可以为一个host配置多个web-app 
 
  
<cluster id="app&q</div>
                                </li>
                                <li><a href="/article/1743.htm"
                                       title="red5简介及基础知识" target="_blank">red5简介及基础知识</a>
                                    <span class="text-muted">白糖_</span>
<a class="tag" taget="_blank" href="/search/%E5%9F%BA%E7%A1%80/1.htm">基础</a>
                                    <div>  
 
 简介 
 
  
Red5的主要功能和Macromedia公司的FMS类似,提供基于Flash的流媒体服务的一款基于Java的开源流媒体服务器。它由Java语言编写,使用RTMP作为流媒体传输协议,这与FMS完全兼容。它具有流化FLV、MP3文件,实时录制客户端流为FLV文件,共享对象,实时视频播放、Remoting等功能。用Red5替换FMS后,客户端不用更改可正</div>
                                </li>
                                <li><a href="/article/1870.htm"
                                       title="angular.fromJson" target="_blank">angular.fromJson</a>
                                    <span class="text-muted">boyitech</span>
<a class="tag" taget="_blank" href="/search/AngularJS/1.htm">AngularJS</a><a class="tag" taget="_blank" href="/search/AngularJS+%E5%AE%98%E6%96%B9API/1.htm">AngularJS 官方API</a><a class="tag" taget="_blank" href="/search/AngularJS+API/1.htm">AngularJS API</a>
                                    <div>angular.fromJson   描述:   把Json字符串转为对象    使用方法:   angular.fromJson(json);   参数详解:      Param Type Details   json 
string  
JSON 字符串      返回值:   对象, 数组, 字符串 或者是一个数字   示例:   
<!DOCTYPE HTML>
<h</div>
                                </li>
                                <li><a href="/article/1997.htm"
                                       title="java-颠倒一个句子中的词的顺序。比如: I am a student颠倒后变成:student a am I" target="_blank">java-颠倒一个句子中的词的顺序。比如: I am a student颠倒后变成:student a am I</a>
                                    <span class="text-muted">bylijinnan</span>
<a class="tag" taget="_blank" href="/search/java/1.htm">java</a>
                                    <div>

public class ReverseWords {

	/**
	 * 题目:颠倒一个句子中的词的顺序。比如: I am a student颠倒后变成:student a am I.词以空格分隔。
	 * 要求:
	 * 1.实现速度最快,移动最少
	 * 2.不能使用String的方法如split,indexOf等等。
	 * 解答:两次翻转。
	 */
	publ</div>
                                </li>
                                <li><a href="/article/2124.htm"
                                       title="web实时通讯" target="_blank">web实时通讯</a>
                                    <span class="text-muted">Chen.H</span>
<a class="tag" taget="_blank" href="/search/Web/1.htm">Web</a><a class="tag" taget="_blank" href="/search/%E6%B5%8F%E8%A7%88%E5%99%A8/1.htm">浏览器</a><a class="tag" taget="_blank" href="/search/socket/1.htm">socket</a><a class="tag" taget="_blank" href="/search/%E8%84%9A%E6%9C%AC/1.htm">脚本</a>
                                    <div>关于web实时通讯,做一些监控软件。 
由web服务器组件从消息服务器订阅实时数据,并建立消息服务器到所述web服务器之间的连接,web浏览器利用从所述web服务器下载到web页面的客户端代理与web服务器组件之间的socket连接,建立web浏览器与web服务器之间的持久连接;利用所述客户端代理与web浏览器页面之间的信息交互实现页面本地更新,建立一条从消息服务器到web浏览器页面之间的消息通路</div>
                                </li>
                                <li><a href="/article/2251.htm"
                                       title="[基因与生物]远古生物的基因可以嫁接到现代生物基因组中吗?" target="_blank">[基因与生物]远古生物的基因可以嫁接到现代生物基因组中吗?</a>
                                    <span class="text-muted">comsci</span>
<a class="tag" taget="_blank" href="/search/%E7%94%9F%E7%89%A9/1.htm">生物</a>
                                    <div> 
 
      大家仅仅把我说的事情当作一个IT行业的笑话来听吧..没有其它更多的意思 
 
 
    如果我们把大自然看成是一位伟大的程序员,专门为地球上的生态系统编制基因代码,并创造出各种不同的生物来,那么6500万年前的程序员开发的代码,是否兼容现代派的程序员的代码和架构呢? 
 
  </div>
                                </li>
                                <li><a href="/article/2378.htm"
                                       title="oracle 外部表" target="_blank">oracle 外部表</a>
                                    <span class="text-muted">daizj</span>
<a class="tag" taget="_blank" href="/search/oracle/1.htm">oracle</a><a class="tag" taget="_blank" href="/search/%E5%A4%96%E9%83%A8%E8%A1%A8/1.htm">外部表</a><a class="tag" taget="_blank" href="/search/external+tables/1.htm">external tables</a>
                                    <div>    oracle外部表是只允许只读访问,不能进行DML操作,不能创建索引,可以对外部表进行的查询,连接,排序,创建视图和创建同义词操作。 
you can select, join, or sort external table data. You can also create views and synonyms for external tables. Ho</div>
                                </li>
                                <li><a href="/article/2505.htm"
                                       title="aop相关的概念及配置" target="_blank">aop相关的概念及配置</a>
                                    <span class="text-muted">daysinsun</span>
<a class="tag" taget="_blank" href="/search/AOP/1.htm">AOP</a>
                                    <div>切面(Aspect): 
通常在目标方法执行前后需要执行的方法(如事务、日志、权限),这些方法我们封装到一个类里面,这个类就叫切面。 
 
 
连接点(joinpoint) 
spring里面的连接点指需要切入的方法,通常这个joinpoint可以作为一个参数传入到切面的方法里面(非常有用的一个东西)。 
 
 
通知(Advice) 
通知就是切面里面方法的具体实现,分为前置、后置、最终、异常环</div>
                                </li>
                                <li><a href="/article/2632.htm"
                                       title="初一上学期难记忆单词背诵第二课" target="_blank">初一上学期难记忆单词背诵第二课</a>
                                    <span class="text-muted">dcj3sjt126com</span>
<a class="tag" taget="_blank" href="/search/english/1.htm">english</a><a class="tag" taget="_blank" href="/search/word/1.htm">word</a>
                                    <div>middle 中间的,中级的 
well 喔,那么;好吧 
phone 电话,电话机 
policeman 警察 
ask 问 
take 拿到;带到 
address 地址 
glad 高兴的,乐意的 
why 为什么  
China 中国 
family 家庭 
grandmother (外)祖母 
grandfather (外)祖父 
wife 妻子 
husband 丈夫 
da</div>
                                </li>
                                <li><a href="/article/2759.htm"
                                       title="Linux日志分析常用命令" target="_blank">Linux日志分析常用命令</a>
                                    <span class="text-muted">dcj3sjt126com</span>
<a class="tag" taget="_blank" href="/search/linux/1.htm">linux</a><a class="tag" taget="_blank" href="/search/log/1.htm">log</a>
                                    <div>1.查看文件内容 
cat 
-n 显示行号 2.分页显示 
more 
Enter 显示下一行 
空格 显示下一页 
F 显示下一屏 
B 显示上一屏 
less 
/get 查询"get"字符串并高亮显示 3.显示文件尾 
tail 
-f 不退出持续显示 
-n 显示文件最后n行 4.显示头文件 
head 
-n 显示文件开始n行 5.内容排序 
sort 
-n 按照</div>
                                </li>
                                <li><a href="/article/2886.htm"
                                       title="JSONP 原理分析" target="_blank">JSONP 原理分析</a>
                                    <span class="text-muted">fantasy2005</span>
<a class="tag" taget="_blank" href="/search/JavaScript/1.htm">JavaScript</a><a class="tag" taget="_blank" href="/search/jsonp/1.htm">jsonp</a><a class="tag" taget="_blank" href="/search/jsonp+%E8%B7%A8%E5%9F%9F/1.htm">jsonp 跨域</a>
                                    <div>转自 http://www.nowamagic.net/librarys/veda/detail/224 
JavaScript是一种在Web开发中经常使用的前端动态脚本技术。在JavaScript中,有一个很重要的安全性限制,被称为“Same-Origin Policy”(同源策略)。这一策略对于JavaScript代码能够访问的页面内容做了很重要的限制,即JavaScript只能访问与包含它的</div>
                                </li>
                                <li><a href="/article/3013.htm"
                                       title="使用connect by进行级联查询" target="_blank">使用connect by进行级联查询</a>
                                    <span class="text-muted">234390216</span>
<a class="tag" taget="_blank" href="/search/oracle/1.htm">oracle</a><a class="tag" taget="_blank" href="/search/%E6%9F%A5%E8%AF%A2/1.htm">查询</a><a class="tag" taget="_blank" href="/search/%E7%88%B6%E5%AD%90/1.htm">父子</a><a class="tag" taget="_blank" href="/search/Connect+by/1.htm">Connect by</a><a class="tag" taget="_blank" href="/search/%E7%BA%A7%E8%81%94/1.htm">级联</a>
                                    <div>使用connect by进行级联查询 
  
       connect by可以用于级联查询,常用于对具有树状结构的记录查询某一节点的所有子孙节点或所有祖辈节点。 
  
       来看一个示例,现假设我们拥有一个菜单表t_menu,其中只有三个字段:</div>
                                </li>
                                <li><a href="/article/3140.htm"
                                       title="一个不错的能将HTML表格导出为excel,pdf等的jquery插件" target="_blank">一个不错的能将HTML表格导出为excel,pdf等的jquery插件</a>
                                    <span class="text-muted">jackyrong</span>
<a class="tag" taget="_blank" href="/search/jquery%E6%8F%92%E4%BB%B6/1.htm">jquery插件</a>
                                    <div>发现一个老外写的不错的jquery插件,可以实现将HTML 
表格导出为excel,pdf等格式, 
地址在: 
https://github.com/kayalshri/ 
 
下面看个例子,实现导出表格到excel,pdf 
 
 


<html>
			<head>
				<title>Export html table to excel an</div>
                                </li>
                                <li><a href="/article/3267.htm"
                                       title="UI设计中我们为什么需要设计动效" target="_blank">UI设计中我们为什么需要设计动效</a>
                                    <span class="text-muted">lampcy</span>
<a class="tag" taget="_blank" href="/search/UI/1.htm">UI</a><a class="tag" taget="_blank" href="/search/UI%E8%AE%BE%E8%AE%A1/1.htm">UI设计</a>
                                    <div>关于Unity3D中的Shader的知识 
首先先解释下Unity3D的Shader,Unity里面的Shaders是使用一种叫ShaderLab的语言编写的,它同微软的FX文件或者NVIDIA的CgFX有些类似。传统意义上的vertex shader和pixel shader还是使用标准的Cg/HLSL 编程语言编写的。因此Unity文档里面的Shader,都是指用ShaderLab编写的代码,</div>
                                </li>
                                <li><a href="/article/3394.htm"
                                       title="如何禁止页面缓存" target="_blank">如何禁止页面缓存</a>
                                    <span class="text-muted">nannan408</span>
<a class="tag" taget="_blank" href="/search/html/1.htm">html</a><a class="tag" taget="_blank" href="/search/jsp/1.htm">jsp</a><a class="tag" taget="_blank" href="/search/cache/1.htm">cache</a>
                                    <div>禁止页面使用缓存~ 
------------------------------------------------ 
jsp:页面no cache: 
 
response.setHeader("Pragma","No-cache"); 
response.setHeader("Cache-Control","no-cach</div>
                                </li>
                                <li><a href="/article/3521.htm"
                                       title="以代码的方式管理quartz定时任务的暂停、重启、删除、添加等" target="_blank">以代码的方式管理quartz定时任务的暂停、重启、删除、添加等</a>
                                    <span class="text-muted">Everyday都不同</span>
<a class="tag" taget="_blank" href="/search/%E5%AE%9A%E6%97%B6%E4%BB%BB%E5%8A%A1%E7%AE%A1%E7%90%86/1.htm">定时任务管理</a><a class="tag" taget="_blank" href="/search/spring-quartz/1.htm">spring-quartz</a>
                                    <div>      【前言】在项目的管理功能中,对定时任务的管理有时会很常见。因为我们不能指望只在配置文件中配置好定时任务就行了,因为如果要控制定时任务的 “暂停” 呢?暂停之后又要在某个时间点 “重启” 该定时任务呢?或者说直接 “删除” 该定时任务呢?要改变某定时任务的触发时间呢? “添加” 一个定时任务对于系统的使用者而言,是不太现实的,因为一个定时任务的处理逻辑他是不</div>
                                </li>
                                <li><a href="/article/3648.htm"
                                       title="EXT实例" target="_blank">EXT实例</a>
                                    <span class="text-muted">tntxia</span>
<a class="tag" taget="_blank" href="/search/ext/1.htm">ext</a>
                                    <div>  
(1) 增加一个按钮 
  
JSP: 
  
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
Stri</div>
                                </li>
                                <li><a href="/article/3775.htm"
                                       title="数学学习在计算机研究领域的作用和重要性" target="_blank">数学学习在计算机研究领域的作用和重要性</a>
                                    <span class="text-muted">xjnine</span>
<a class="tag" taget="_blank" href="/search/Math/1.htm">Math</a>
                                    <div>最近一直有师弟师妹和朋友问我数学和研究的关系,研一要去学什么数学课。毕竟在清华,衡量一个研究生最重要的指标之一就是paper,而没有数学,是肯定上不了世界顶级的期刊和会议的,这在计算机学界尤其重要!你会发现,不论哪个领域有价值的东西,都一定离不开数学!在这样一个信息时代,当google已经让世界没有秘密的时候,一种卓越的数学思维,绝对可以成为你的核心竞争力.  无奈本人实在见地</div>
                                </li>
                </ul>
            </div>
        </div>
    </div>

<div>
    <div class="container">
        <div class="indexes">
            <strong>按字母分类:</strong>
            <a href="/tags/A/1.htm" target="_blank">A</a><a href="/tags/B/1.htm" target="_blank">B</a><a href="/tags/C/1.htm" target="_blank">C</a><a
                href="/tags/D/1.htm" target="_blank">D</a><a href="/tags/E/1.htm" target="_blank">E</a><a href="/tags/F/1.htm" target="_blank">F</a><a
                href="/tags/G/1.htm" target="_blank">G</a><a href="/tags/H/1.htm" target="_blank">H</a><a href="/tags/I/1.htm" target="_blank">I</a><a
                href="/tags/J/1.htm" target="_blank">J</a><a href="/tags/K/1.htm" target="_blank">K</a><a href="/tags/L/1.htm" target="_blank">L</a><a
                href="/tags/M/1.htm" target="_blank">M</a><a href="/tags/N/1.htm" target="_blank">N</a><a href="/tags/O/1.htm" target="_blank">O</a><a
                href="/tags/P/1.htm" target="_blank">P</a><a href="/tags/Q/1.htm" target="_blank">Q</a><a href="/tags/R/1.htm" target="_blank">R</a><a
                href="/tags/S/1.htm" target="_blank">S</a><a href="/tags/T/1.htm" target="_blank">T</a><a href="/tags/U/1.htm" target="_blank">U</a><a
                href="/tags/V/1.htm" target="_blank">V</a><a href="/tags/W/1.htm" target="_blank">W</a><a href="/tags/X/1.htm" target="_blank">X</a><a
                href="/tags/Y/1.htm" target="_blank">Y</a><a href="/tags/Z/1.htm" target="_blank">Z</a><a href="/tags/0/1.htm" target="_blank">其他</a>
        </div>
    </div>
</div>
<footer id="footer" class="mb30 mt30">
    <div class="container">
        <div class="footBglm">
            <a target="_blank" href="/">首页</a> -
            <a target="_blank" href="/custom/about.htm">关于我们</a> -
            <a target="_blank" href="/search/Java/1.htm">站内搜索</a> -
            <a target="_blank" href="/sitemap.txt">Sitemap</a> -
            <a target="_blank" href="/custom/delete.htm">侵权投诉</a>
        </div>
        <div class="copyright">版权所有 IT知识库 CopyRight © 2000-2050 E-COM-NET.COM , All Rights Reserved.
<!--            <a href="https://beian.miit.gov.cn/" rel="nofollow" target="_blank">京ICP备09083238号</a><br>-->
        </div>
    </div>
</footer>
<!-- 代码高亮 -->
<script type="text/javascript" src="/static/syntaxhighlighter/scripts/shCore.js"></script>
<script type="text/javascript" src="/static/syntaxhighlighter/scripts/shLegacy.js"></script>
<script type="text/javascript" src="/static/syntaxhighlighter/scripts/shAutoloader.js"></script>
<link type="text/css" rel="stylesheet" href="/static/syntaxhighlighter/styles/shCoreDefault.css"/>
<script type="text/javascript" src="/static/syntaxhighlighter/src/my_start_1.js"></script>





</body>

</html>