#uname -a
하시면 됩니다.
Linux kkamagi2 2.6.18-8.1.15.el5 #1 SMP Mon Oct 22 08:32:04 EDT 2007 i686 i686 i386 GNU/Linux
32bit시에 위와 같이 뜨고..
64bit시에는.
x86 64로 나올 꺼예요
#uname -a
하시면 됩니다.
Linux kkamagi2 2.6.18-8.1.15.el5 #1 SMP Mon Oct 22 08:32:04 EDT 2007 i686 i686 i386 GNU/Linux
32bit시에 위와 같이 뜨고..
64bit시에는.
x86 64로 나올 꺼예요
$ find . -name “b*” -exec rm -rf {} \;
현재 디렉토리(.) 하부에 b로 시작하는 파일은 모두 삭제하라
$ find . -name “*” -exec rm -rf {} \;
이렇게 하면 현재 폴더하부모든파일 및 폴더 삭제
-atime : 파일을 열어본 시간 또는 디렉토리에 cd 명령으로 접근한 시간
-mtime : 파일의 내용이 변경된 시간 ls -l 에서 나오는 시간
-ctime : 파일의 정보가 변경된 시간 chmod chown과 연관성이 있음
우리가 보통 사용하는 단위는 ls로 보기때문에 mtime 이 맞다.
find . -mtime +15 -exec rm -rf {} \;
이건 어떻게 될까요?
15일이 지난 현재폴더하부 파일 및 폴더 모두 삭제
기준은 ls -al 했을때 시간을 기준으로 한다.
rm 으로 지울경우, 파일이 많아서 잘 안지워지는데 이렇게 하면 모두 삭제됩니다.
특히 /tmp 파일에 수천개가 존재하면
cd /tmp
$ find . -name “sess_*” -exec rm -rf {} \;
이런식으로 지우게 되죠
(주)웹호스트 https://www.webhost.co.kr
작성일 : 2008년 10월6일
vi color
vi로 파일을 열때 특정 option이 자동수행되게 하려면 ~/.vimrc에 option을 미리 지정하면 됩니다.
예를들어, 라인번호가 항상 나오게 하려면 set number 라는걸 ~/.vimrc에 넣어놓으면 됩니다.
색깔 지정하는걸 Syntax Highlighting이라 하는데 :syntax on 하여 색상이 나오지 않으면 vi가 다 설치되지 않은것입니다.
root로 로긴 후
# rpm -qa | grep vim-enhanced
라 하여 아무것도 나오지 않으면 vim-enhanced를 설치해 주어야 합니다.
현시스템에 인스톨 되어 있는 목록
[root@roomie001 install]# rpm -qa |grep vim
vim-enhanced-6.3.046-0.40E.7
vim-common-6.3.046-0.40E.7
vim-minimal-6.3.046-0.40E.7
vim-X11-6.3.046-0.40E.7
http://www.rpmfind.net <= 여기 가서 알맞는 버젼을 찾아보십시오.
설치 완료후엔 재접속 하십시오.^^;
컬러설정 확인
※ 컬러 설정을 했을때 컬러부분의 문장에 언더라인으로 표시되는것은 화면이 흑백으로 인식하고 있는경우 발생.
1. 터미널 환경
터미널 타입이 xterm이나 vt100 으로 설정되어 있을것.
# echo $TERM 명령으로 화면의 설정상태확인후
# setenv TERM xterm-color 또는
# TERM=xterm-color; export TERM
명령으로 터미널을 컬러로 설정해 준다.
2. profile환경
vi명령으로 기동시 vim명령이 실행되도록 alias 추가.
alias vi=vim
3. .vimrc 환경파일 확인
syntax on <- 문장이 있는지 확인.
[출처] vi에서 색깔 설정하기(vim)|작성자 honda20000
bind-9.3.6-4.P1.el5_4.2 설치
yum -y install bind\* 하시면 bind에 대한건 다 설치합니다.
또는
# yum -y install bind bind-libs ypbind yp-tools bind-utils bind-chroot bind-devel
하세요.
yum -y install caching-nameserver 설치하면 설정 파일이 생성됩니다.
2개 명령으로 설치 완료 입니다^^
외부 포트허용
# iptables -A INPUT -p tcp -m tcp –sport 53 -j ACCEPT
# iptables -A INPUT -p tcp -m udp –sport 53 -j ACCEPT
vi /etc/named.caching-nameserver.conf 화일을 열어서 몇가지 수정해주면 됩니다.
options {
listen-on port 53 { 127.0.0.1; }; >> listen-on port 53 { any; };
listen-on-v6 port 53 { ::1; };
directory “/var/named”;
dump-file “/var/named/data/cache_dump.db”;
statistics-file “/var/named/data/named_stats.txt”;
memstatistics-file “/var/named/data/named_mem_stats.txt”;
// Those options should be used carefully because they disable port
// randomization
// query-source port 53; << 주석 없애기 query-source port 53;
// query-source-v6 port 53; << 주석 없애기 query-source-v6 port 53;
allow-query { localhost; }; >> allow-query { any; };
allow-query-cache { localhost; };
};
// 로그파일 쌓이는것이 필요없으신분은 logging 부분 전부를 주석처리하면됩니다.
logging {
channel default_debug {
file “data/named.run”;
severity dynamic;
};
};
view localhost_resolver {
match-clients { localhost; }; >> match-clients { any; };
match-destinations { localhost; }; >> match-destinations { any; };
recursion yes; >> recursion no;
include “/etc/named.rfc1912.zones”;
};
저장하고 vi /etc/named.rfc1912.zones 열어서 설정합니다.
설정되어 있는 값들은 건들지 마시고 맨 아래줄에 추가합니다.
여기서 자신의 IP를 반대로 적으면됩니다.
112.175.232.xxx 였다면 아래와 같이 적으면됩니다. file명을 알아서.rev로 만드세요.
zone “232.175.112.in-addr.arpa” IN { type master; file “xxkr.com.rev”; allow-update { none; }; };
호스트네임으로 사용하는 도메인을 잴 먼저 적습니다.
in이 들어가 있는것이 다름니다.
zone “xxkr.com” IN { type master; file “196.zone”; allow-update { none; }; };
다음줄부터는 사용할 도메인을 쭉~ 적어 넣으면됩니다.
ah.to도메인을 설정할때 아래와 같이 합니다.
zone “ah.to”{ type master; file “xx2.zone”; allow-update { none; }; };
이제 cd /var/named/chroot/var/named 로 이동해서 위에적었던 파일을 생성해 주면 끝나요.
vi xxkr.com.rev 안에 내용에 아래와 같이 적으면됩니다.
앞에 숫자는 위에서 IP 꺼꾸로 적고 맨마지막건 안적었는데 여기에 넣으면됩니다.
165 IN PTR xx.xxkr.com. 이렇게요.
== 카피할 부분 ==
$TTL 86400
@ IN SOA xx2.xxkr.com. root.xxkr.com. (
31 ; serial
3H ; refresh
15M ; retry
1W ; expire
1D ; Minimun
)
IN NS xx.xxkr.com
IN NS xx2.xxkr.com.
IN NS ns.ssanhost.com.
IN NS ns1.ssanhost.com.
localhost IN A 127.0.0.1
165 IN PTR xx.xxkr.com.
167 IN PTR xx2.xxkr.com.
165 IN PTR ns.ssanhost.com.
167 IN PTR ns1.ssanhost.com.
저장하고 나와서 위에 file 에 적인 vi xx2.zone 해서 아래와 같이 만듭니다.
$TTL 14400
@ IN SOA xx2.xxkr.com. root.xxkr.com. (
23 ; serial
3H ; refresh
15M ; retry
1W ; expire
1D ; Minimun
)
IN NS xx.xxkr.com.
IN NS xx2.xxkr.com.
IN MX 10 mail
;
@ IN A 114.108.132.211
xx IN A 112.175.232.165
xx2 IN A 114.108.132.211
www IN A 114.108.132.211
* IN A 114.108.132.211
저장하고
chown root:named * 꼭해주세요.
/etc/init.d/named restart 엔터하면 설치가 끝났습니다.
dig 로 작동여부 확인
# dig 도메인
버전확인
# dig @ns.rain.iss txt version.bind
1. /etc/named.conf
options {
directory “/var/named”;
};
controls {
inet 127.0.0.1 port 953 allow { localhost; } keys { rndckey; };
};
zone “.” {
type hint;
file “named.ca”;
};
zone “0.0.127.in-addr-arpa” {
type master;
file “named.local”;
};
zone “webhost.co.kr” {
type slave;
file “webhost.zone”;
masters {
110.45.100.2; //마스터 ip address
};
};
include “/etc/rndc.key”;
2. named.local 과 named.ca 준비
/var/named
named.local
named.ca
3. 1차네임서버에서 2차서버 ip 허용
vi named.conf
controls {
inet 127.0.0.1 port 953 allow { localhost; 110.45.100.3; } keys { rndckey; };
};
110.45.100.3 은 2차네임서버이다.
4. 2차네임서버 구동후 존파일생성 확인
bind 소스받기
https://www.isc.org/
상단첫번째 DOWNLOADS > BIND 에서 최신버전 tar.gz 다운로드
1. 파일 다운로드 받고 컴파일 하기
# gzip -dc bind-9.3.0.tar.gz | tar xvf –
# cd bind-9.3.0
# ./configure
# make
# make install
2. /etc/rndc.key 생성하기
solaris10[/bind/bin/rndc] # ./rndc-confgen -a -k rndckey
solaris10[/bind/bin/rndc] # cat /etc/rndc.key
# Start of rndc.conf
key “rndckey” {
algorithm hmac-md5;
secret “Y9iC3cahZ7I3+3NrtlG6nQ==”;
};
생성 끝.
3. /etc/named.conf 구성하기
======================================================
vi /etc/named.conf
// generated by named-bootconf.pl
options {
directory “/var/named”;
/*
* If there is a firewall between you and nameservers you want
* to talk to, you might need to uncomment the query-source
* directive below. Previous versions of BIND always asked
* questions using port 53, but BIND 8.1 uses an unprivileged
* port by default.
*/
//query-source address * port 53;
};
controls {
inet 127.0.0.1 port 953 allow { localhost; } keys { rndckey; };
};
zone “.” {
type hint;
file “named.ca”;
};
zone “domain.co.kr” {
type master;
file “primary/domain.zone”;
allow-update { none; };
};
(중략) 같은 도메인들 리스트추가
include “/etc/rndc.key”;
끝
4. bind 구동
/usr/local/sbin/named
에러가날경우
cd /usr/local/sbin
./named-checkconf 로 확인할것
5.rndc 구동하기
/bind/bin/rndc/#rndc reload
를 수행하여 rndc를 구동할 수 있다. 이 때 named는 반드시 구동되어 있어야 한다.
6. 장애 처리 하기
#tail -f /var/adm/messages
이상 소스로 bind설치끝
rocky linux8 ssh 에서 한국어 언어설정입니다.
# vim /etc/locale.conf
LANG=”ko_KR.UTF8″
저장후
# source /etc/locale.conf
또는 서버 reboot
설정확인하기
# localectl status
System locale: LANG=ko_KR.UTF8
VC keymap: us
X11 Layout: us
#
작성일자 : 2025.03.20
OS 종류 및 버전에 따라 설치방법이 조금씩 다릅니다.
본 내용은 Rocky Linux 8.x 에서 설치하는 방법을 다루었습니다.
1. 패키지 다운로드
# dnf -y install epel-release mod_ssl
# dnf -y install certbot python3-certbot-apache
2. 발급
# certbot –apache
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Enter email address (used for urgent renewal and security notices)
(Enter ‘c’ to cancel): (이메일 주소 입력)
– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –
Please read the Terms of Service at
https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017-w-v1.3-notice.pdf.
You must agree in order to register with the ACME server. Do you agree?
– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –
(Y)es/(N)o: Y
– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –
Would you be willing, once your first certificate is successfully issued, to
share your email address with the Electronic Frontier Foundation, a founding
partner of the Let’s Encrypt project and the non-profit organization that
develops Certbot? We’d like to send you email about our work encrypting the web,
EFF news, campaigns, and ways to support digital freedom.
– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –
(Y)es/(N)o: Y
Account registered.
Which names would you like to activate HTTPS for?
– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –
1: www.sysdocu.com
2: sub.sysdocu.com
3: test.sysdocu.com
– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –
Select the appropriate numbers separated by commas and/or spaces, or leave input
blank to select all options shown (Enter ‘c’ to cancel): 1 2 // virtualhost 설정을 가져와 도메인을 출력합니다. 발급 원하는 도메인을 공백으로 구분하여 입력합니다. 통합 인증서가 아닌, 개별 인증서로 발급 받게 됩니다.
Requesting a certificate for www.sysdocu.com and sub.sysdocu.com
Successfully received certificate.
Certificate is saved at: /etc/letsencrypt/live/www.sysdocu.com/fullchain.pem
Key is saved at: /etc/letsencrypt/live/www.sysdocu.com/privkey.pem
This certificate expires on 2022-12-04.
These files will be updated when the certificate renews.
Certbot has set up a scheduled task to automatically renew this certificate in the background.
Deploying certificate
Successfully deployed certificate for www.sysdocu.com to /etc/httpd/conf/httpd-le-ssl.conf
Successfully deployed certificate for sub.sysdocu.com to /etc/httpd/conf/httpd-le-ssl.conf
Congratulations! You have successfully enabled HTTPS on https://www.sysdocu.com and https://sub.sysdocu.com
– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –
If you like Certbot, please consider supporting our work by:
* Donating to ISRG / Let’s Encrypt: https://letsencrypt.org/donate
* Donating to EFF: https://eff.org/donate-le
– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –
아래 파일이 생성되면서 아파치 SSL 설정이 자동으로 이루어졌습니다.
> /etc/httpd/conf/httpd-le-ssl.conf
설정에 이상이 없는지 확인 후 아파치를 재시작 해줍니다.
# apachectl configtest
Syntax OK
# systemctl restart httpd
이제 https:// 프로토콜을 이용해 웹페이지 접근이 가능해졌습니다.
3. 자동 갱신 설정
발급된 인증서 유효기간은 3개월이며, 만료 1개월 전부터 갱신이 가능합니다.
자동으로 발급받아질 수 있게 crontab 에 등록해 줍니다. (2개월에 한번씩 1일, 16일에 체크하여 갱신)
# vi /etc/crontab
01 00 01,16 */2 * root /usr/sbin/certbot renew

