IIS Trace off 방법

OS/Windows 2013. 1. 10. 10:50 Posted by 이정식

Registry Path: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W3SVC\Parameters

Data Type: REG_DWORD

Default Value: 0 (disabled)


'OS > Windows' 카테고리의 다른 글

Windows 사용자 계정 변경  (1) 2013.01.22
windows network error 값 확인  (0) 2013.01.15
IIS http 405 error 원인 및 조치  (0) 2013.01.10
Windows SNMP설정  (0) 2013.01.09
윈도우 시스템의 성능 모니터링  (0) 2013.01.04

IIS http 405 error 원인 및 조치

OS/Windows 2013. 1. 10. 10:48 Posted by 이정식

페이스북 연동하는데 아래와 같이 HTTP 405 에러가 발생했었어요…

원인은 IIS script map settings 에 get이나 post 방식으로 조회 가능한 확장자로 맵핑 시켜주지 않아서 그런 거 같아요

보안상 IIS6 에서는 기본적으로 스크립트 실행이 안되게 해놨다는군요.

 

개발자가 확장자를 .htm 으로 페이지 생성을 해놨었는데, 맘대로 IIS 서비스를 재시작 할수 없는 상황이라

개발자가 .asp 로 확장자를 변경해서 해결되었습니다.

 

아래는 에러 내용과 해결 방법 참고 하세요..

 

==========================================================================================================

이 페이지를 표시할 수 없습니다.

액세스를 시도하는 데 잘못된 메서드(HTTP 동사)를 사용했기 때문에 찾으려는 페이지를 표시할 수 없습니다.

다음을 시도하십시오.

  • 이 요청이 허용되어야 하면 웹 사이트 관리자에게 문의하십시오.
  • 브라우저의 주소 표시줄에 표시된 웹 사이트 주소의 철자와 형식이 정확한지 확인하십시오.

HTTP 오류 405 - 이 페이지에 액세스하는 데 사용한 HTTP 동사가 거부되었습니다.
IIS(인터넷 정보 서비스)

=============================================================================================

해결 방법은 아래와 같아요.

 

 

How to Resolve an HTTP 405 Resource not allowed Error in IIS

 

Symptoms

When attempting to POST to a web page in Internet Information Services (IIS) 5.1 under Windows 2000 (Win2k) or Windows XP, you may receive the following error:

The page cannot be displayed 

The page you are looking for cannot be displayed because the page address is incorrect.  

 

--------------------------------------------------------------------------------

 

Please try the following:

 

If you typed the page address in the Address bar, check that it is entered correctly.

 

Open the 127.0.0.1 home page and then look for links to the information you want. 

HTTP 405 - Resource not allowed

Internet Information Services

 

--------------------------------------------------------------------------------

 

Technical Information (for support personnel)

 

More information:

Microsoft Support  

The code in the sample page that was posted might have been:

<!-- test.html EXAMPLE -->

<html>

<head><title>Test Post</title>

</head>

<body>

 

<form method="post" action="test.html">

<input type="submit">

</form>

 

</body></html>

Cause

The file type is not registered in the IIS script map settings (e.g. .html or .htm). IIS 5.1 only allows HTTP requests of type to GET to unmapped files. HTTP requests of type POST, HEAD, and all others are responded to with a 405 resource not allowed error.

As a security note, you should always remove unused script mappings. This is the default behavior of IIS 6, which will only serve named extensions and refuse all others.

Resolution

