You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

68 lines
7.9 KiB

<?xml version="1.0" encoding="utf-8"?>
<search>
<entry>
<title>hello hexo</title>
<url>/tech/hello-hexo/</url>
<content><![CDATA[<h2 id="神奇的事情"><a href="#神奇的事情" class="headerlink" title="神奇的事情"></a>神奇的事情</h2><p>神奇的事情开始发售了</p>
<p><img src="https://api.yimian.xyz/img" alt=""></p>
<figure class="highlight js"><table><tr><td class="code"><pre><code class="hljs js"><span class="hljs-keyword">const</span> home = cooo;<br><br><span class="hljs-keyword">var</span> ee = <span class="hljs-number">1</span>;<br></code></pre></td></tr></table></figure>
]]></content>
</entry>
<entry>
<title>Build Nextcloud Server on Centos 7.5</title>
<url>/tech/build-nextcloud-server-on-centos7/</url>
<content><![CDATA[<p>Nextcloud is an open-source software project coded with PHP. It had provided a ideal private cloud-storage solution which was considered to be reliable and stable. This blog aims to present a Nextcloud Building instruction step by step for the purpose of helping freshman and future reviewing. Nextcloud is an open-source software project coded with PHP. It had provided a ideal private cloud-storage solution which was considered to be reliable and stable. This blog aims to present a Nextcloud Building instruction step by step for the purpose of helping freshman and future reviewing. Nextcloud is an open-source software project coded with PHP. It had provided a ideal private cloud-storage solution which was considered to be reliable and stable. This blog aims to present a Nextcloud Building instruction step by step for the purpose of helping freshman and future reviewing.</p>
<a id="more"></a>
<h2 id="Change-linux-core-to-BBR-vision"><a href="#Change-linux-core-to-BBR-vision" class="headerlink" title="Change linux core to BBR vision"></a>Change linux core to BBR vision</h2><p>If your server is a new one, it is strongly recommended to update it to an upper version supporting bbr mode, which is a senior centos system core provide by google and it could make your server more efficient.</p>
<p>Firstly download and install bbr core from github.</p>
<figure class="highlight bash"><table><tr><td class="code"><pre><code class="hljs bash">$ wget -N --no-check-certificate https://github.com/teddysun/across/raw/master/bbr.sh &amp;&amp;\<br>$ chmod +x bbr.sh &amp;&amp; \<br>$ bash bbr.sh<br></code></pre></td></tr></table></figure>
<p>Use the code to check the core version. If it’s large than 4.9.0 it’s OK.</p>
<figure class="highlight bash"><table><tr><td class="code"><pre><code class="hljs bash">$ uname -r<br></code></pre></td></tr></table></figure>
<p>Expected return:net.ipv4.tcp_available_congestion_control = bbr cubic reno</p>
<figure class="highlight bash"><table><tr><td class="code"><pre><code class="hljs bash">$ sysctl net.ipv4.tcp_available_congestion_control<br></code></pre></td></tr></table></figure>
<p>Expected return: net.ipv4.tcp_congestion_control = bbr</p>
<figure class="highlight bash"><table><tr><td class="code"><pre><code class="hljs bash">$ sysctl net.ipv4.tcp_congestion_control<br></code></pre></td></tr></table></figure>
<p>Expected return: net.core.default_qdisc = fq</p>
<figure class="highlight bash"><table><tr><td class="code"><pre><code class="hljs bash">$ sysctl net.core.default_qdisc<br></code></pre></td></tr></table></figure>
<p>Expected return: xxxxxxxx tcp_bbr</p>
<figure class="highlight bash"><table><tr><td class="code"><pre><code class="hljs bash">$ lsmod | grep bbr<br></code></pre></td></tr></table></figure>
<h2 id="Install-Nginx-Service"><a href="#Install-Nginx-Service" class="headerlink" title="Install Nginx Service"></a>Install Nginx Service</h2><p>Pull nginx package from nginx orginzation website.</p>
<figure class="highlight bash"><table><tr><td class="code"><pre><code class="hljs bash">rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm<br></code></pre></td></tr></table></figure>
<p>Install Nginx.</p>
<figure class="highlight bash"><table><tr><td class="code"><pre><code class="hljs bash">$ yum install -y nginx<br></code></pre></td></tr></table></figure>
<p>Start nginx service.</p>
<figure class="highlight bash"><table><tr><td class="code"><pre><code class="hljs bash">$ systemctl start nginx.service<br>$ systemctl <span class="hljs-built_in">enable</span> nginx.service<br></code></pre></td></tr></table></figure>
<p>Set preference file of nginx. Click here to get recommended nginx.conf file.</p>
<figure class="highlight bash"><table><tr><td class="code"><pre><code class="hljs bash">$ <span class="hljs-built_in">cd</span> /etc/nginx<br>$ vi nginx.conf<br></code></pre></td></tr></table></figure>
<p>Apply ssl certification. Rename it with your_domain.crt(key) and download it to your server: /etc/nginx/ssl/</p>
<figure class="highlight bash"><table><tr><td class="code"><pre><code class="hljs bash">$ //Use scp -r (my ssl file route on my windows)/your_domain.crt \root@(your server ip): /etc/nginx/ssl<br>$ //Use scp -r (my ssl file route on my windows)/your_domain.crt root@(your server ip): /etc/nginx/ssl<br>$ //On WINDOWS BASH<br></code></pre></td></tr></table></figure>
<p>Check and restart nginx service.</p>
<figure class="highlight bash"><table><tr><td class="code"><pre><code class="hljs bash">$ nginx -t<br><br>$ //If the <span class="hljs-built_in">return</span> is successful it is ok, othervise there exists error <span class="hljs-keyword">in</span> your nginx.conf file. <br>$ systemctl restart nginx<br></code></pre></td></tr></table></figure>
<h2 id="Install-docker"><a href="#Install-docker" class="headerlink" title="Install docker"></a>Install docker</h2><p>Pull and install docker service from official website.</p>
<figure class="highlight bash"><table><tr><td class="code"><pre><code class="hljs bash">$ curl -sSL https://get.docker.com/ | sh<br></code></pre></td></tr></table></figure>
<p>Start docker service.</p>
<figure class="highlight bash"><table><tr><td class="code"><pre><code class="hljs bash">$ systemctl start docker<br>$ systemctl <span class="hljs-built_in">enable</span> docker.service<br></code></pre></td></tr></table></figure>
<p>Pull nextcloud and mariadb(simplified mysql database on centos ) images from github.</p>
<figure class="highlight bash"><table><tr><td class="code"><pre><code class="hljs bash">$ docker pull rootlogin/nextcloud &amp;&amp; docker pull mariadb:10<br></code></pre></td></tr></table></figure>
<p>Start image mariadb with docker.</p>
<figure class="highlight bash"><table><tr><td class="code"><pre><code class="hljs bash">$ docker run -d --name nextcloud_db -v /data/mysql:/var/lib/mysql -e \<br>$ MYSQL_ROOT_PASSWORD=YOUR_PASSWD -e MYSQL_DATABASE=nextcloud \<br>$ -e MYSQL_USER=nextcloud -e MYSQL_PASSWORD=YOURPASSWD mariadb:10<br></code></pre></td></tr></table></figure>
<p>Start image nextcloud with docker.</p>
<figure class="highlight bash"><table><tr><td class="code"><pre><code class="hljs bash">$ docker run -d --name nextcloud --link nextcloud_db:nextcloud_db -p 127.0.0.1:9001:80 -v /data/nextcloud:/data rootlogin/nextcloud<br></code></pre></td></tr></table></figure>
<p>That is the last step on server. Now let’s start <a href="http://YOUR_DOMAIN/" target="_blank" rel="noopener">http://YOUR_DOMAIN/</a> with your explorer.</p>
<p>Recommend to substitute the “localhost” to “nextcloud_db”.</p>
<hr>
<p>Reference List:<br><a href="https://www.moerats.com/archives/420/" target="_blank" rel="noopener">https://www.moerats.com/archives/420/</a><br><a href="https://my.oschina.net/yule526751/blog/799004" target="_blank" rel="noopener">https://my.oschina.net/yule526751/blog/799004</a><br><a href="https://www.moerats.com/archives/420/" target="_blank" rel="noopener">https://www.moerats.com/archives/420/</a></p>
]]></content>
<categories>
<category>tech</category>
</categories>
<tags>
<tag>docker</tag>
<tag>php</tag>
<tag>nginx</tag>
</tags>
</entry>
</search>