무료 SSL Let’s encrypt certbot 설치하는 방법 – Linux CentOS
1. 서버 설치하기 : 소스설치
~]# cd /usr/local
~]# yum install epel-release
~]# rpm -ivh https://rhel6.iuscommunity.org/ius-release.rpm
~]# yum install git python27 python27-devel python27-pip python27-setuptools python27-virtualenv python27-libs
~]# git clone https://github.com/certbot/certbot


실행하기)
~]# cd /usr/local/certbot
~]# /usr/local/certbot/certbot-auto certonly
오류가 난다면)
~]# chattr -i /usr/bin/gcc /usr/bin/g++
이렇게 한 후 실행하고나서
~]# chmod 700 /usr/bin/gcc /usr/bin/g++;chattr +i /usr/bin/gcc /usr/bin/g++
원복시키기
2. 도메인 SSL 얻기
~]# ./certbot-auto certonly –server https://acme-v01.api.letsencrypt.org/directory \
–rsa-key-size 4096 –agree-tos –email 당신의@이메일 \
–webroot -w /home/계정이름/public_html/ \
여기에서 수정해야 할 사항
1) 당신의@이메일 : 도메인등록시 사용한 이메일을 기록한다.
2) webroot : /home/계정이름/public_html/ 수정할것
3) 도메인명 : www.mydomain.com 나의 도메인 입력할 것
이렇게 실행하면, 총 4개의 파일이 생성된다.
/etc/letsencrypt/live/www.mydomaidn.com/ 폴더아래 생성된다.
—
-agree-tos : ACME 서버에 가입자 동의서에 동의함
-w : 웹 도메인의 루트패스
-m : 이메일주소
-d : SSL 발급 도메인명, 여러개를 한칸 뛰우고 나열해도 됨.
주의) 하나의 도메인(같은 이름)에 대해서 1일 3회이상 발급테스트시 발급이 일시 제한됨.
—
3. SSL 설정하기 – 아파치 apache
cd /etc/httpd/conf.d
vi ssl.conf
—
<VirtualHost *:443>
ErrorLog logs/ssl_error_log
TransferLog logs/ssl_access_log
LogLevel warn
SSLEngine on
SSLProtocol all -SSLv2
SSLCipherSuite DEFAULT:!EXP:!SSLv2:!DES:!IDEA:!SEED:+3DES
SSLCertificateFile /etc/letsencrypt/live/www.mydomain.com/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/www.mydomain.com/privkey.pem
SSLCertificateChainFile /etc/letsencrypt/live/www.mydomain.com/chain.pem
SSLCACertificateFile /etc/letsencrypt/live/www.mydomain.com/fullchain.pem
DocumentRoot /home/폴더명/public_html
ServerName www.mydomain.com
</VirtualHost>
—
위에 내용을 참고해서 기존에 내용과 비교한 다음 적절하게 부분 수정할 것.
기존에 유료 SSL 을 이 무료 SSL 로 교체를 원할 경우 :
ssl.conf 에서 기존에 사용하던 코드 삭제하고 위 내용으로 수정하면 SSL 교체되어 정상 동작함.
그런후
service httpd restart 하면 됨. 별도의 비밀번호 없음.
주의) 443 포트 방화벽에서 막았을 경우 풀어줄 것.
기존 SSL 교체완료
4. 인증서 자동갱신하기
4-1) 테스트해보기
/usr/local/certbot/certbot-auto renew –dry-run
테스트하면 성공여부가 나온다. 실제로 갱신은 안됨
4-2) 실제 동작시켜보기
/usr/local/certbot/certbot-auto renew
실제 동작시키면 아직 기간이 안되었다는 문구가 나오고 종료됨
4-3) cron 에 등록하여 자동으로 갱신시키기
vi /etc/crontab
00 8 1 * * root /usr/local/certbot/certbot-auto renew >> /var/log/ssl-renew.log
—
service crond restart
—
이 경우 매월1일 8:00 분에 모든 SSL 인증서를 판단하고 자동으로 갱신시킨다.
결과는 /var/log/ssl-renew.log 에 기록된다.
—
4-4) 인증서 삭제
—
발급된 인증서의 삭제는 certbot-auto 명령을 이용하여 삭제해야 추후 다시 발급할 수 있으며,
인증서 삭제명령후 인증서가 생성되었던 경로등을 확인해보면, 삭제한 도메인의 폴더가
삭제된 것을 확인할 수 있습니다.
~#> /usr/local/certbot/certbot-auto delete -cert-name www.myadomin.com
—
종합
—
SSL인증서는 대부분 유료입니다.
무료 SSL 중에 Amazon AWS SSL 인증서는 무료이지만 실제 설치하면
SSL인증서를 연결하는 부분은 모두 유료서비스라서 결국 유료입니다.
AWS SSL 을 아파치서버와 연결할 방법이 없기때문에 Amazon에서 제공하는
Route53 이라는 DNS 관리툴로 연결을 해야 하는데,
이 route53은 유료서비스입니다. 존파일에 갯수에 따라서 비용이 매월 나갑니다.
그리고 이 route53으로 도메인을 설정했다면,
내 도메인과 웹으로 연결시키기 위해서 CloudFront 서비스를
추가로 신청해야 합니다. CloudFront 를 신청하면,
기존에 www.mydomain.com 을 이 CloudFront 에서 지정한 80포트와 443포트(https)로
연결시켜서 https SSL서비스가 동작하게 됩니다.
문제는 아마존 CloudFront 역시 월 비용이 발생합니다.
사용량에 따라서 발생하기때문에 부담이 되는 관리비용입니다.
결국 아마존 무료 SSL 서비스는 실제 동작시키려면 아마존에 다른 유료서비스를
이용해야 가능하고, 도메인도 아마존으로 DNS를 옮겨서 이용해야 하는
불편함이 생깁니다. 아마존 SSL 이외에 모든 서비스는 유료이고 매월 비용이 카드로 지불됩니다.
결국 아마존 무료 SSL 서비스는 유료서비스입니다. 대신에 아마존 AWS 서비스가
비교적 저렴하기때문에 나중에 사용자가 늘어나면 이용해보는것도 좋습니다.
아마존 CloudFront 서비스같은경우는 Ddos방어는 기본으로 제공되기때문에 보안등을 생각한다면
무료 SSL과 이런 유료 서비스를 결합해서 내 도메인 DNS를 아예 아마존으로 옮겨서
서비스받는것도 좋은 방식입니다. 또한 로드밸런싱서비스도 간단하고 쉽게 제공받을 수 있습니다.
그러나, SSL만 필요한 경우라면 아마존 AWS서비스에 추가 매월 비용을 부담할 필요가 없습니다.
무료로 이 인증서를 내 서버에 설치하고 운영하는게 제일 좋은 방법입니다.
이 인증서는 Let’s Encrypt 라는 무료 SSL 인증서로
wordpress 제작사등 많은 IT업계에 투자가 있어 비교적 안정된 인증서입니다.
위에 방법대로 나의 리눅스 서버에서
이렇게 쉽게 SSL을 무료로 설치가능합니다.
또한 3개월의 만료기간을 자동으로 연장시키기때문에 계속 무료로 쓸 수 있습니다.
적용환경
—
CentOS6
제공사이트 : https://certbot.eff.org/
이 사이트에서 O/S별로 설치문서가 쉽게 제공중이기때문에 편리하게 설치가능합니다.
작성일자 : 2018.12.24
mysql 5.1 to 5.7 upgrade 방법입니다.
우선 해 본결과 간단히 소개부터 하면
1) 중요한 데이터라면 우선 백업을 하고 이 작업을 하세요.
– 데이터가 다 날라갈 수 있습니다.
2) 중요하지 않다면 그냥 진행하세요.
– 잘 따라하면 데이터는 전혀 소실되지 않고 업데이트됩니다.
3) 5.1과 5.7이 user테이블이 달라서 업그레이드후에는 접속에러가 납니다.
– 아래 절차대로 진행해서 스키마 업그레이드를 해 준후부터 정상적으로 됩니다.
—
이제 mysql 5.1 to 5.7 upgrade 입니다.
1. yum repository 추가
참고: http://fsteam.tistory.com/94
http://dev.mysql.com/downloads/repo/yum/
여기서 redhat linux6/oraclue linux 6 용 다운로드 – 가입하고 다운로드가능
2. rpm설치
yum localinstall mysql-community-release-el6-5.noarch.rpm
3. mysql 5.7 설치
yum install mysql-server
끝
—
문제는접속에러가 발생함
—
해결하기
1) mysql 죽이기
ps -ax | grep mysql
해서
kill -9 프로세서 번호
이렇게 mysql 로 시작하는 프로세서는 모두 죽인다.
2) 강제로 mysql 구동
mysqld_safe –skip-grant-tables &
3) root 로그인
mysql
root 로는 로그인됨 확인
빠져나온다. exit
4) 강제로 업그레이드
쉘상에서
mysql_upgrade -u root –force
이 경우 필드를 5.7용으로 강제로 업그레이드를 스스로 진행함
service mysqld stop
service mysqld start
성공함
이것이 잘 안되면 ps -ax|grep mysql 해서 구동중인 mysql 은 모두 중단하고 진행할 것 (위에 줄 참고)
5) 다시 root 접속
성공
끝
5) 이제 다시 구동
결과)
모든 페이지가 정상적으로 되었고
phpinfo 에서 보면 mysql 5.7로 업그레이드 성공함
작성일자 : 2017.09.01