Post

맛이슈 배포 대작전

FE

맛이슈

아이디ssh elice@34.64.208.88
비번****************
폴더 들어가기cd dev-fe/front
최신버전 당겨오기git pull origin <브랜치명>
새로운 의존성있으면 설치npm i
빌드npm run build
새로운 빌드 파일로 무중단 재시작pm2 reload 0

배포과정

아이디

ssh elice@34.64.208.88

비번

///

nginx 설치

sudo apt install nginx

nginx 설정파일

sudo nano /etc/nginx/sites-available/default

  • 설정파일 복붙

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    
    # applications, such as Drupal or Wordpress. These applications will be made
    # available underneath a path with that package name, such as /drupal8.
    #
    # Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
    ##
    
    # Default server configuration
    #
    server {
            listen 80 default_server;
            listen [::]:80 default_server;
    				server_name matissue.com www.matissue.com
            # SSL configuation
            #
            # listen 443 ssl default_server;
            # listen [::]:443 ssl default_server;
            #
            # Note: You should disable gzip for SSL traffic.
            # See: https://bugs.debian.org/773332
            #
            # Read up on ssl_ciphers to ensure a secure configuration.
            # See: https://bugs.debian.org/765782
            #
            # Self signed certs generated by the ssl-cert package
            # Don't use them in a production server!
            #
            # include snippets/snakeoil.conf;
    
            root /ubuntu/dev-fe/front;
    
            # Add index.php to the list if you are using PHP
            index index.html index.htm index.nginx-debian.html;
    
            server_name _;
    
            location / {
                    # First attempt to serve request as file, then
                    # as directory, then fall back to displaying a 404.
                    proxy_pass http://127.0.0.1:3000;
            }
    
            # pass PHP scripts to FastCGI server
            #
            #location ~ \.php$ {
            #       include snippets/fastcgi-php.conf;
            #
            #       # With php-fpm (or other unix sockets):
            #       fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
            #       # With php-cgi (or other tcp sockets):
            #       fastcgi_pass 127.0.0.1:9000;
            #}
    
            # deny access to .htaccess files, if Apache's document root
            # concurs with nginx's one
            #
            #location ~ /\.ht {
            #       deny all;
            #}
    }
    
    # Virtual Host configuration for example.com
    #
    # You can move that to a different file under sites-available/ and symlink that
    # to sites-enabled/ to enable it.
    #
    #server {
    #       listen 80;
    #       listen [::]:80;
    #
    #       server_name example.com;
    #
    #       root /var/www/example.com;
    #       index index.html;
    #
    #       location / {
    #               try_files $uri $uri/ =404;
    #       }
    #}
    
    

volta 설치

curl https://get.volta.shbash

volta 설치 후 한번 재시작

source ~/.bashrc

volta로 node, pm2 설치

volta install node volta install pm2

volta로 node, pm2 설치

pm2 delete 0

nextjs 빌드

npm run build

pm2로 nextJS 배포버전 실행

pm2 start npm – start

Can I use pm2 to keep a Next.js app running


BE

배포과정

1
2
3
4
5
**계정** (render.com / gmx 이메일 계정이랑 동일)

matissue@gmx.com
@Ubinzzang1
[Cloud Application Hosting for DevelopersRender](https://render.com/)

배포 깃허브

GitHub - nea04184/testserver

ssh 인증서 (https 받기)

https://www.youtube.com/watch?v=uSm3xepvUNM

1
2
sudo apt-get install certbot python3-certbot-nginx
sudo certbot --nginx
이슈명링크
certbothttps://www.youtube.com/watch?v=uSm3xepvUNM

[트러블슈팅]

This post is licensed under CC BY 4.0 by the author.