개발모음집

nginx+php7+mariadb install on Ubuntu 16.04 본문

Server

nginx+php7+mariadb install on Ubuntu 16.04

void 2018. 8. 14. 10:00


 sudo apt-get update

 sudo apt install nginx

 export LANGUAGE=en_US.UTF-8

  export LC_ALL=en_US.UTF-8

 locale-gen en_US.UTF-8

 dpkg-reconfigure locales

 sudo systemctl start nginx.service

  sudo systemctl enable nginx.service

  apt-get install mariadb-server mariadb-client

  sudo systemctl start  mysql.service

sudo systemctl status  mysql.service

  sudo mysql_secure_installation

  sudo systemctl restart mysql.service

 sudo mysql -u root -p

  sudo apt-get install software-properties-common

  sudo add-apt-repository ppa:ondrej/php

  sudo apt install php7.1-fpm php7.1-common php7.1-mbstring php7.1-xmlrpc php7.1-soap php7.1-gd php7.1-xml php7.1-intl php7.1-mysql php7.1-cli php7.1-mcrypt php7.1-zip php7.1-curl

 sudo nano /etc/php/7.1/fpm/php.ini

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

 sudo systemctl restart nginx.service

 systemctl restart php7.1-fpm.service

 sudo nano /var/www/html/phpinfo.php

 php -v

  nginx -v


참고  

설치 : Install Nginx, MariaDB And PHP 7.1 (LEMP) With Ubuntu 16.04 LTS Server





- 내가 실수한  부분

nginx 502 badgate error : https://blog.gomgom.io/502-bad-gateway-solution-on-nginx-php_fpm/

ubuntu 언어셋 문제 : https://zunonia.wordpress.com/2014/02/27/ubuntu%EC%97%90%EC%84%9C-%EC%96%B8%EC%96%B4%EC%85%8B%EC%9D%B4-%EA%B4%80%EB%A0%A8-%EC%97%90%EB%9F%AC-%EC%B2%98%EB%A6%AC%EB%B2%95/

sudo nano /etc/nginx/sites-available/default 에서 /php7.0-fpm.sock; 

내가 설치한 건 7.1인데 7.0으로 입력해서 php파일을 열면 502 에러 발생했음

7.1로 변경함


# 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.1-fpm.sock; # # With php-cgi (or other tcp sockets): # fastcgi_pass 127.0.0.1:9000; }


'Server' 카테고리의 다른 글

docker 명령어 모음  (0) 2018.08.19
mac에서 aws 인스턴스로 파일 올리기  (0) 2018.08.16
aws에 pem파일을 이용하여 ssh 접속하기  (0) 2018.08.13
ubuntu에서 apache+php+mysql 설치  (0) 2018.06.29
aws ubuntu, root 접속  (0) 2018.06.20