sed(stream editor)
Linux 텍스트 명령어 편집기 sed(stream editor)는 텍스트 파일이나 텍스트 스트림에서 텍스트를 편집할 수 있는 강력한 도구입니다. sed는 특히 Unix 계열 운영체제에서 널리 사용되며, 정규 표현식을 […]
Linux 텍스트 명령어 편집기 sed(stream editor)는 텍스트 파일이나 텍스트 스트림에서 텍스트를 편집할 수 있는 강력한 도구입니다. sed는 특히 Unix 계열 운영체제에서 널리 사용되며, 정규 표현식을 […]
remark : Tomcat8 특정 아이피만 허용 To allow access only for the clients connecting from localhost:
1 2 3 4 |
<Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="127\.\d+\.\d+\.\d+|::1|0:0:0:0:0:0:0:1"/> |
or
1 2 3 4 |
<Valve className="org.apache.catalina.valves.RemoteCIDRValve" allow="10.0.0.0/8, 127.0.0.1, ::1"/> |
To allow unrestricted access for the […]
Remark : SSL certificate 1. Install Let’s Encrypt client (Certbot)
1 2 3 4 |
# yum install epel-release # yum install certbot python2-certbot-apache mod_ssl |
2. Get an SSL Certificate
1 2 3 4 5 6 7 |
# sudo certbot --apache -d test.com -d www.test.com Or # sudo certbot --apache -d sub.test.com |
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 |
Saving debug log to /var/log/letsencrypt/letsencrypt.log Plugins selected: Authenticator apache, Installer apache Enter email address (used for urgent renewal and security notices) (Enter 'c' to cancel): admin@domain.com Starting new HTTPS connection (1): acme-v02.api.letsencrypt.org - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Please read the Terms of Service at https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf. You must agree in order to register with the ACME server at https://acme-v02.api.letsencrypt.org/directory - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - (A)gree/(C)ancel: A - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Would you be willing 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: N Starting new HTTPS connection (1): supporters.eff.org Obtaining a new certificate Performing the following challenges: http-01 challenge for domain.com Waiting for verification... Cleaning up challenges Created an SSL vhost at /etc/httpd/conf.d/domain.com-le-ssl.conf Deploying Certificate to VirtualHost /etc/httpd/conf.d/domain.com-le-ssl.conf |
1 2 3 4 5 6 7 8 9 10 |
Please choose whether or not to redirect HTTP traffic to HTTPS, removing HTTP access. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1: No redirect - Make no further changes to the webserver configuration. 2: Redirect - Make all requests redirect to secure HTTPS access. Choose this for new sites, or if you're confident your site works on HTTPS. You can undo this change by editing your web server's configuration. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Select the appropriate number [1-2] then [enter] (press 'c' to cancel): 1 |
2.1 delete SSL (필요시)
1 2 3 |
# sudo certbot delete --cert-name example.com |
3. […]
Remark: firewalld 은 zone 기준으로 세팅해보자 1. firewalld zone Check 2. zone add 2.1 zone delete 3. mysql-access 192.168.0.111 allow 4. mysql-access port=3306/tcp allow 5. firewall reload
1. 특정 IP 막기 2. firewall 적용 3. firewall 적용 확인 4. IP 풀기 4.1 firewall 적용
firewalld 기본설치 Remark: CentOS 에서 firewalld 가 기본적으로 설치 되어있습니다. 1. firewall Status Check 2. firewall reload 3. http 서비스를 추가합니다. 4. 시스템 재부팅 또는 […]
CentOS 열린포트 확인 remark : 열린포트 확인 해보기 netstat -tnlp
백업 : root 권한으로 백업 복원 : root 권한으로 복원 스케쥴 걸기 : sql.sh 파일을 만들어 crontab 에 세팅 등록 내용 설정 분,시,일,월,요일, 실행명령 순으로 […]
일반적인 보안 Ping 막기 iptable 세팅 ssh 포트변경 ftp 특정 IP 만 허용 사이트세팅 로그확인
Remark : shell 의 종류 및 추가 쉽게 표현하면 윈도의 command.com(시작-실행-cmd)이 하는 역할처럼 login 이후부터 사용자가 입력하는 명령어를 기계어로 변역하여 커널에 전달하는 역할을 하는 명령어 […]
remark : 세팅 윈도우 와 비교 CentOS Setting Restart
1. 다운로드 : https://www.centos.org/download/ Cent OS가 버전 8을 끝으로 Stream으로 전환기본 CentOS가 기업용에서 각광받았던 이유는 유료 배포판인 RHEL OS에 Copy로써 안정감 때문에 사용했던것인데Stream으로 전환되면 오히려 […]
crontab을 이용한 디비백업 실행 파일을 만든다. 파일명:sql.sh
1 2 3 4 5 6 7 8 |
#!/bin/bash d=$(/bin/date +”%Y%m%d”) /usr/local/mysql/bin/mysqldump -uroot -p’패스워드’ 디비명 >/backup-sql/디비백업파일명.sql cp -Ruf /usr/local/mysql/data/db_young /backup-sql/ tar cvfpz /backup-sql/$d.young_sql.tar.gz /backup-sql/* mv /backup-sql/$d.young_sql.tar.gz /backup-full/ |
그리고
1 2 3 4 5 |
crontab -e 3 2 * * * /sql.sh |
1 2 3 |
yum install psmisc |
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 |
[root@localhost CoreTest]# yum install psmisc Loaded plugins: fastestmirror Determining fastest mirrors epel/x86_64/metalink | 5.6 kB * base: data.aonenetworks.kr * epel: mirrors.yun-idc.com * extras: data.aonenetworks.kr * updates: ftp-srv2.kddilabs.jp * webtatic: us-east.repo.webtatic.com base | 3.6 kB epel | 5.3 kB extras | 2.9 kB mariadb | 2.9 kB packages-microsoft-com-prod | 2.9 kB updates | 2.9 kB webtatic | 3.6 kB (1/7): extras/7/x86_64/primary_db | 159 kB (2/7): epel/x86_64/updateinfo | 1.0 MB epel/x86_64/primary_db FAILED https://mirrors.thzhost.com/epel/7/x86_64/repodata/1037dd5827f24f5fd5e12fb11504be3d944cf70be264e6f882c2c-primary.sqlite.bz2: [Errno 14] HT04 - Not Found Trying other mirror. To address this issue please refer to the below wiki article https://wiki.centos.org/yum-errors If above article doesn't help to resolve this issue please use https:os.org/. (3/7): mariadb/primary_db | 49 kB (4/7): epel/x86_64/primary_db | 6.9 MB (5/7): packages-microsoft-com-prod/primary_db | 10 MB (6/7): webtatic/x86_64/primary_db | 248 kB (7/7): updates/7/x86_64/primary_db | 6.7 MB Resolving Dependencies --> Running transaction check ---> Package psmisc.x86_64 0:22.20-16.el7 will be installed --> Finished Dependency Resolution Dependencies Resolved ===================================================================== Package Arch Version Repository ===================================================================== Installing: psmisc x86_64 22.20-16.el7 base Transaction Summary ===================================================================== Install 1 Package Total download size: 141 k Installed size: 475 k Is this ok [y/d/N]: y Downloading packages: psmisc-22.20-16.el7.x86_64.rpm | 141 kB Running transaction check Running transaction test Transaction test succeeded Running transaction Installing : psmisc-22.20-16.el7.x86_64 Verifying : psmisc-22.20-16.el7.x86_64 Installed: psmisc.x86_64 0:22.20-16.el7 Complete! |
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 98 99 100 101 102 103 104 105 106 |
* Ripmime 설치 -- 수동 설치 -- [root@localhost]#cd /usr/local/src [root@localhost]# wget https://dl.fedoraproject.org/pub/epel/6/x86_64/Packages/r/ripmime-1.4.0.9-2.el6.x86_64.rpm [root@localhost]# rpm -ivh ripmime-1.4.0.9-2.el6.x86_64.rpm [root@localhost]# cd /usr/src/redhat/SPECS [root@localhost]# rpmbuild -ba ripmime.spec [root@localhost]# cd /usr/src/redhat/RPMS/i386 [root@localhost]# rpm -Uvh ripmime* [간단 설치 비고] Download the latest epel-release rpm from https://dl.fedoraproject.org/pub/epel/6/x86_64/Packages/r/ripmime-1.4.0.9-2.el6.x86_64.rpm Install epel-release rpm: # rpm -Uvh epel-release*rpm Install ripmime rpm package: -- 자동 설치 * 추천 -- [root@ns1 src]# yum install ripmime Loaded plugins: fastestmirror, security Setting up Install Process Determining fastest mirrors epel/metalink | 6.2 kB 00:00 Could not retrieve mirrorlist http://rpms.remirepo.net/enterprise/6/remi/mirror error was 14: PYCURL ERROR 7 - "Failed to connect to 2001:bc8:33a1:100::1: Network is unreachable" * base: data.aonenetworks.kr * epel: mirror.premi.st * extras: data.aonenetworks.kr * remi: mirrors.thzhost.com * remi-safe: ftp.riken.jp * rpmforge: ftp.riken.jp * updates: data.aonenetworks.kr base | 3.7 kB 00:00 epel | 3.2 kB 00:00 epel/primary | 3.2 MB 00:00 epel 12522/12522 epel-httpd24 | 2.9 kB 00:00 extras | 3.4 kB 00:00 remi | 2.9 kB 00:00 remi/primary_db | 2.2 MB 00:05 remi-safe | 2.9 kB 00:00 remi-safe/primary_db | 1.0 MB 00:00 rpmforge | 1.9 kB 00:00 updates | 3.4 kB 00:00 updates/primary_db | 1.2 MB 00:09 Resolving Dependencies --> Running transaction check ---> Package ripmime.x86_64 0:1.4.0.9-2.el6 will be installed --> Finished Dependency Resolution Dependencies Resolved ================================================================================ Package Arch Version Repository Size ================================================================================ Installing: ripmime x86_64 1.4.0.9-2.el6 epel 83 k Transaction Summary ================================================================================ Install 1 Package(s) Total download size: 83 k Installed size: 201 k Is this ok [y/N]: y Downloading Packages: ripmime-1.4.0.9-2.el6.x86_64.rpm | 83 kB 00:00 Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction Installing : ripmime-1.4.0.9-2.el6.x86_64 1/1 Verifying : ripmime-1.4.0.9-2.el6.x86_64 1/1 Installed: ripmime.x86_64 0:1.4.0.9-2.el6 Complete! ------------------------------------------------------------------------------------------------------ * simscan 설치 [root@localhost]#cd /usr/local/src [root@localhost]#wget http://downloads.sourceforge.net/project/simscan/simscan/simscan-1.4.0/simscan-1.4.0.tar.gz [root@localhost]#wget https://notes.sagredo.eu/files/qmail/patches/simscan-1.4.0.patch [root@localhost]tar xvfz simscan-1.4.0.tar.gz [root@localhost]cd simscan-1.4.0 [root@localhost]patch -p1 < ../simscan-1.4.0.patch [root@localhost]useradd -r -g clamav -s /bin/false -c "Simscan - a qmail-queue substitute" simscan ./configure --prefix=/usr --sysconfdir=/etc --mandir=/usr/share/man --enable-user=simscan --enable-clamav=y --enable-attach=y --enable-dropmsg=y --enable-per-domain=y --enable-spam=y --enable-spamc-user=y --enable-spamc=/usr/bin/spamc --enable-spam-hits=30.0 --enable-qmaildir=/var/qmail --enable-workdir=/var/qmail/simscan --enable-controldir=/var/qmail/control --enable-quarantinedir=/var/qmail/quarantine --enable-qmail-queue=/var/qmail/bin/qmail-queue --enable-ripmime=/usr/bin/ripmime --enable-received=y --enable-spamassassin-path=/usr/bin/spamassassin --enable-clamavdb-path=/var/clamav --enable-clamdscan=/usr/bin/clamdscan --enable-sigtool-path=/usr/bin/sigtool --enable-spam-passthru=y [root@localhost]# make [root@localhost]# make install-strip [root@localhost]# mkdir /var/qmail/quarantine [root@localhost]# chown simscan:clamav /var/qmail/quarantine/ [root@localhost]# chmod 770 /var/qmail/quarantine/ [root@localhost]# cat /var/qmail/control/simcontrol :clam=yes,spam=yes,attach=.scr:.bat:.com:.pif:.exe:.mp3:.avi:.mpeg:.wmv [root@localhost]# /var/qmail/bin/simscanmk -g simscan versions cdb file built. /var/qmail/control/simversions.cdb [root@localhost]# /var/qmail/bin/simscanmk simscan cdb file built. /var/qmail/control/simcon |
Explains how to restart / stop / start httpd ( Apache ) web server under Red Hat / RHEL / Fedora / CentOS Linux operating […]
Home page of The Apache Software Foundation 소스: Welcome to The Apache Software Foundation!
Copyright © 2025 | WordPress Theme by MH Themes