東川印記

一本東川,笑看爭龍斗虎;寰茫兦者,度橫佰昧人生。

2021年2月又开始折腾盒子01,从ubuntu18.04安装Nginx服务开始

2021年2月23日星期二



1,ubuntu18.04安装Nginx

SENRSL:Downloads senrsl$ ssh ubuntu@192.168.2.186
ubuntu@192.168.2.186's password:
Welcome to Ubuntu 18.04.4 LTS (GNU/Linux 4.15.0-122-generic x86_64)
。。。
  System information as of Mon Feb 22 19:52:25 CST 2021

  System load:  3.34                Processes:              162
  Usage of /:   14.3% of 116.38GB   Users logged in:        0
  Memory usage: 14%                 IP address for enp3s0:  192.168.2.186
  Swap usage:   0%                  IP address for docker0: 172.17.0.1
。。。
*** System restart required ***
Last login: Mon Feb 22 19:49:33 2021 from 192.168.6.99
ubuntu@dcp-terminal:~$ sudo su
[sudo] password for ubuntu:
root@dcp-terminal:/home/ubuntu# apt-get update
。。。         
Reading package lists... Done                     
root@dcp-terminal:/home/ubuntu# apt-get install nginx
Reading package lists... Done
Building dependency tree      
Reading state information... Done
The following packages were automatically installed and are no longer required:
。。。
0 upgraded, 11 newly installed, 0 to remove and 97 not upgraded.
Need to get 936 kB of archives.
After this operation, 3,110 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
。。。

root@dcp-terminal:/home/ubuntu# vi /etc/nginx/nginx.conf  编辑配置文件

root@dcp-terminal:/home/ubuntu# ufw status   检查防火墙状态
Status: inactive
root@dcp-terminal:/home/ubuntu# systemctl status nginx
● nginx.service - A high performance web server and a reverse proxy server
   Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
   Active: inactive (dead)
     Docs: man:nginx(8)
root@dcp-terminal:/home/ubuntu# service nginx restart
root@dcp-terminal:/home/ubuntu# systemctl status nginx
● nginx.service - A high performance web server and a reverse proxy server
   Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
   Active: active (running) since Mon 2021-02-22 19:58:47 CST; 2s ago
     Docs: man:nginx(8)
  Process: 10824 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
  Process: 10813 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
 Main PID: 10826 (nginx)
    Tasks: 5 (limit: 4915)
   CGroup: /system.slice/nginx.service
           ├─10826 nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
           ├─10831 nginx: worker process
           ├─10832 nginx: worker process
           ├─10834 nginx: worker process
           └─10836 nginx: worker process

。。。
root@dcp-terminal:/home/ubuntu#

直接访问 192.168.2.186,网站就通了。。。。

Welcome to nginx!

If you see this page, the nginx web server is successfully installed and working. Further configuration is required.


2,nginx默认目录

直接安装的发布版跟自己下载安装的就是不一样待遇啊。。。。

root@dcp-terminal:/home/ubuntu# cd /var/www/html
root@dcp-terminal:/var/www/html# mkdir res
root@dcp-terminal:/var/www/html# touch res/a.html
root@dcp-terminal:/var/www/html# echo "<body><h1>hello,res!!!</h1></body>">>res/a.html
bash: !: event not found
root@dcp-terminal:/var/www/html# echo "<body><h1>hello,res...</h1></body>">>res/a.html
root@dcp-terminal:/var/www/html#

这样,访问 http://192.168.2.186/res/a.html就能看到

hello,res...


3,资源存放

继续scp

SENRSL:Downloads senrsl$ scp /Users/senrsl/j2ee/apache-tomcat-9.0.10/webapps/res/VID_20201020_160141.mp4 ubuntu@192.168.2.186:/home/ubuntu/
ubuntu@192.168.2.186's password:
VID_20201020_160141.mp4                                                                                               100%   16MB  10.4MB/s   00:01   
SENRSL:Downloads senrsl$ scp /Users/senrsl/j2ee/apache-tomcat-9.0.10/webapps/res/4K\ Istanbul\ City.webm ubuntu@192.168.2.186:/home/ubuntu/
ubuntu@192.168.2.186's password:
4K Istanbul City.webm                                                                                                 100%  356MB   2.2MB/s   02:43   
SENRSL:Downloads senrsl$ scp /Users/senrsl/j2ee/apache-tomcat-9.0.10/webapps/res/DEMO\ SAMSUNG\ 4K\ HDR\ 60\ FPS\ 2019.mkv  ubuntu@192.168.2.186:/home/ubuntu/
ubuntu@192.168.2.186's password:
DEMO SAMSUNG 4K HDR 60 FPS 2019.mkv                                                                                   100%  219MB   3.7MB/s   00:58   
SENRSL:Downloads senrsl$


4,设备

服务器盒子: 192.168.2.186

x96: 192.168.2.60

rk3288:  192.168.2.215  重启后需要手动开启tcpip

斐讯T1:192.168.7.118


--
senRsl
2021年02月22日19:50:29

没有评论 :

发表评论