반응형
새로 이전 될 서버를 아래 환경으로 세팅한다.
1, PHP를 최소 7.2 버전 이상으로 설치한다.
(PHP7.2 로 업그레이드 하는 방법은 https://koreaidc.tistory.com/49 를 참고하시면 됩니다.)
2, php.ini 파일에서 아래 옵션을 수정하거나 추가한다.
expose_php = Off
log_errors = On
error_log = "/usr/local/lnmp/php/var/log/error_log"
error_reporting=E_ALL&~E_NOTICE
(혹은 index.php 상단에 error_reporting(E_ALL ^ E_NOTICE); 추가)
(이 설정대로 하지 않으면 웹페이지는 undefined offset 혹은 undefined index 에러가 나타날 수 있다.)
yum -y install php-pgsql
yum -y install memcached
yum -y install php-memcached
3, 웹서버 설정파일을 아래와 같이 수정한다.
//Apache 웹서버라면 설정파일에서 아래 사항을 수정 혹은 추가 한다.
# Set document root to be "basic/web" DocumentRoot "path/to/basic/web" <Directory "path/to/basic/web"> # use mod_rewrite for pretty URL support RewriteEngine on # if $showScriptName is false in UrlManager, do not allow accessing URLs with script name RewriteRule ^index.php/ - [L,R=404] # If a directory or a file exists, use the request directly RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d # Otherwise forward the request to index.php RewriteRule . index.php # ...other settings... |
(참고문서: https://github.com/yiisoft/yii2/blob/master/docs%2Fguide%2Fstart-installation.md#recommended-apache-configuration-)
반응형
'서버관리 > Linux' 카테고리의 다른 글
리눅스 공부를 위한 가상환경 세팅하기 (0) | 2022.05.25 |
---|---|
CentOS7에 웹서버 세팅하기(Apache+PHP+MariaDB) (0) | 2019.08.04 |
PHP7.2에 memcache 모듈 설치 (0) | 2019.07.23 |
CentOS 6/7 에서 PHP 7.2 로 업그레이드 하기 (0) | 2019.07.23 |
간단한 디도스공격 방어하기 (0) | 2011.05.06 |