Add a script map for the extension. A script map associates a particular file type with a given script module. The web server runs the module on the given file and sends the output to the browser, instead of sending the file directly to the browser.

  • Go to "Control Panel"-"Administrative Tools"-"Internet Information Services".
    • Expand the tree to "COMPUTERNAME"-"Web Sites"-"Default Web Site".
    • Right-click on "Default Web Site" and select "Properties". (Alternately, select "Default Web Site" and press Alt+Enter.)
    • Select the "Home Directory" tab.
    • Click the "Configuration" button.
    • From the "Mappings" tab, select the "Add" button.
    • Click the "Browse..." button, choose "Dynamic Link Libraries *.dll" from the "Files of Type" dropdown, and select c:\WINDOWS\System32\inetsrv\asp.dll.
    • Type ".html" (without quotes) in the "Extension" box.
    • Select the "Limit to:" radio button, and type in "GET, POST" (without quotes) in the box next to it.
    • Click the "OK" button and close all the dialogs. (If the "OK" button is greyed out, then make sure all the entries are correct and try clicking in the file name box.)

    See the screen shot below. You must adjust the above instructions to your particular OS, web site configuration, and file type. You can associate the file type with a different script engine besides asp.dll, which is the ASP 3.0 script engine. There is no need to give IWAM_COMPUTERNAME permission to the file, only IUSR_COMPUTERNAME needs NTFS read and execute permission.

    Screen Shot

    More Information

    Applies to

    Internet Information Services (IIS) 5.1
    Windows XP
    Windows 2000

    Links

    Microsoft Knowledge Base Article - 238461 - Error Message: 405 Method Not Allowed when using FrontPage 2000 Server Extensions from Microsoft or Microsoft Office 2000 Server Extensions Troubleshooting Common IIS Errors Microsoft Search Results for "HTTP 405 - Resource not allowed"

'OS > Windows' 카테고리의 다른 글

windows network error 값 확인  (0) 2013.01.15
IIS Trace off 방법  (0) 2013.01.10
Windows SNMP설정  (0) 2013.01.09
윈도우 시스템의 성능 모니터링  (0) 2013.01.04
NTP Server 및 Client 설정(2014-03-21수정)  (0) 2013.01.01

패스워드 만료 일자 간단 변경

OS/Linux 2013. 1. 10. 10:28 Posted by 이정식

[root@mail ~]# chage -d 2011-05-25 jsclub


[root@mail ~]# chage -l jsclub

마지막으로 열쇠글을 바꾼 날 : 5월 25, 2011

열쇠글 만료 :안함

열쇠글이 비활성화 기간 :안함

계정 만료 : 3월 15, 2012

열쇠글을 바꿀 수 있는 최소 날 수 : 0

열쇠글을 바꿔야 하는 최대 날 수 : 99999

열쇠글 만료 예고를 하는 날 수 : 7

/etc/shadow

jsclub:$1$I2d5T0RE$3OC6qqnfrZgUo1U/ni.gE1:15119:0:99999:7::15414:

'OS > Linux' 카테고리의 다른 글

RHEL 6에서 Network Card bonding  (0) 2013.01.16
리눅스 하드웨어 정보 확인 방법  (0) 2013.01.10
SUDO 제한 방법  (0) 2013.01.10
Python 설치(easy install)  (0) 2013.01.10
Core 파일 생성 방법  (0) 2013.01.10

SUDO 제한 방법

OS/Linux 2013. 1. 10. 10:20 Posted by 이정식

#visudo 실행 ; #vi /etc/sudoers 와 같음.

 

root ALL = (ALL) ALL

gmate ALL = (ALL) ALL        ; 추가 삽입

 

# wheel 그룹에 sudo를 설정하는 방법

%wheel ALL=(ALL) ALL        ; 기본 주석되어 있으니 플어주면 된다.

 

gmate 계정을 wheel 그룹에 추가한다.

# usermod -G wheel gmate

 

만약 패스워드 물어보는 것을 하지 않으려면 아래와 같이 추가한다. 하지만 사용하지 말자..보안상..

%wheel ALL=(ALL) NOPASSWD: ALL

'OS > Linux' 카테고리의 다른 글

리눅스 하드웨어 정보 확인 방법  (0) 2013.01.10
패스워드 만료 일자 간단 변경  (0) 2013.01.10
Python 설치(easy install)  (0) 2013.01.10
Core 파일 생성 방법  (0) 2013.01.10
커널 파라미터 설정 정보  (0) 2013.01.10

SSL 인증서 생성 방법

WEB/WAS/Apache 2013. 1. 10. 10:09 Posted by 이정식

1. SSL 발급 기관(전자인증업체)을 통해 인증서 발급(구매) 시 방법

openssl genrsa -des3 -out jsclub.key 2048     ; 키 생성
openssl req -new -key jsclub.key -out jsclub.csr     ; 인증서 생성
openssl x509 -req -days 3650 -in jsclub.csr -signkey jsclub.key -out jsclub.crt     ; 생성파일 전달해주면 알아서 해줌

 

