250x250
Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 |
Tags
- alb
- AWS
- node
- OAuth
- SSH
- mac
- 파이썬
- Laravel
- python
- 해시키
- pip
- window
- flutter
- Android
- Vue.js
- Cordova
- php
- MYSQL
- 구글 API
- MacOS
- 안드로이드
- nginx
- Passport
- https
- PostgreSQL
- selenium
- FCM
- Vue
- Prometheus
- ubuntu
Archives
- Today
- Total
print( sjw.iq == 200) output : true
[PHP] Ubuntu18.04에 php, apache, laravel 설치 및 설정 본문
728x90
반응형
우선 apt 업데이트를 진행해줍니다~!
※ Apt (Advanced Package Tool 의 약어) 는 Debian 시스템에 포함된 핵심 도구들의 집합체이다.
apt update
apt upgrade
apache2 설치
apt install apache2
php 설치
apt-get install php7.1
php 모듈 설치
apt-get install php-mbstring
apt-get install php-curl
apt-get install php-mysql
apt-get install php-xml
apt-get install php-xmlrpc
apt-get install php-gd
apt-get install php-imagick
sudo apt-get install php-dev libmcrypt-dev gcc make autoconf libc-dev pkg-config
sudo pecl install mcrypt-1.0.1
echo "extension=mcrypt.so" | sudo tee -a /etc/php/7.2/apache2/conf.d/mcrypt.ini
apt-get install php-tidy
apt-get install libapache2-mod-php7.2
apt-get install composer
curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer
PATH=$PATH:/usr/local/bin/
시간 설정
#dpkg-reconfigure tzdata
apache2 설정 (/etc/apache2/sites-available/000-default.conf)
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
#ServerName www.example.com
ServerAdmin webmaster@localhost
#DocumentRoot /var/www/html
DocumentRoot /var/www/zzim-api-php/public
<Directory /var/www/zzim-api-php/public>
AllowOverride All
</Directory>
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
</VirtualHost>
보안 설정
# deny file, folder start with dot
<DirectoryMatch "^\.|\/\.">
Require all denied
</DirectoryMatch>
# deny (log file, binary, certificate, shell script, sql dump file) access.
<FilesMatch "\.(?i:log|binary|pem|enc|crt|conf|cnf|sql|sh|key|yml|lock|gitignore)$">
Require all denied
</FilesMatch>
# deny access.
<FilesMatch "(?i:composer\.json|contributing\.md|license\.txt|readme\.rst|readme\.md|readme\.txt|copyright|artisan|gulpfile\.js|package\.json|phpunit\.xml|access_log|error_log|gruntfile\.js|bower\.json|changelog\.md|console|legalnotice|license|security\.md|privacy\.md)$">
Require all denied
</FilesMatch>
# Allow Lets Encrypt Domain Validation Program
<DirectoryMatch "\.well-known/acme-challenge/">
Require all granted
</DirectoryMatch>
git clone 후 .env 파일을 작성해줍니다.
그리고 아파치를 재시작 해줍니다.
#만약 file 관련 에러가 나면 다음 명령어로 storage폴더에 쓰기 권한을 줍시다.
chmod -R gu+w storage
chmod -R guo+w storage
별거 없죠?!?!
이게 끝입니다~!
728x90
반응형
'PHP' 카테고리의 다른 글
[Laravel] laravelcollective/html https 적용하기 (0) | 2020.02.04 |
---|---|
[Laravel] Laravel에서 AWS SES를 이용한 Mail 전송하기 (0) | 2020.01.28 |
[Laravel] Storage 권한 관련 문제 (0) | 2020.01.16 |
[Laravel] Excel 파일 관리하기 (0) | 2019.10.31 |
[Lalavel Framework] Queue 사용하기 (0) | 2019.06.11 |
Comments