Cmd Summary for Laravel's Env

라라벨배포nginx1. After initializing the instance, perform Linux (Ubuntu) initialization

sudo passwd root // administrator password setting

sudo apt-get update // package update

sudo apt-get update /podetia update /podetia update /podet/sudo installation


curl -sL https://deb.nodesource.com/setup_16.x | sudo bash -E -

npm install // laravel의 메인 폴더에서 실행

3. php설치

sudo apt install ca-certificates apt-transport-https software-properties-common

sudo add-apt-repository ppa:ondrej/php

sudo apt update

sudo apt install php8.2

sudo apt-get install php8.2-xml

sudo apt-get install php8.2-curl

sudo apt-get install php8.2-mysql

sudo apt install php-intl

sudo apt install php8.2-fpm

systemctl status php8.2-fpm

// 아래의 내용을 nginx의 설정파일에 추가후 nginx재시작

server {

    # . . . other code

    location ~ \.php${

   include snippets/fastcgi-php.conf;

    fastcgi_passunix:rp/p8> php/p8>


upload_max_filesize = 20M // change php.ini's capacity limit to 20mb

php.init's post capacity limit to 20mb

Additional capacity limit to

10mb>10mb>

screen, the file type changes from PHP to application/octet-stream. Therefore, it becomes an unknown file and loses the image format..

참조

4. 컴포저설치

sudo apt install wget php-cli php-zip unzip curl

curl -sS https://getcomposer.org/installer |php

sudo mv composer.phar /usr/local/bin/composer

composer update

composer install // laravel의 메인 폴더에서 실행

php artisan key:generate

php artisan storage:link

php artisan config:cache


5.라라벨의 메인디렉토리에서 파일접근권한 변경

sudo chown -R $USER:www-data storage

sudo chown -R $USER:www-data bootstrap/cache

chmod -R 775 storage 

chmod -R 775 bootstrap/cache


6.DB설치

If you install Mysql, create the corresponding device and give permission to the corresponding user

and modify the file to allow external access to Mysql

/etc/mysql.conf.d/mysqldcncn

view:cache // Required when changing the screen

sudo systemctl stop mysql.service // Suspend due to insufficient memory in the current instance

npm run build // Understand mysql as memory usage and build it 

sudo systemctl restart php8.2-fpm.service

sudo systemctl restart nginx.service

sudo systemctl start mysql.service

Aug 8, 2023 Views 336