2. 사설 인증서 생성 방법

[root@mail certs]# openssl req -new -key private.key -out private.csr
Enter pass phrase for private.key:
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [GB]:KR
State or Province Name (full name) [Berkshire]:Seoul
Locality Name (eg, city) [Newbury]:seocho-dong
Organization Name (eg, company) [My Company Ltd]:gmate
Organizational Unit Name (eg, section) []:jsclub
Common Name (eg, your name or your server's hostname) []:ssl.gmate.co.kr
Email Address []:jungsik.lee@gmate.co.kr

Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:gmate
[root@mail certs]#
[root@mail certs]#
[root@mail certs]# ls
private.csr private.key
[root@mail certs]# openssl x509 -req -days 3650 -in private.csr -signkey private.key -out private.crt
Signature ok
subject=/C=KR/ST=Seoul/L=Seocho-dong/O=gmate/OU=jsclub/CN=ssl.gmate.co.kr/emailAddress=jungsik.lee@gmate.co.kr
Getting Private key
Enter pass phrase for private.key:
[root@mail certs]# ls
private.crt private.csr private.key

## 인증서 확인

[root@mail certs]# openssl x509 -noout -text -in cacert.pem

Certificate:
Data:
Version: 3 (0x2)
Serial Number:
97:10:86:9b:c8:1f:b9:d4
Signature Algorithm: sha1WithRSAEncryption
Issuer: C=KR, ST=SEOUL, L=SEOCHO, O=GMATE, OU=IT, CN=mail.gmate.co.kr/emailAddress=jungsik.lee@gmate.co.kr
Validity
Not Before: Mar 15 06:34:36 2010 GMT
Not After : Mar 15 06:34:36 2011 GMT
Subject: C=KR, ST=SEOUL, L=SEOCHO, O=GMATE, OU=IT, CN=mail.gmate.co.kr/emailAddress=jungsik.lee@gmate.co.kr
Subject Public Key Info:
Public Key Algorithm: rsaEncryption
RSA Public Key: (1024 bit)
Modulus (1024 bit):
00:c9:06:0a:97:af:83:69:50:39:62:00:05:5f:de:
7f:21:c2:ec:6c:ba:76:0e:dd:15:ea:53:1e:59:2a:
11:ff:ef:b0:7a:86:88:36:b3:db:b9:fe:33:e0:7a:
6f:7e:e4:63:f7:ce:a3:4f:ae:55:3f:71:4d:ff:0a:
d1:d9:e8:ec:95:bb:79:7b:7e:f2:32:0e:fa:ee:9e:
c3:36:95:70:8b:ca:95:72:99:44:ae:a2:8a:cf:e3:
9d:52:7e:1e:f4:b7:df:6d:54:99:10:ef:a5:ae:8f:
44:ac:72:58:b8:d1:4b:b9:a6:ca:12:f5:07:9a:04:
9f:f2:58:ec:85:60:9b:22:a1
Exponent: 65537 (0x10001)
X509v3 extensions:
X509v3 Subject Key Identifier:
2D:FE:84:22:72:D1:BE:4F:31:45:F4:3D:15:86:50:40:97:90:95:0F
X509v3 Authority Key Identifier:
keyid:2D:FE:84:22:72:D1:BE:4F:31:45:F4:3D:15:86:50:40:97:90:95:0F
DirName:/C=KR/ST=SEOUL/L=SEOCHO /O=GMATE/OU=IT/CN=mail.gmate.co.kr/emailAddress=jungsik.lee@gmate.co.kr
serial:97:10:86:9B:C8:1F:B9:D4

X509v3 Basic Constraints:
CA:TRUE
Signature Algorithm: sha1WithRSAEncryption
64:77:49:1d:29:2c:47:4a:af:62:39:c2:39:a5:8d:0c:ad:01:
92:1e:59:21:28:3c:44:b3:b7:ff:ed:04:06:01:f5:8b:0b:f4:
d5:26:0d:68:9c:b9:d0:c9:f4:c4:d6:06:53:81:d8:44:5a:62:
3c:30:89:71:d2:c6:74:72:de:3f:0c:3b:d1:37:c8:0f:43:d6:
c9:01:52:c2:11:5b:0b:6c:12:52:38:5d:ab:1c:2c:af:5b:18:
45:eb:54:df:12:d5:6d:df:51:5f:ec:7a:32:e2:23:c8:bf:8e:
4e:b3:f8:e3:6c:90:b8:71:d2:1f:ff:aa:dc:b0:87:80:28:bb:
2d:56

'WEB/WAS > Apache' 카테고리의 다른 글

아파치 2.4.3 설치  (0) 2013.01.25
아파치 기동 시 SSL 패스워드 자동 입력  (0) 2013.01.10
웹서버 동시접속자 확인 방법  (0) 2013.01.10
APM 스크립트  (1) 2012.12.21
apache redirect 방법  (0) 2012.12.18

Python 설치(easy install)

OS/Linux 2013. 1. 10. 09:54 Posted by 이정식

python module을 설치한다는 것은 특정 디렉토리에 파일을 풀고 PATH를 잡아주면 되는 것이다.

이 과정을 자동화한 것이 easy-install이다.

받은 소스 안에 setup.py라는 파일이 있다면 다음의 명령으로 egg 파일을 만들 수 있다.

# python setup.py bdist_egg

egg 파일은 설치되는 파일을 zip으로 묶고 확장자를 egg로 변경한 것으로 이해하면 된다. 설치에 사용되는
패키지 정보를 담고 있는 그들만의 파일을 담고 있기도 한다.

설치할 때에는 easy-install somename.egg와 같이 실행하면 패키지들이 모여있는 site-packages안에 옮기거나
풀어주고 디렉토리 경로를 저정하고 있는 easy-install.pth에 새로운 경로를 추가해 준다.

압축이 된 상태로 사용할 수도 있고 압축을 풀어서(—always-unzip 옵션) 사용할 수도 있다.

zip으로 된 파일을 egg로 변경하고 easy-install을 수행하면 설치되는 것으로 보일 경우가 있다. 그렇지만 제대로
설치되지 않아서 동작을 하지 않을 것이다. egg 파일의 내용에는 EGG-INFO 디렉토리가 있으며 setup.py 파일은
보이지 않는 것이 일반적이다.

'OS > Linux' 카테고리의 다른 글

패스워드 만료 일자 간단 변경  (0) 2013.01.10
SUDO 제한 방법  (0) 2013.01.10
Core 파일 생성 방법  (0) 2013.01.10
커널 파라미터 설정 정보  (0) 2013.01.10
커널 패닉 시 자동 리부팅 설정  (0) 2013.01.10

Core 파일 생성 방법

OS/Linux 2013. 1. 10. 09:47 Posted by 이정식

1. /etc/security/limits.conf 수정

* soft core -1
* hard core -1

-1 은 unlimited 뜻함.

2. /etc/profile 수정
#ulimit -S -c 0 > /dev/null 2>&1 ; 변경 전
ulimit -S -c unlimited > /dev/null 2>&1 ; 변경 후

3. reboot

#### 자세한 설명 ###
초기 설정에는 core file size가 0으로 설정이 되어있어, core file이 생성이 되지 않는다.
따라서 core dump시 core file이 생성되게 하려면 다음과 같이 설정값을 수정해야 한다.

ulimit 설정 값 변경은 위의 현재 설정값에서 나온 옵션을 써주고 값을 써주면 된다.

[root@devlinux ~]# ulimit -c unlimited
[root@devlinux ~]# ulimit -a
core file size (blocks, -c) unlimited
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 98304
max locked memory (kbytes, -l) 32
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 10240
cpu time (seconds, -t) unlimited
max user processes (-u) 98304
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited

위와 같은 명령으로 변경한 것은 해당 user만 변경되어 적용이 되며, reboot 후에는 다시 설정을 해야한다.
위의 설정을 reboot 후에도 유지되게 하기 위해선 아래의 파일 수정이 필요하다.


/etc/security/limits.conf


위 파일에는 ulimit값을 적용할 domain, type, item, value가 들어가게 되어있다.
입력 형식은 다음과 같다.


<domain> <type> <item> <value>
< domain> 해당 설정값을 적용시킬 범위
- user name (userid) - 한 유저의 설정 변경
- group name (@groupid) - 한 그룹에 대한 설정 변경
- wildcard (*) - 모든 유저, 그룹에 대한 설정 변경
- wildcard (%) - * 와 동일, 단 maxlogins 변경에만 사용

<type>
- hard : superuser와 kernel에 의해 설정이 되게 하며, user는 설정된 값 이상으로 변경이 불가능하다.
- soft : soft로 설정한 값은 user가 얼마든지 설정값을 변경 가능하다.
- - : hard와 soft 둘다 설정

<item>
- core : limits the core file size (KB)
- data : maximum data size (KB)
- fsize : maximum filesize (KB)
- memlock : maximum locked-in-memory address space (KB)
- nofile : maximum number of open files
- rss : maximum resident set size (KB) (Ignored in Linux 2.4.30 and higher)
- stack : maximum stack size (KB)
- cpu : maximum CPU time (minutes)
- nproc : maximum number of processes
- as : address space limit
- maxlogins : maximum number of logins for this user
- maxsyslogins : maximum number of logins on system
- priority : the priority to run user process with (negative values boost process priority)
- locks : maximum locked files (Linux 2.4 and higher)
- sigpending : maximum number of pending signals (Linux 2.6 and higher)
- msqueue : maximum memory used by POSIX message queues (bytes) (Linux 2.6 and higher)
- nice : maximum nice priority allowed to raise to (Linux 2.6.12 and higher)
- rtprio : maximum realtime priority allowed for non-privileged processes (Linux 2.6.12 and higher)

example) core dump file size를 변경

