웹서버 | CentOS 8.2 + PHP-FPM 7.4 + MariaDB 10.3 + 성공
페이지 정보
작성자 전소현 작성일21-01-18 11:35 조회527회 댓글0건관련링크
본문
CentOS 8.2 + PHP-FPM 7.4 + MariaDB 10.3
#-----------------------------------------------------------#
[1] PHP
dnf module list php
dnf install -y dnf-utils http://rpms.remirepo.net/enterprise/remi-release-8.rpm
dnf module list php
module reset php
dnf module enable php:remi-7.4
dnf module list php
dnf info php-fpm
dnf install php-fpm -y
php-fpm -v
systemctl start php-fpm , systemctl restart php-fpm
systemctl status php-fpm
systemctl enable php-fpm
[2] nginx
$ sudo yum install yum-utils
$ sudo vi /etc/yum.repos.d/nginx.repo
[nginx-stable]
name=nginx stable repo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=1
enabled=1
gpgkey=https://nginx.org/keys/nginx_signing.key
module_hotfixes=true
[nginx-mainline]
name=nginx mainline repo
baseurl=http://nginx.org/packages/mainline/centos/$releasever/$basearch/
gpgcheck=1
enabled=0
gpgkey=https://nginx.org/keys/nginx_signing.key
module_hotfixes=true
$ sudo firewall-cmd --permanent --zone=public --add-service=http
$ sudo firewall-cmd --permanent --zone=public --add-service=https
$ sudo firewall-cmd --permanent --zone=public --add-port=3306/tcp
$ sudo firewall-cmd --reload
$ sudo yum-config-manager --enable nginx-mainline
$ sudo yum install nginx
$ sudo systemctl start nginx , sudo systemctl restart nginx
$ sudo systemctl enable nginx
$ sudo systemctl restart nginx
-------------- nginx
vi /etc/nginx/conf.d/default.conf
server {
listen 80;
server_name localhost;
#charset koi8-r;
#access_log /var/log/nginx/host.access.log main;
root /usr/share/nginx/html;
index index.php index.html index.htm;
location / {
try_files $uri $uri/ =404;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
location ~ \.php$ {
fastcgi_pass unix:/run/php-fpm/www.sock;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
}
}
$ vi /usr/share/nginx/html/phpinfo.php
<?
echo "--";
?>
$ vi /etc/php-fpm.d/www.conf
user = nginx
group = nginx
listen.owner = nginx
listen.group = nginx
listen.mode = 0660
sudo systemctl restart nginx
sudo chown -R nginx.nginx /usr/share/nginx/html
chcon -R -t httpd_sys_rw_content_t /usr/share/nginx/html
chmod 755 /usr/share/nginx/html
end
---------------------------------------------------------
$ sudo dnf install libreoffice-base mariadb-java-client
$ sudo dnf install mariadb-connector-odbc
$ dnf install php-fpm -y
/etc/php.ini
- short_open_tag=On 짧은링크
[추가모듈 설치]
$ dnf install php-mysqlnd php-gd php-mcrypt php-mbstring php-curl php-xml -y
$ systemctl restart php-fpm
#-----------------------------------------------------------#
[1] PHP
dnf module list php
dnf install -y dnf-utils http://rpms.remirepo.net/enterprise/remi-release-8.rpm
dnf module list php
module reset php
dnf module enable php:remi-7.4
dnf module list php
dnf info php-fpm
dnf install php-fpm -y
php-fpm -v
systemctl start php-fpm , systemctl restart php-fpm
systemctl status php-fpm
systemctl enable php-fpm
[2] nginx
$ sudo yum install yum-utils
$ sudo vi /etc/yum.repos.d/nginx.repo
[nginx-stable]
name=nginx stable repo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=1
enabled=1
gpgkey=https://nginx.org/keys/nginx_signing.key
module_hotfixes=true
[nginx-mainline]
name=nginx mainline repo
baseurl=http://nginx.org/packages/mainline/centos/$releasever/$basearch/
gpgcheck=1
enabled=0
gpgkey=https://nginx.org/keys/nginx_signing.key
module_hotfixes=true
$ sudo firewall-cmd --permanent --zone=public --add-service=http
$ sudo firewall-cmd --permanent --zone=public --add-service=https
$ sudo firewall-cmd --permanent --zone=public --add-port=3306/tcp
$ sudo firewall-cmd --reload
$ sudo yum-config-manager --enable nginx-mainline
$ sudo yum install nginx
$ sudo systemctl start nginx , sudo systemctl restart nginx
$ sudo systemctl enable nginx
$ sudo systemctl restart nginx
-------------- nginx
vi /etc/nginx/conf.d/default.conf
server {
listen 80;
server_name localhost;
#charset koi8-r;
#access_log /var/log/nginx/host.access.log main;
root /usr/share/nginx/html;
index index.php index.html index.htm;
location / {
try_files $uri $uri/ =404;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
location ~ \.php$ {
fastcgi_pass unix:/run/php-fpm/www.sock;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
}
}
$ vi /usr/share/nginx/html/phpinfo.php
<?
echo "--";
?>
$ vi /etc/php-fpm.d/www.conf
user = nginx
group = nginx
listen.owner = nginx
listen.group = nginx
listen.mode = 0660
sudo systemctl restart nginx
sudo chown -R nginx.nginx /usr/share/nginx/html
chcon -R -t httpd_sys_rw_content_t /usr/share/nginx/html
chmod 755 /usr/share/nginx/html
end
---------------------------------------------------------
$ sudo dnf install libreoffice-base mariadb-java-client
$ sudo dnf install mariadb-connector-odbc
$ dnf install php-fpm -y
/etc/php.ini
- short_open_tag=On 짧은링크
[추가모듈 설치]
$ dnf install php-mysqlnd php-gd php-mcrypt php-mbstring php-curl php-xml -y
$ systemctl restart php-fpm
[주소복사] https://www.goodsweb.kr/?u=D41ENFGV
SNS 알리기
핀터레스트
텔레그램로
블로그로
페이스북
트위터
카카오스토리
카톡 공유
관련 블로그
로딩중