Centos에서 Laravel 설치
[ APM설치 ]
yum -y install http://rpms.remirepo.net/enterprise/remi-release-7.rpmyum -y install epel-release yum-utilsyum-config-manager --enable remi-php74yum install httpdyum install php php-cli php-bcmath php-bz2 php-common php-curl php-dba php-gd php-json php-mbstring php-opcache php-readline php-soap php-xml php-xmlrpc php-zip php-ctype php-pdo php-redis php-mysql php-imagick php-intlvi /etc/yum.repos.d/MariaDB.repo[mariadb]name = MariaDBbaseurl = http://yum.mariadb.org/10.4/centos7-amd64gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDBgpgcheck=1yum install MariaDB-server MariaDB-clientsystemctl enable httpdsystemctl enable mariadb
[ Apache /etc/httpd/conf/http.conf 설정 ] (빨간색 추가 및 변경)
LoadModule rewrite_module modules/mod_rewrite.so
<Directory "/home/centos">
AllowOverride None# Allow open access:Require all granted</Directory><IfModule dir_module>DirectoryIndex index.html index.php
</IfModule># Virtual hostsInclude conf/extra/httpd-vhosts.conf
[ /etc/httpd/conf/extra/httpd-vhosts.conf 설정 ]
<VirtualHost *:80>ServerAdmin mygmail@gmail.comDocumentRoot "/home/centos/laravel_project/public"ServerName 11.22.333.44#ServerAlias 11.22.333.44ErrorLog "/home/centos/laravel_project/logs/error_log"CustomLog "/home/centos/laravel_project/logs/access_log" common<Directory /home/centos/laravel_project/public/>AllowOverride AllAllow from all</Directory><Directory /home/centos/laravel_project/storage/>AllowOverride AllAllow from all</Directory></VirtualHost>
[ 라라벨 설치 ]
timedatectl set-timezone Asia/Seoul# 라라벨을 인스톨을 제공하는 composer설치curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/bin/ln -s /usr/bin/composer.phar /usr/bin/composer# 라라벨 설치composer global require laravel/installerecho 'export PATH="$PATH:$HOME/.config/composer/vendor/bin"' >> ~/.bashrcsource .bashrc# 새 프로젝트 생성laravel new laravel_project
[ 폴더 권한 변경 ]
1. 라라벨 폴더 경로가 /home/centos/laravel_project 라면 3개폴더 모두 chmod 7552. chmod -R 777 laravel_project/storage (정확히 framework, logs 폴더때문)
[ 실행 ]
systemctl restart httpdweb url창에 11.22.333.44로 접속
[ 실행 화면 ]
댓글 없음:
댓글 쓰기