astrix - core 1000
@group1 - core unlimited
* - core 200000

이 설정을 변경 하였는데도 불구하고, reboot 시 적용이 안된다면 /etc/profile 파일을 살펴보자!!

...

# No core files by default
ulimit -S -c 0 > /dev/null 2>&1
...


위 빨간 글자로 된 부분을 주석처리 해버리고 reboot하면 적용 된다.

'OS > Linux' 카테고리의 다른 글

SUDO 제한 방법  (0) 2013.01.10
Python 설치(easy install)  (0) 2013.01.10
커널 파라미터 설정 정보  (0) 2013.01.10
커널 패닉 시 자동 리부팅 설정  (0) 2013.01.10
메모리 누수 확인 방법  (0) 2013.01.10

보호되어 있는 글입니다.
내용을 보시려면 비밀번호를 입력하세요.

커널 패닉 시 자동 리부팅 설정

OS/Linux 2013. 1. 10. 09:42 Posted by 이정식

시스템에서 커널 패닉 발생시 수동으로 리부팅을 해야 하지만 자동으로 리부팅 되게 하려면
다음과 같이 적용한다.

echo 10 > /proc/sys/kernel/panic
; kernel panic 발생시 10초 후 자동으로 리부팅이 된다.
; default는 0

'OS > Linux' 카테고리의 다른 글

