작은숲:위키노트/CentOS 설정: 두 판 사이의 차이
보이기
잔글 문자열 찾아 바꾸기 - "<source" 문자열을 "<syntaxhighlight" 문자열로 |
잔글 Utolee90님이 CentOS 설정 문서를 작은숲:위키노트/CentOS 설정 문서로 이동했습니다: 제목 변경 |
||
| (같은 사용자의 중간 판 3개는 보이지 않습니다) | |||
| 1번째 줄: | 1번째 줄: | ||
[[위키노트 | [[작은숲:위키노트/CentOS|CentOS]]를 새로 설치하고 나서 기본 설정. | ||
== 시스템 및 데몬 설정 == | == 시스템 및 데몬 설정 == | ||
=== 호스트 네임 설정 === | === 호스트 네임 설정 === | ||
| 7번째 줄: | 7번째 줄: | ||
HOSTNAME=green.example.com | HOSTNAME=green.example.com | ||
... | ... | ||
</ | </syntaxhighlight> | ||
<code>/etc/hosts</code> | <code>/etc/hosts</code> | ||
<syntaxhighlight lang="cfg"> | <syntaxhighlight lang="cfg"> | ||
| 14번째 줄: | 14번째 줄: | ||
218.0.0.17 red red.example.com | 218.0.0.17 red red.example.com | ||
218.0.0.18 white white.example.com | 218.0.0.18 white white.example.com | ||
</ | </syntaxhighlight> | ||
=== 시작 데몬 설정 === | === 시작 데몬 설정 === | ||
<syntaxhighlight lang="console"> | <syntaxhighlight lang="console"> | ||
# ntsysv | # ntsysv | ||
</ | </syntaxhighlight> | ||
=== sshd 설정 === | === sshd 설정 === | ||
<code>/etc/ssh/sshd_config</code> | <code>/etc/ssh/sshd_config</code> | ||
| 25번째 줄: | 25번째 줄: | ||
PermitRootLogin no | PermitRootLogin no | ||
... | ... | ||
</ | </syntaxhighlight> | ||
<syntaxhighlight lang="console"> | <syntaxhighlight lang="console"> | ||
# service sshd restart | # service sshd restart | ||
</ | </syntaxhighlight> | ||
=== [[위키노트 | === [[작은숲:위키노트/Iptables|Iptables] 설정 === | ||
<code>/etc/sysconfig/iptables</code> | <code>/etc/sysconfig/iptables</code> | ||
<syntaxhighlight lang="cfg"> | <syntaxhighlight lang="cfg"> | ||
| 54번째 줄: | 54번째 줄: | ||
-A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited | -A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited | ||
... | ... | ||
</ | </syntaxhighlight> | ||
<syntaxhighlight lang="console"> | <syntaxhighlight lang="console"> | ||
# service iptables restart | # service iptables restart | ||
</ | </syntaxhighlight> | ||
=== NTP 설치 및 설정 === | === NTP 설치 및 설정 === | ||
<syntaxhighlight lang="console"> | <syntaxhighlight lang="console"> | ||
# yum install ntp | # yum install ntp | ||
</ | </syntaxhighlight> | ||
<code>/etc/ntp.conf</code> | <code>/etc/ntp.conf</code> | ||
<syntaxhighlight lang="cfg"> | <syntaxhighlight lang="cfg"> | ||
| 68번째 줄: | 68번째 줄: | ||
server ntp.postech.ac.kr | server ntp.postech.ac.kr | ||
server ntp.xbsd.kr | server ntp.xbsd.kr | ||
</ | </syntaxhighlight> | ||
<syntaxhighlight lang="console"> | <syntaxhighlight lang="console"> | ||
# ntpdate kr.pool.ntp.org | # ntpdate kr.pool.ntp.org | ||
| 74번째 줄: | 74번째 줄: | ||
# chkconfig ntpd on | # chkconfig ntpd on | ||
# ntpq -p | # ntpq -p | ||
</ | </syntaxhighlight> | ||
=== [[위키노트:MySQL|MySQL]] 설치 및 설정 === | === [[위키노트:MySQL|MySQL]] 설치 및 설정 === | ||
<syntaxhighlight lang="console"> | <syntaxhighlight lang="console"> | ||
| 81번째 줄: | 81번째 줄: | ||
# cp /usr/share/mysql/my-huge.cnf /etc/my.cnf | # cp /usr/share/mysql/my-huge.cnf /etc/my.cnf | ||
# vi /etc/my.cnf | # vi /etc/my.cnf | ||
</ | </syntaxhighlight> | ||
<syntaxhighlight lang="cfg"> | <syntaxhighlight lang="cfg"> | ||
[client] | [client] | ||
| 101번째 줄: | 101번째 줄: | ||
default-character-set = utf8 | default-character-set = utf8 | ||
... | ... | ||
</ | </syntaxhighlight> | ||
<syntaxhighlight lang="console"> | <syntaxhighlight lang="console"> | ||
# service mysqld start | # service mysqld start | ||
| 107번째 줄: | 107번째 줄: | ||
# service mysqld restart | # service mysqld restart | ||
# mysql -u root -p mysql | # mysql -u root -p mysql | ||
</ | </syntaxhighlight> | ||
<syntaxhighlight lang="mysql"> | <syntaxhighlight lang="mysql"> | ||
CREATE DATABASE something; | CREATE DATABASE something; | ||
GRANT ALL PRIVILEGES ON something.* TO 'someone'@'%' IDENTIFIED BY 'anything' WITH GRANT OPTION; | GRANT ALL PRIVILEGES ON something.* TO 'someone'@'%' IDENTIFIED BY 'anything' WITH GRANT OPTION; | ||
FLUSH PRIVILEGES; | FLUSH PRIVILEGES; | ||
</ | </syntaxhighlight> | ||
== 같이 보기 == | == 같이 보기 == | ||
* [[Postfix]] | * [[Postfix]] | ||
* [[Yum 저장소 설정]] | * [[Yum 저장소 설정]] | ||
* [[위키노트 | * [[작은숲:위키노트/Quota 설정]] | ||
* [[iptables 설정]] | * [[iptables 설정]] | ||
* [[위키노트 | * [[작은숲:위키노트/Bind 설정|Bind 설정] | ||
{{리눅스}} | {{리눅스}} | ||
[[분류:위키노트/공유]] | [[분류:위키노트/공유]] | ||
| 124번째 줄: | 124번째 줄: | ||
[[분류:시스템 도구]] | [[분류:시스템 도구]] | ||
[[분류:위키노트/소프트웨어 설정]] | [[분류:위키노트/소프트웨어 설정]] | ||
[[분류:소프트웨어 설치]]{{퍼온문서|위키노트|{{#invoke:string|replace|{{PAGENAME}}|위키노트:|}}}}[[분류:위키노트에서 가져온 문서]] | [[분류:위키노트/소프트웨어 설치]]{{퍼온문서|위키노트|{{#invoke:string|replace|{{PAGENAME}}|위키노트:|}}}}[[분류:위키노트에서 가져온 문서]] | ||
2022년 5월 7일 (토) 14:53 기준 최신판
CentOS를 새로 설치하고 나서 기본 설정.
시스템 및 데몬 설정
호스트 네임 설정
/etc/sysconfig/network
...
HOSTNAME=green.example.com
.../etc/hosts
218.0.0.15 black black.example.com
218.0.0.16 green green.example.com
218.0.0.17 red red.example.com
218.0.0.18 white white.example.com시작 데몬 설정
# ntsysvsshd 설정
/etc/ssh/sshd_config
...
PermitRootLogin no
...# service sshd restart[[작은숲:위키노트/Iptables|Iptables] 설정
/etc/sysconfig/iptables
...
-A RH-Firewall-1-INPUT -m state --state INVALID -j DROP
...
# sshd
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp -s 218.0.0.15 --dport 22 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp -s 218.0.0.16 --dport 22 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp -s 218.0.0.17 --dport 22 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp -s 218.0.0.18 --dport 22 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j DROP
# domain, rndc
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 53 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m udp -p udp --dport 53 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 953 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m udp -p udp --dport 953 -j ACCEPT
# mysqld
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT
# block heavy requests
-A RH-Firewall-1-INPUT -m recent --update --seconds 600 --name TOO_MANY_REQUESTS -j DROP
-A RH-Firewall-1-INPUT -m hashlimit --hashlimit 10/s --hashlimit-burst 24 --hashlimit-mode srcip --hashlimit-name HTTP_REQ_LIMIT -j ACCEPT
-A RH-Firewall-1-INPUT -m recent --set --name TOO_MANY_REQUESTS -j DROP
-A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited
...# service iptables restartNTP 설치 및 설정
# yum install ntp/etc/ntp.conf
...
server kr.pool.ntp.org
server ntp.postech.ac.kr
server ntp.xbsd.kr# ntpdate kr.pool.ntp.org
# service ntpd start
# chkconfig ntpd on
# ntpq -pMySQL 설치 및 설정
# yum install mysql mysql-server mysql-connector-odbc mysql-devel
# mv /etc/my.cnf /etc/my.cnf-dist
# cp /usr/share/mysql/my-huge.cnf /etc/my.cnf
# vi /etc/my.cnf[client]
...
default-character-set = utf8
[mysqld]
...
thread_concurrency = 4
init_connect = SET collation_connection = utf8_general_ci
init_connect = SET NAMES utf8
default-character-set = utf8
character-set-server = utf8
collation-server = utf8_general_ci
[mysqldump]
...
default-character-set = utf8
[mysql]
...
default-character-set = utf8
...# service mysqld start
# mysqladmin -u root password 'password'
# service mysqld restart
# mysql -u root -p mysqlCREATE DATABASE something;
GRANT ALL PRIVILEGES ON something.* TO 'someone'@'%' IDENTIFIED BY 'anything' WITH GRANT OPTION;
FLUSH PRIVILEGES;같이 보기
- Postfix
- Yum 저장소 설정
- 작은숲:위키노트/Quota 설정
- iptables 설정
- [[작은숲:위키노트/Bind 설정|Bind 설정]
| 배포판 | |
|---|---|
| 서버 프로그램 | |
| 시스템 도구 | |
| 시스템 보안 | |
| 시스템 설정 | |
| HOWTO 문서 | |
| 사용자 설정 | |
| 활용 | |
| 명령어 | |