해당 프로세스는 digitalocean을 참고하였습니다.
https://www.digitalocean.com/community/tutorials/how-to-install-linux-nginx-mysql-php-lemp-stack-on-centos-7
1. epel 레파지토리 추가
yum install epel-release
2. nginx 설치
yum install nginx
3. nginx 실행
systemctl start nginx
* nginx 실행 확인은 해당 도메인 주소를 입력하여 nginx페이지가 나오면 성공
4. nginx 활성화
systemctl enable nginx
5. db설치
yum install mariadb-server mariadb
or
yum install mysql-server
저는 mysql을 설치하였습니다.
6. mysql 실행
systemctl start mysqld
* mysql의 시스템에 대한 엑세스에 대한 보안 스크립트는 위의 홈페이지 참조
7. mysql 활성화
systemctl enable mysqld
8. php 설치
* php는 php-fpm과 같이 설치되어야한다.
yum install php php-mysql php-fpm
9. php.ini 수정
경로 etc/php.ini
수정 내용
cgi.fix_pathinfo=0
10. www.conf 수정
경로 /etc/php-fpm.d/www.conf
수정내용
listen = /var/run/php-fpm/php-fpm.sock
user = nginx
group = nginx
php-fpm의 내용을 수정하였다면 실행 및 활성화
systemctl start php-fpm
systemctl enable php-fpm
11. nginx 설정
예시)
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name localhost; #localhost;
root /var/www/ci;
access_log /var/log/nginx/blog.access.log;
error_log /var/log/nginx/blog.error.log;
index index.php index.html index.htm index.nginx-debian.html;
location / {
try_files $uri $uri/ /index.php?/$request_uri;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
location ~ /\.ht {
deny all;
}
}
'서버 > 코드이그나이터' 카테고리의 다른 글
Input variables exceeded 1000 (2) | 2021.11.13 |
---|---|
log남기기 (2) | 2016.10.30 |
리눅스에서 ngix + php + mysql 설치하기 (2) | 2016.10.22 |
우분투에서 PHP7로 업그레이드 (2) | 2016.08.29 |
우분투에서 PHP5.6 버전으로 업그레이드 (2) | 2016.08.28 |
댓글