ksh0165 / ReactStudy

업무에 필요한 내용 기록
http://github.com/ksh0165/works.git
0 stars 0 forks source link

centos 7 apache설치(최종) #101

Open ksh0165 opened 4 years ago

ksh0165 commented 4 years ago

https://cornswrold.tistory.com/159

php7 -> docker로 설치 함 (8000->80) docker pull docker.io/phpdockerio/php72-fpm

docker exec -it 99e29e26c97d /bin/bash

http://192.168.0.6:8000/laravel/public/index.php

docker run -it --privileged -p 22/tcp -p 8000:80 -p 8080:8000 --name php7v -v /etc/localtime:/etc/localtime:ro -e TZ=Asia/Seoul --dns 8.8.8.8 --cap-add=NET_ADMIN -e container=docker -v /sys/fs/cgroup:/sys/fs/cgroup:ro docker.io/phpdockerio/php72-fpm

ksh0165 commented 4 years ago

ubuntu php7.2 설치 (라라벨)

http://blog.naver.com/onlyu/220903117464 apt-get install composer

composer create-project laravel/laravel laravel --prefer-dist

root@99e29e26c97d:/var/www/html# mv /var/lib/php/modules/7.2/laravel/ . root@99e29e26c97d:/var/www/html/laravel# composer require laravel/homestead --dev

ksh0165 commented 4 years ago

php apache 연동 하자

https://blog.jusun.org/archives/90

apt-get install apache2

a2enmod rewrite headers

apt-get install php-mysql php-xmlrpc php-xml php-curl php-gd php-pear

apt-get install libapache2-mod-php7.2

ksh0165 commented 4 years ago

centos7 apache2 <-> php 연동

[root@dothome-world ~]# yum install mod_php72w php72w-cli [root@dothome-world ~]# yum install php72w-bcmath php72w-gd php72w-mbstring php72w-mysqlnd php72w-pear php72w-xml php72w-xmlrpc php72w-process

시작 url : http://192.168.0.6/index.php 폴더 : /var/www/html/laravel/public

ksh0165 commented 4 years ago

방화벽 끄기 systemctl stop firewalld 아파치 시작 systemctl start httpd

ksh0165 commented 4 years ago

apache 설정

<VirtualHost *:80> ServerName localhost DocumentRoot /var/www/html/laravel/public <Directory "/var/www/html/laravel/public"> AllowOverride All Require all granted

AddHandler php5-script .php .htm .html .php5 .php7 AddType text/html .shtml AddOutputFilter INCLUDES .shtml AddType application/x-compress .Z AddType application/x-gzip .gz .tgz AddType application/x-httpd-php .php7 .php5 .html .htm .inc .php4 .phtml .ph AddType application/x-httpd-php-source .phps

ServerName localhost