動画共有サーバーを閉鎖するので履歴と設定だけバックアップ

動画共有サーバーのために3年間レンタルサーバーを借りていたのですが、サーバーも古くなってしまってローカルに引っ越しをしたので閉鎖します。その前に一応設定とか残しておきます。また見直す機会があるかもしれません。

Welcome to Ubuntu 18.04.4 LTS (GNU/Linux 4.15.0-213-generic x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

  System information as of Sat Feb 24 18:43:11 JST 2024

  System load:  0.08               Processes:           108
  Usage of /:   32.1% of 98.25GB   Users logged in:     0
  Memory usage: 40%                IP address for eth0: 160.251.50.47
  Swap usage:   11%

 * Strictly confined Kubernetes makes edge and IoT secure. Learn how MicroK8s
   just raised the bar for easy, resilient and secure K8s cluster deployment.

106 packages can be updated.
1 update is a security update.


You have mail.

サーバー操作履歴

    1  ls
    2  cd /home/
    3  ls
    4  cd ..
    5  sudo apt update
    6  sudo apt install nginx
    7  sudo apt install git
    8  sudo apt install ffmpeg
    9  sudo systemctl reload nginx
   10  sudo mkdir -p /var/www/live-streaming.pro/html
   11  sudo chown -R $USER:$USER /var/www/live-streaming.pro/html
   12  sudo chmod -R 755 /var/www/live-streaming.pro
   13  nano /var/www/live-streaming.pro/html/index.html
   14  sudo nano /etc/nginx/sites-available/live-streaming.pro
   15  sudo ln -s /etc/nginx/sites-available/live-streaming.pro /etc/nginx/sites-enabled/
   16  sudo nano /etc/nginx/nginx.conf
   17  systemctl restart nginx
   18  systemctl status nginx.service
   19  cd /etc/nginx/sites-enabled/
   20  ls
   21  nano live-streaming.pro
   22  nano default
   23  nano live-streaming.pro
   24  sudo systemctl restart nginx
   25  systemctl status nginx.service
   26  nano live-streaming.pro
   27  systemctl status nginx.service
   28  sudo systemctl restart nginx
   29  cd /var/www/live-streaming.pro/html/
   30  ls
   31  rm -rf index.html
   32  ls
   33  git clone https://github.com/vaibhav6388/video-script.git
   34  cd video-script/
   35  ls
   36  rm -rf messages.sql installation.sql
   37  ls
   38  ls -a
   39  rm -rf .git .gitignore
   40  ls -a
   41  nano .env
   42  sudo npm install forever -g
   43  npm install forever -g
   44  curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
   45  sudo apt install nodejs
   46  sudo apt install build-essential
   47  npm install forever -g
   48  npm install
   49  npm run build
   50  forever start server/app.js
   51  mysql -u root -p
   52  sudo apt update
   53  sudo apt install mysql-server
   54  nano .env
   55  sudo mysql_secure_installation
   56  mysql
   57  mysql -u root -p
   58  nano .env
   59  forever stopall
   60  forever start server/app.js
   61  cd temporary/
   62  ls
   63  cd cache/
   64  ls
   65  cd ..
   66  sudo add-apt-repository ppa:certbot/certbot
   67  sudo apt install python3-certbot-nginx
   68  sudo systemctl reload nginx
   69  sudo certbot --nginx -d live-streaming.pro -d www.live-streaming.pro
   70  nano /etc/nginx/sites-enabled/live-streaming.pro
   71  nano /etc/nginx/sites-enabled/default
   72  sudo systemctl restart nginx
   73  nano /etc/nginx/sites-enabled/live-streaming.pro
   74  sudo certbot --nginx -d live-streaming.pro -d
   75  sudo certbot --nginx -d live-streaming.pro
   76  nano /etc/nginx/sites-enabled/live-streaming.pro
   77  sudo systemctl reload nginx
   78  nano .env
   79  forever stopall
   80  forever start server/app.js
   81  which ffmpeg
   82  htop
   83  nano .env
   84  htop
   85  
   86  ssh root@160.251.21.167
   87  cd /var/www/live-streaming.pro/html/video-script/
   88  ls
   89  forever list
   90  nano /root/.forever/X5b5.log
   91  iperf
   92  ssh root@165.227.145.131
   93  history
   94  cd /var/www/live-streaming.pro/
   95  ls
   96  cd html/
   97  ls
   98  cd video-script/
   99  ls
  100  npm run build
  101  forever stopall
  102  forever start server/app.js
  103  forever list
  104  nano /root/.forever/ECio.log
  105  forever stopall
  106  forever start server/app.js
  107  forever stopall
  108  forever start server/app.js
  109  npm run build
  110  forever stopall
  111  forever start server/app.js
  112  history
  113  yum install postfix
  114  apt install yum
  115  yum install postfix
  116  sudo apt install postfix
  117  history
  118  sudo systemctl reload nginx
  119  forever start server/app.js

nginxの設定

root@160-251-50-47:/etc/nginx/sites-available# ls
default  live-streaming.pro
root@160-251-50-47:/etc/nginx/sites-available#vi live-streaming.pro

server {

    root /var/www/live-streaming.pro/html/;

    # Add index.php to the list if you are using PHP
    index index.html index.htm index.nginx-debian.html;

    server_name live-streaming.pro;

    location / {
        proxy_pass http://localhost:3000;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
        proxy_set_header X-Forwarded-Proto 'https';
        # First attempt to serve request as file, then
        # as directory, then fall back to displaying a 404.
        #try_files $uri $uri/ =404;
    }


    listen [::]:443 ssl ipv6only=on; # managed by Certbot
    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/live-streaming.pro/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/live-streaming.pro/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

}
server {
    if ($host = live-streaming.pro) {
        return 301 https://$host$request_uri;
    } # managed by Certbot


    listen 80;
    listen [::]:80;

    server_name live-streaming.pro;
    return 404; # managed by Certbot


}

Bio

田端厚賢

名前:田端厚賢(Atsuyoshi Tabata)

WordPressを中心に企業様から委託を受けてサイトやサーバーの保守・管理、システム開発を行っています。

2024年4月より東大の松尾研でLLLMの開発プロジェクトに参加しています。

プロフィール詳細
Web制作依頼の詳細
お問い合わせはコチラ