1. APM 설치
# yum install httpd
# yum install mariadb mariadb-server
# yum install php php-fpm php-gd php-mysqlnd php-mbstring php-cli php-common php-devel php-curl php-pdo php-pear php-process php-xml
2. Apache 설정
# vi /etc/httpd/conf/httpd.conf
ServerName 도메인이 있다면 도메인을 입력하고 없다면 서버의 IP입력 하시면 됩니다.
예) ServerName [ www.test.com:80 or 192.168.119.132 or 192.168.10.100:8080 ]
......
DocumentRoot "/home/prmonitor/www"
........
<Directory "/home/prmonitor/www">
....
AllowOverride All
...
</Directory>
.........
DirectoryIndex index.html index.htm index.php
3. mariadb 설정
# systemctl start mariadb
# mysql_secure_installationNOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
In order to log into MariaDB to secure it, we'll need the current
password for the root user. If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.
Enter current password for root (enter for none): Enter
OK, successfully used password, moving on...
Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.
Set root password? [Y/n] Y (root 패스워드 변경)
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
... Success!
By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment.
Remove anonymous users? [Y/n] Enter
... Success!
Normally, root should only be allowed to connect from 'localhost'. This
ensures that someone cannot guess at the root password from the network.
Disallow root login remotely? [Y/n] Enter
... Success!
By default, MariaDB comes with a database named 'test' that anyone can
access. This is also intended only for testing, and should be removed
before moving into a production environment.
Remove test database and access to it? [Y/n] Enter
- Dropping test database...
... Success!
- Removing privileges on test database...
... Success!
Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.
Reload privilege tables now? [Y/n] Enter
... Success!
Cleaning up...
All done! If you've completed all of the above steps, your MariaDB
installation should now be secure.
Thanks for using MariaDB!
MariaDB [(none)]> status;
--------------
mysql Ver 15.1 Distrib 10.3.17-MariaDB, for Linux (x86_64) using readline 5.1
Connection id: 17
Current database:
Current user: root@localhost
SSL: Not in use
Current pager: stdout
Using outfile: ''
Using delimiter: ;
Server: MariaDB
Server version: 10.3.17-MariaDB MariaDB Server
Protocol version: 10
Connection: Localhost via UNIX socket
Server characterset: latin1
Db characterset: latin1
Client characterset: utf8
Conn. characterset: utf8
UNIX socket: /var/lib/mysql/mysql.sock
Uptime: 8 min 36 sec
Threads: 7 Questions: 21 Slow queries: 0 Opens: 17 Flush tables: 1 Open tables: 11 Queries per second avg: 0.040
--------------
# vim /etc/my.cnf.d/mariadb-server.cnf
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
log-error=/var/log/mariadb/mariadb.log
pid-file=/run/mariadb/mariadb.pid
character-set-server = utf8
collation-server = utf8_general_ci
MariaDB [(none)]> status
--------------
mysql Ver 15.1 Distrib 10.3.17-MariaDB, for Linux (x86_64) using readline 5.1
Connection id: 8
Current database:
Current user: root@localhost
SSL: Not in use
Current pager: stdout
Using outfile: ''
Using delimiter: ;
Server: MariaDB
Server version: 10.3.17-MariaDB MariaDB Server
Protocol version: 10
Connection: Localhost via UNIX socket
Server characterset: utf8
Db characterset: utf8
Client characterset: utf8
Conn. characterset: utf8
UNIX socket: /var/lib/mysql/mysql.sock
Uptime: 14 sec
Threads: 7 Questions: 4 Slow queries: 0 Opens: 17 Flush tables: 1 Open tables: 11 Queries per second avg: 0.285
--------------
4. php 설정
# vi /etc/php.ini
error_reporting = E_ALL & ~E_NOTICE
display_errors = on
short_open_tag = on
date.timezone = Asia/Seoul
5. 서비스 시작 및 자동시작 설정
# systemctl start httpd
# systemctl start mariadb
# systemctl enable httpd
# systemctl enable mariadb
6. APM 버전 보기
[prmonitor@test ~]$ httpd -v
Server version: Apache/2.4.37 (centos)
Server built: Dec 23 2019 20:45:34
[prmonitor@test ~]$ php -v
PHP 7.2.11 (cli) (built: Oct 9 2018 15:09:36) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
[prmonitor@test ~]$ mysql -V
mysql Ver 15.1 Distrib 10.3.17-MariaDB, for Linux (x86_64) using readline 5.1
6. Selinux 설정
# chcon -R -t httpd_user_content_t /home/prmonitor/www
# chcon -R -t httpd_sys_content_t /home/prmonitor/www
'Linux' 카테고리의 다른 글
firewalld (0) | 2020.07.17 |
---|---|
CentOS 8 에 Visual Studio Code (vs code) 설치 (0) | 2020.03.10 |
Centos7 하드디스크 추가하기 (0) | 2020.03.06 |
Centos 8 설치 및 셋팅 (0) | 2020.03.06 |
CentOS 7, 8 iptables 사용하기 (0) | 2020.02.24 |