Core 파일 생성 방법  (0) 2013.01.10
커널 파라미터 설정 정보  (0) 2013.01.10
메모리 누수 확인 방법  (0) 2013.01.10
defunct 프로세스 한번에 종료 하기  (0) 2013.01.10
Source RPM 설치  (0) 2013.01.10

메모리 누수 확인 방법

OS/Linux 2013. 1. 10. 09:39 Posted by 이정식

메모리 누수를 발견하는 방법
1. 프로세스의 스레드 스택 수를 계산한다. 실행중인 활성 스레드와 종료된 스레드의 수가 포함된다
pmap PID | grep pid번호 | wc -l

2. 프로세스의 실행중인 활성 스레드 수를 계산한다
스레드가 작성될때마다 /proc/PID/task 에 한 항목이 추가된다.
결합이던 분리된 스레드이건 상관없이 /proc/PID/task 에서 해당 항목이 제거되므로
다음과 같이 스레드 수를 확인할수 있다
ls /proc/PID/task | wc -l

3. 스택과 활성화된 스레드 수를 비교하여 문제점을 파악한다.
기존 스레드 스택수가 실행중인 활성 스레드 수보다 크고 프로그램이 계속 실행되는 동안 이러한 두 수의 차이가 커지면 메모리 누구가 발생하고 있는것이다

4. 예방할수 있는 방법은
결합 가능한 스레드를 작성할때 pthread_join()을 호출함을 잊지 말아야한다.