No space left on device: Couldn’t create the rewrite-map mutex
갑자기 httpd 죽고, 재시작해도 안 살아 날때.. 에러 로그를 보면 답이 나온다.
0 1 2 3 4 5 6 7 8 9 10 11 |
[root@test /]# httpd -t Syntax OK [root@test /]# service httpd start [root@test /]# ps -ef | grep httpd | wc -l root 27583 21460 0 14:14 pts/10 00:00:00 grep httpd [root@test /]# [root@test /]# tail -f /usr/local/apache/logs/error ..... [core:emerg] [pid 2159] (28)No space left on device: AH00023: Couldn't create the rewrite-map mutex ..... [core:emerg] [pid 11529] (28)No space left on device: AH00023: Couldn't create the rewrite-map mutex ..... [core:emerg] [pid 11897] (28)No space left on device: AH00023: Couldn't create the rewrite-map mutex |
메세지만 보면 디바이스에 공간이 없다는 것인데..
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
[root@er01 free]# df -h Filesystem Size Used Avail Use% Mounted on /dev/sda2 9.8G 580M 8.7G 7% / tmpfs 3.8G 0 3.8G 0% /dev/shm /dev/sda1 190M 64M 116M 36% /boot /dev/sda9 66G 5.5G 57G 9% /free1 /dev/sda8 976M 6.2M 919M 1% /tmp /dev/sda3 9.8G 2.4G 6.9G 26% /usr /dev/sda5 9.8G 1.4G 7.9G 16% /usr/local /dev/sda6 9.8G 1.1G 8.2G 12% /var /dev/sdc1 110G 57G 48G 55% /free # 어딜봐도 용량 딸린 곳은 없다. |
No space left on device: Couldn’t create the rewrite-map mutex
이 메시지는 아파치의 동작 환경에서
kernel: nf_conntrack: table full, dropping packet.
top 나 ps -ef 를 암만 쳐다봐도 서버에 문제가 없는 것 같은데, FTP 접속하여 파일 업로드할때 1k 짜리 파일도 10초 이상 걸릴때 확인하면 딱, 이놈이 대부분 문제다.
시스템(iptable)에서 처리할 수 있는
고객사 전용 도메인 포워딩 스크립트
잘됨..ㅡ ㅋㅋㅋ
0 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 107 108 109 110 111 112 113 114 |
#!/bin/bash ################################################################################################## # # # 고객사 전용 도메인 포워딩 Shellscript # # # # Script by CS@NAYANA # # # ################################################################################################## # pid 생성 중복실행을 방지 if [[ -s $0.pid ]];then exist_pid=`cat $0.pid` if [[ -z `ps -e|grep $exist_pid` ]];then rm -f $0.pid;exec_confirm="Y" else exec_confirm="N";echo -e "\e[1;32mShell has already running...\e[0m";fi else exec_confirm="Y" fi # toDay DateDay=`/bin/date '+%F' | sed -e 's/-//g'` LogTime=`/bin/date '+%F %H:%m'` # Setting file which ServerIp=`hostname -i` NamedConf='/etc/named.rfc1912.zones' HttpdConf='/usr/local/apache/conf/extra/httpd-vhosts.conf' # Setting file Backup mkdir -p /opt/$DateDay.setting/ BackupDay="/opt/$DateDay.setting/" cp -a $NamedConf $BackupDay cp -a $HttpdConf $BackupDay ################################################################################################## # Script Start ################################################################################################## # # Setting info input if [[ -n $1 ]];then id=$1 domain=$2 dir=$3 else echo "############################### 도메인 포워딩 쉘 입니다. #########################" echo "#\t 사용방법 #" echo "#\t 계정아이디 도메인 디렉토리(필수아님) #" echo "#\t account domain abc(필수아님) #" echo "#\t [root@ free]# ./add.forwarding account domain abc(필수아님) #" echo "##################################################################################" read id domain dir fi # 변수 체크 if [[ x$id != "x" || x$domain != "x" ]];then # Check PID DomainNameCheck=`/bin/grep $domain $NamedConf | wc -l` DomainHttpCheck=`/bin/grep $domain $HttpdConf | wc -l` DomainCheck=`/usr/bin/expr $DomainNameCheck + $DomainHttpCheck` NamedConfCheck=`/usr/sbin/named-checkconf | wc -l` NewDomain=`/usr/bin/idn --quiet $domain` AddHttpdPath=`/bin/grep -A1 $id/ $HttpdConf | sed -n '$p' | awk '{print $1,$2}'` OldDomain=`sed -n '$p' $NamedConf | awk '{print $2}' | sed -e 's/\"//g'` if [[ $dir != "" ]];then dir=`echo $dir|sed -e 's/\/html//g;s/html\///g'` dir="html/$dir" else dir="html" fi DirCnt=`echo $dir | cut -f1,2 -d"/" | awk '{print $2}' | wc -l` if [[ $DomainCheck -eq 0 ]];then # Virtual.cont 추가 if [[ $DirCnt -eq 0 ]]; then sed -i '/'"$AddHttpdPath"'/a\ ServerAlias '"$NewDomain"' www.'"$NewDomain"'' $HttpdConf else echo " <VirtualHost $ServerIp:80> DocumentRoot /free/home/$id/$dir ServerName $NewDomain ServerAlias www.$NewDomain CBandLimit 1Gi CBandPeriod 1D CustomLog logs/access_log combined </VirtualHost>" >> $HttpdConf fi # named.conf 추가 sed -n '$p' $NamedConf | sed -e 's/'"$OldDomain"'/'"$NewDomain"'/g' >> $NamedConf # ################################################################################################## # Demon restart and Log /usr/local/apache/bin/apachectl restart /usr/local/apache/bin/apachectl configtest if [[ $NamedConfCheck -eq 0 ]];then /usr/sbin/rndc reload ps -ef | grep --color=always named | grep -v "color=alway" else echo "named-checkconf 오류 => DNS 세팅 불가 => 확인바람!!" fi ps -ef | grep --color=always httpd | grep -v "color=alway" echo -e "[36m[1m$id[0m : [32m$domain[0m : [31m세팅완료[0m" echo "[$LogTime] $id \t $NewDomain 세팅 완료 " >> $BackupDay/setting.log elif [[ x$id = "x" ]];then echo "세팅 정보 입력값이 없어 종료됨." echo "[$LogTime] $id \t $NewDomain 세팅 실패 " >> $BackupDay/setting.log else echo "httpd-vhost.conf에 이미 도메인($NewDomain)이 존재함 => 세팅불가!!" echo "[$LogTime] $id \t $NewDomain 중복 세팅 실패" >> $BackupDay/setting.log fi else echo "서버정보 및 세팅정보를 가져올 수 없음 => 세팅불가" echo "[$LogTime] $id \t $NewDomain 세팅 실패 " >> $BackupDay/setting.log fi ################################################################################################## |
웹서버에서 도메인 긁어와서 도메인이 서버로 연결되는지 확인
세팅된 도메인이 local 서버가 아닌 타IP로 연결되는 것을 확인하기 위한 쉘
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
ServerIp=`hostname -i` DomainListFile='/opt/delete_domain.txt' touch $DomainListFile HttpdConf=`grep -Hlr '</VirtualHost>' /usr/local/apache/conf/* | grep -vE 'original|owasp|ssl|old'` NowSettingDomain=`grep ServerName $HttpdConf | awk '{print $2}'` for NSD in $NowSettingDomain do NsDomainCnt=`/bin/host -t A $NSD | awk '{print $NF}' | wc -l` NsDomainIP=`/bin/host -t A $NSD | awk '{print $NF}'` if [[ $NsDomainCnt -eq 1 ]]; then echo -e "$NSD \t:\t $NsDomainIP" else echo -e "$NSD \t:\t No match for domain" fi done | grep -v $ServerIp >> /opt/delete_domain.txt |
ls – 폴더의 리스트를 보여주는 명령어
ls?
[table id=1 /]
0 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 |
[root@server html]# [root@server html]# ls code readme.html wp-blog-header.php wp-config.php wp-includes wp-login.php wp-signup.php index.php wp-activate.php wp-comments-post.php wp-content wp-links-opml.php wp-mail.php wp-trackback.php license.txt wp-admin wp-config-sample.php wp-cron.php wp-load.php wp-settings.php xmlrpc.php [root@server html]# ls -a . code wp-activate.php wp-config-sample.php wp-includes wp-mail.php xmlrpc.php .. index.php wp-admin wp-config.php wp-links-opml.php wp-settings.php .htaccess license.txt wp-blog-header.php wp-content wp-load.php wp-signup.php .well-known readme.html wp-comments-post.php wp-cron.php wp-login.php wp-trackback.php [root@server html]# ls -al 합계 196 drwx---rwx. 7 team free 4096 2016-05-20 10:09 . drwx-----x. 4 team free 4096 2015-12-23 16:28 .. -rw-r--r--. 1 team free 525 2015-12-11 18:17 .htaccess drwxr-xr-x. 3 root root 4096 2016-02-04 11:35 .well-known drwxr-xr-x 3 root root 4096 2016-03-08 18:09 code -rw-r--r--. 1 team free 418 2015-09-03 12:33 index.php -rw-r--r--. 1 team free 19930 2016-01-14 12:36 license.txt -rw-r--r--. 1 team free 7360 2016-05-07 04:26 readme.html -rw-r--r--. 1 team free 5035 2015-12-11 16:15 wp-activate.php drwxr-xr-x. 9 team free 4096 2015-11-07 09:00 wp-admin -rw-r--r--. 1 team free 271 2015-09-03 12:33 wp-blog-header.php -rw-r--r--. 1 team free 1369 2015-12-11 16:15 wp-comments-post.php -rw-r--r--. 1 team free 2853 2016-01-14 12:36 wp-config-sample.php -rw-rw-rw-. 1 team free 3053 2015-12-08 15:48 wp-config.php drwxr-xr-x. 7 team free 4096 2016-05-11 07:53 wp-content -rw-r--r--. 1 team free 3286 2015-09-03 12:33 wp-cron.php drwxr-xr-x. 16 team free 4096 2015-12-11 16:15 wp-includes -rw-r--r--. 1 team free 2380 2015-09-03 12:33 wp-links-opml.php -rw-r--r--. 1 team free 3316 2015-12-11 16:15 wp-load.php -rw-r--r--. 1 team free 33770 2016-01-14 12:36 wp-login.php -rw-r--r--. 1 team free 7887 2015-12-11 16:15 wp-mail.php -rw-r--r--. 1 team free 13021 2015-12-11 16:15 wp-settings.php -rw-r--r--. 1 team free 28594 2015-12-11 16:15 wp-signup.php -rw-r--r--. 1 team free 4035 2015-09-03 12:33 wp-trackback.php -rw-r--r--. 1 team free 3061 2015-12-11 16:15 xmlrpc.php |
[Memcached] 그누보드5 설치 완료 후 하얀화면이 나와요.
나야나 서버들은 Memcached 가 기본적으로 설치되어 있습니다.
Memcached 는 메모리를 사용해 캐시 서비스를 제공하는 데몬입니다.
홈페이지 접속자가 많은 경우 파일이나 DB를 이용하는 것보다 메모리를 이용하는 것이 더 빠릅니다.
나야나에서 그누보드5를 설치할 경우 가끔
[html] html5 동영상 처리
참조 : https://html5media.info/
<head></head> 사이에 아래 테그 삽입
0 1 2 |
<script src="//api.html5media.info/1.2.2/html5media.min.js"></script> |
<body></body> 사이에 아래 테그 삽입
0 1 2 |
<video src="video.mp4" width="320" height="200" controls preload></video> |
0 1 2 |
<audio src="audio.mp3" controls preload></audio> |
고로.. 요로케
0 1 2 3 4 5 6 7 8 9 10 11 |
<html xmlns="http://www.w3.org/1999/xhtml"> <head> <title> new document </title> <script src="//api.html5media.info/1.2.2/html5media.min.js"></script> </head> <body> <video src="./1.mp4" width="1000" height="600" controls preload></video> </body> </html> |
[워드프레스] 관리자 로그인 비밀번호 변경하기! 굳잡!
PHPMyAdmin 접속합시다.
1. 로그인
나야나는 DB 아이디와 FTP 아이디가 동일하지만, 비밀번호는 동일하지 않습니다.
잘 보고 로그인 하세요.
2. 내 DATABASE 를 선택! 하세요.
3-1. 테이블 ( wp_users ) 클릭
3-2. ( 보기 ) 클릭
쭉쭉~
4. 연필모양 클릭하여