os/ : rocky linux 8.x
1 2 |
[root@localhost ~]# cat /etc/redhat-release Rocky Linux release 8.9 (Green Obsidian) |
maridb instsll / repo 파일 생성
1 |
[root@localhost ~]# curl -LsS https://r.mariadb.com/downloads/mariadb_repo_setup | sudo bash -s -- --mariadb-server-version="mariadb-11.3.1" |
설치 진행
1 |
[root@localhost ~]# yum install MariaDB-client MariaDB-connect-engine mariadb-devel mariadb-server |
my.cnf 설정 utf8
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
[root@localhost ~]# vi /etc/my.cnf.d/server.cnf [mysqld] character-set-server=utf8 collation-server=utf8_unicode_ci skip-character-set-client-handshake #connection max_connections = 1000 max_connect_errors = 1000 wait_timeout= 60 # sqlmode sql_mode=NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION |
서비스 등록 및 시작
1 2 3 4 |
[root@localhost ~]# systemctl enable mariadb Created symlink /etc/systemd/system/multi-user.target.wants/mariadb.service → /usr/lib/systemd/system/mariadb.service. [root@localhost ~]# systemctl start mariadb |
접속확인
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 32 33 34 35 36 |
[root@localhost ~]# mysql mysql: Deprecated program name. It will be removed in a future release, use '/usr/bin/mariadb' instead Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 3 Server version: 11.3.1-MariaDB MariaDB Server Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]> \s -------------- mysql from 11.3.1-MariaDB, client 15.2 for Linux (x86_64) using readline 5.1 Connection id: 3 Current database: Current user: root@localhost SSL: Not in use Current pager: stdout Using outfile: '' Using delimiter: ; Server: MariaDB Server version: 11.3.1-MariaDB MariaDB Server Protocol version: 10 Connection: Localhost via UNIX socket Server characterset: utf8mb3 Db characterset: utf8mb3 Client characterset: utf8mb3 Conn. characterset: utf8mb3 UNIX socket: /var/lib/mysql/mysql.sock Uptime: 18 sec Threads: 1 Questions: 4 Slow queries: 0 Opens: 17 Open tables: 10 Queries per second avg: 0.222 -------------- MariaDB [(none)]> |
2. apache install
1 |
[root@localhost ~]# dnf install httpd httpd-devel mod_ssl |
3. 서비스 환경설정 파일 수정
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 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 |
[root@localhost ~]# vi /etc/httpd/conf/httpd.conf ServerRoot "/etc/httpd" #Listen 12.34.56.78:80 Listen 80 Include conf.modules.d/*.conf User apache Group apache ServerAdmin root@localhost ServerName www.example.com:80 <Directory /> AllowOverride none Require all granted </Directory> #DocumentRoot "/var/www/html" #<Directory "/var/www"> # AllowOverride None # # Allow open access: # Require all granted #</Directory> <IfModule dir_module> DirectoryIndex index.html index.htm </IfModule> # <Files ".ht*"> Require all denied </Files> # ErrorLog "logs/error_log" LogLevel warn <IfModule log_config_module> #LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i %{GEOIP_COUNTRY_CODE}e" combined LogFormat "%h %l %u %t \"%r\" %>s %b" common <IfModule logio_module> # You need to enable mod_logio.c to use %I and %O #LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O %{GEOIP_COUNTRY_CODE}e" combinedio </IfModule> #CustomLog "logs/access_log" common CustomLog "logs/access_log" combined </IfModule> #<Directory "/var/www/cgi-bin"> # AllowOverride None # Options None # Require all granted #</Directory> <IfModule mime_module> TypesConfig /etc/mime.types #AddType application/x-gzip .tgz #AddEncoding x-compress .Z #AddEncoding x-gzip .gz .tgz AddType application/x-compress .Z AddType application/x-gzip .gz .tgz #AddHandler cgi-script .cgi #AddHandler type-map var AddType text/html .shtml AddOutputFilter INCLUDES .shtml </IfModule> AddDefaultCharset UTF-8 <IfModule mime_magic_module> MIMEMagicFile conf/magic </IfModule> # Some examples: #ErrorDocument 500 "The server made a boo boo." #ErrorDocument 404 /missing.html #ErrorDocument 404 "/cgi-bin/missing_handler.pl" #ErrorDocument 402 http://www.example.com/subscription_info.html # #EnableMMAP off EnableSendfile on # Load config files in the "/etc/httpd/conf.d" directory, if any. IncludeOptional conf.d/*.conf ### apache version Hide ServerTokens Prod ServerSignature Off |
### php 8.3 install / repo add
1 2 3 4 5 6 7 8 9 10 |
[root@localhost ~]# dnf config-manager --set-enabled powertools [root@localhost ~]# wget http://rpms.remirepo.net/enterprise/remi-release-8.rpm [root@localhost ~]# rpm -Uvh remi-release-8.rpm 경고: remi-release-8.rpm: Header V4 RSA/SHA256 Signature, key ID 5f11735a: NOKEY Verifying... ################################# [100%] 준비 중... ################################# [100%] Updating / installing... 1:remi-release-8.9-3.el8.remi ################################# [100%] |
module list 확인
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
[root@localhost ~]# dnf module list php Rocky Linux 8 - PowerTools 2.8 MB/s | 2.6 MB 00:00 Remi's Modular repository for Enterprise Linux 8 - x86_64 302 kB/s | 931 kB 00:03 Safe Remi's RPM repository for Enterprise Linux 8 - x86_64 574 kB/s | 1.9 MB 00:03 마지막 메타자료 만료확인(0:00:01 이전): 2024년 02월 07일 (수) 오후 01시 32분 52초. Rocky Linux 8 - AppStream Name Stream Profiles Summary php 7.2 [d] common [d], devel, minimal PHP scripting language php 7.3 common [d], devel, minimal PHP scripting language php 7.4 common [d], devel, minimal PHP scripting language php 8.0 common [d], devel, minimal PHP scripting language Remi's Modular repository for Enterprise Linux 8 - x86_64 Name Stream Profiles Summary php remi-7.2 common [d], devel, minimal PHP scripting language php remi-7.3 common [d], devel, minimal PHP scripting language php remi-7.4 common [d], devel, minimal PHP scripting language php remi-8.0 common [d], devel, minimal PHP scripting language php remi-8.1 common [d], devel, minimal PHP scripting language php remi-8.2 common [d], devel, minimal PHP scripting language php remi-8.3 common [d], devel, minimal PHP scripting language 힌트 : [d] efault, [e] nabled, [x] disabled, [i] stalled |
php 8.3 install
1 2 3 4 5 |
[root@localhost ~]# dnf install php83 php83-php-cli php83-php-common php83-php-dba php83-php-devel \ php83-php-embedded php83-php-enchant php83-php-fpm php83-php-gd php83-php-gmp \ php83-php-libvirt php83-php-mbstring php83-php-mysqlnd php83-php-odbc \ php83-php-opcache php83-php-pdo php83-php-pear php83-php-soap \ php83-php-xml php83-syspaths php83-php-xml php83-php-bcmath |
버전 확인
1 2 3 4 5 |
[root@localhost ~]# php -v PHP 8.3.2 (cli) (built: Jan 16 2024 13:46:41) (NTS gcc x86_64) Copyright (c) The PHP Group Zend Engine v4.3.2, Copyright (c) Zend Technologies with Zend OPcache v8.3.2, Copyright (c), by Zend Technologies |
php.ini 환경설정 수정
1 2 3 4 5 6 |
[root@localhost ~]# vi /etc/php.ini short_open_tag = On date.timezone = "Asia/Seoul" error_reporting = "E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_USER_DEPRECATED" upload_max_filesize = 12M |
html 파일내에서 php 인식할수 있게 php-fpm 환경수정
1 2 3 4 |
[root@localhost ~]# vi /etc/httpd/conf.d/php83-php.conf ### 변경 <FilesMatch \.(php|html|htm|phar)$> |
서비스 등록 및 시작
1 2 3 4 |
[root@localhost ~]# systemctl enable php83-php-fpm Created symlink /etc/systemd/system/multi-user.target.wants/php83-php-fpm.service → /usr/lib/systemd/system/php83-php-fpm.service. [root@localhost ~]# systemctl start php83-php-fpm |
웹페이지 확인하기 위해서 홈 디렉토리 생성 및 가상호스트 생성
1 2 3 4 5 6 7 8 9 10 |
[root@localhost ~]# mkdir -p /home/xinet/html/ [root@localhost ~]# vi /etc/httpd/conf.d/vhost.conf <VirtualHost *:80> DocumentRoot "/home/xinet/html/" ServerName www2.xinet.kr ErrorLog "logs/error_log" CustomLog "logs/access_log" combined </VirtualHost> |
phpinfo 파일 생성
1 2 3 4 5 |
[root@localhost ~]# vi /home/xinet/html/index.php <? phpinfo(); ?> |
php-fpm 및 httpd 재시작
1 2 3 |
[root@localhost ~]# systemctl restart php83-php-fpm [root@localhost ~]# systemctl restart httpd |