Linux

Centos7 APM Laravel 설치

Jack Moon 2018. 8. 24. 17:12


centos7_apm_laravel.txt



* 업데이트
yum -y update

* 아파치, mariadb 설치
yum install httpd mariadb-server mariadb

* PHP 7.2 설치
yum search php72w

결과 안 나오면

rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
yum install php72w php72w-mbstring php72w-cli php72w-common php72w-devel php72w-gd php72w-curl php72w-mysql php72w-pdo  php72w-pear php72w-process php72w-xml
php -v

* 아파치, mariadb 실행 및 자동실행 설정
systemctl start httpd
systemctl enable httpd
systemctl start mariadb
systemctl enable mariadb

* mariadb 초기 설정

mysql_secure_installation

Enter current password for root (enter for none):

Set root password? [Y/n] y
New password:
Re-enter new password:

Remove anonymous users? [Y/n] y

Disallow root login remotely? [Y/n] y

Remove test database and access to it? [Y/n] y

Reload privilege tables now? [Y/n] y

* my.cnf 설정
cp /usr/share/mysql/my-huge.cnf /etc/my.cnf

vi /etc/my.cnf
[mysqld]
character_set_server = utf8

확인
> show variables like 'c%';

* composer 설치
curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/bin/composer
chmod +x /usr/bin/composer
composer -V

* 라라벨 설치

# useradd laravel
# passwd laravel

생성한 계정으로 이동하여 laravel 설치
# su - laravel
$ composer global require "laravel/installer"

PATH 설정
$ vi .bash_profile
PATH=$PATH:$HOME/.local/bin:$HOME/bin:$HOME/.config/composer/vendor/bin

현재 설정 반영
$ source .bash_profile

새로운 프로젝트 생성
$ laravel new firstPJ

$ chmod 777 -R firstPJ/bootstrap/cache/
$ chmod 777 -R firstPJ/storage/

* httpd 설정
vi /etc/httpd/conf/httpd.conf

ServerName 도메인이 있다면 도메인을 입력하고 없다면 서버의 IP입력 하시면 됩니다.
예) ServerName [ www.test.com:80 or 192.168.119.132:80 or 192.168.10.100:8080 ]

DocumentRoot 수정
<Directory "/home/prmonitor/www"> 수정

아래를 수정 안하면 라라벨등에서 routes 안 먹음
<Directory "/home/prmonitor/www">  안에 있는 AllowOverride None -> AllowOverride All

DirectoryIndex index.html index.htm index.php

* 방화벽 설정 : firewalld 서비스를 내리고 iptables 서비스를 올린다
# systemctl disable firewalld (자동시작 안되게)
# systemctl stop firewalld (서비스 종료)
# yum install iptables-services (iptables 설치)
# systemctl enable iptables (자동시작)
# systemctl start iptables (서비스 시작)

centos7_apm_laravel.txt
0.0MB

'Linux' 카테고리의 다른 글

주요 리눅스 서버 지원 기간  (0) 2019.08.05
Centos7 apache2.4.6 Laravel 환경 virtual host 설정  (0) 2018.08.28
mecab 사용자 사전 추가  (0) 2018.05.31
PHP에서 mecab-ko 사용하기   (0) 2018.04.17
Yum이란?  (0) 2018.03.08