iis 10 달라진 점

출처 : http://www.iis.net/learn/get-started/whats-new-in-iis-10/wildcard-host-header-support

Wildcard Host Header Support

By Andrew Westgarth

July 1, 2015

Level 200 : Novice

COMPATIBILITY

Version Notes
IIS 10.0 Wildcard Host Header Support was introduced in IIS 10.0
IIS 8.5 Wildcard Host Header was not supported in IIS 8.5
IIS 8.0 Wildcard Host Header was not supported in IIS 8.0.
IIS 7.5 Wildcard Host Header was not supported in IIS 7.5.
IIS 7.0 Wildcard Host Header was not supported in IIS 7.0.

CONTENTS

Problem

For quite some time, customers have requested that we support Wildcard Host Headers in IIS. IIS 10 now supports Wildcard Host Headers.

Solution

Wildcard Host Headers enable admins to setup a webserver for a domain, e.g. contoso.com and then have the webserver serve requests for any subdomain. For example the following would all be valid hosts:

  • intranet.contoso.com
  • private.contoso.com
  • blogs.contoso.com

Step by Step Instructions

ADDING A NEW SITE WITH A WILDCARD HOST HEADER

To add a new site with a Wildcard Host Header in IIS you need to follow these simple steps:

  1. Open Internet Information Services Manager on the server your site is hosted on:
      1. If you are using Windows Server Technical Preview:
        1. On the taskbar, click Server Manager, click Tools, and then click Internet Information Services (IIS) Manager.
      2. If you are using Windows Technical Preview
        1. Hold down the Windows Key, press the letter X and then click Control Panel.
        2. Click Administrative Tools, and then double-click Internet Information Services (IIS) Manager.
      3. Select the server on which you wish to create your site, from the list in connections.
      4. Click the “Add Website..” option in the Actions PaneNew Site in IIS Manager
  2. Enter configuration for your site, in the text box for Host name enter your Wildcard Host Header e.g. *.contoso.com and click OK.New Site Details
  3. Your new site has been configured with a Wildcard Host Header
  4. ADDING A WILDCARD HOST HEADER TO AN EXISTING SITE

    To configure and existing site to make use of a Wildcard Host Header in IIS you need to follow these simple steps:

    1. Open Internet Information Services Manager on the server your site is hosted on:
        1. If you are using Windows Server Technical Preview:
          1. On the taskbar, click Server Manager, click Tools, and then click Internet Information Services (IIS) Manager.
        2. If you are using Windows Technical Preview
          1. Hold down the Windows Key, press the letter X and then click Control Panel.
          2. Click Administrative Tools, and then double-click Internet Information Services (IIS) Manager.
        3. Select the server on which your site is deployed, from the list in connections.
        4. Select the website (.e.g. Default Web Site) you wish to configure from the list of sites.
        5. In the Actions pane select Bindings:Edit existing site in IIS Manager
    2. Select the binding you would like to edit (e.g. http) and click Edit…Site Bindings
    3. In the text box for Host name enter your Wildcard Host Header e.g. *.contoso.com and click OKAdd/Edit Site Binding
    4. Now you can see the Wildcard Host Header value in the list of bindings:Updated Site Bindings
    5. Click close to return to IIS Manager.
    6. TESTING A WILDCARD HOST HEADER

      Once you have configured a Wildcard Host Header you will need to configure DNS for the domain and then you can test traffic to your website. In the below screenshots we have used three different subdomains to route to the site which we configured with a Wildcard Host Header (*.contoso.com). The demonstration asp.net application we deployed to this site renders the host name requested on the home page.

      intranet.contoso.comprivate.contoso.comblogs.contoso.com

      Issues

      Summary

      IIS 10.0 has added support for Wildcard Host Headers in bindings.

Telerik Ad

번역 보기

 

센토라 FTP유저명과 DB 이름에 “계정ID” Prefix 없애기

  1. FTP 유저명

/etc/sentora/panel/modules/ftp_management/code 에 있는 controller.ext.php 파일의 186번째 라인을 수정

기존

  $username = $currentuser['username'] . '_' . $username;

 

을 이렇게 변경

  $username = $username;

 

 

 

2. DB 이름

/etc/sentora/panel/modules/mysql_databases/code 에 있는 controller.ext.php 파일의 101번째 라인 수정

 

기존

$db = $zdbh->mysqlRealEscapeString($currentuser['username'] . "_" . $databasename);

 

을 아래처럼 변경

$db = $zdbh->mysqlRealEscapeString($databasename);

 

이것만 변경하면 실제 DB명은 이름이 바뀌지만 패널에서는 아직도 유저명_DB명 형태로 보임. 추가적인 수정 필요

같은 파일 114번째 라인

$name = $currentuser['username'] . "_" . $databasename;

을 다음과 같이 수정

$name = $databasename;

하지만, 이렇게 입력하고 나면 패널에서 데이터베이스 생성후 이름이 제대로 보이긴 하지만 여전히 데이터베이스 이름 입력창에는 유저명_ 이 붙어 있음. 이부분을 수정해야함.

이번엔 /etc/sentora/panel/modules/mysql_databases/module.zpm 파일을 수정해야 함. 이 파일의 72번째 줄

<td nowrap="nowrap"><@ CurrentUserName @>_<input name="inDatabase" type="text" id="inDatabase" size="30" /></td>

의 내용중을 이렇게 수정함.

<td nowrap="nowrap"><input name="inDatabase" type="text" id="inDatabase" size="30" /></td>

 

 

vmware의 가상머신에서 hyper-v 사용하기

VMWare 설정에서 Processors 항목에서

Virtualize Intel VT-x/EPT or AMD-V/RVI 항목이 체크되어 있는 지 확인(Default는 언체크) 체크 해준다.

채크 후 바로 VM을 실행하지 말고

해당 VMWare 가상머신이 설치된 폴더를 열어서

가상머신명.vmx 파일을 에디터로(ex) notepad) 등으로 열어서

hypervisor.cpuid.v0 = “FALSE” 항목을 추가한다.(기존에 있다면 값이 false 인지 확인)

 

그 후 다시 VMWare 실행 하면 정상적으로 hyper-v가 동작함.

32비트 운영체제에서 128G 램 사용하기

원문 출처 : http://wj32.org/wp/2013/10/25/pae-patch-updated-for-windows-8-1/

 

직접 다운로드 : PatchPae2

 

이 파일의 압축을 해제하여 나오는 파일들을 가지고 이용함.

  1. 다운받은 툴의 PatchPae2.exe를 Windows/System32 폴더에 복사를 한다.
  2. cmd를 관리자 권한으로 실행한다.
  3. 128 GB 까지 메모리를 인식할 수 있도록 커널을 패치한다.
    3.1 윈도 8/8.1 : c:\Windows\System32>PatchPae2.exe -type kernel -o ntoskrnx.exe ntoskrnl.exe
    3.2 윈도 Vista/7 : c:\Windows\System32>PatchPae2.exe -type kernel -o ntkrnlpx.exe ntkrnlpa.exe
  4. c:\Windows\System32>PatchPae2.exe -type loader -o winloadp.exe winload.exe
    – 로더의 사인 검증 로직을 제거한다.
  5. bcdedit /copy {current} /d “Windows (PAE Patched)”
    – 부트 항목을 추가한다.
    – 이 명령을 실행하면, {8bfc9ccb-7075-11e4-8f2b-9980ef68eed0}와 같은 UUID를 확인할 수 있다.
  6. 패치된 커널의 추가한 부트 항목으로 로딩하기 위해서 아래의 명령을 실행한다.
    6.1 윈도 8/8.1 : c:\Windows\System32>bcdedit /set {8bfc9ccb-7075-11e4-8f2b-9980ef68eed0} kernel ntoskrnx.exe
    6.2 윈도 Vista/7 : c:\Windows\System32>bcdedit /set {8bfc9ccb-7075-11e4-8f2b-9980ef68eed0} kernel ntkrnlpx.exe
  7. c:\Windows\System32>bcdedit /set {8bfc9ccb-7075-11e4-8f2b-9980ef68eed0} path \Windows\system32\winloadp.exe
    – 패치된 로더로 변경한다.
  8. c:\Windows\System32>bcdedit /set {8bfc9ccb-7075-11e4-8f2b-9980ef68eed0} nointegritychecks 1
    – 로더 검증 로직을 제거한다.

 

이후 msconfig 또는 고급 시스템 설정에서 부팅 설정을 하면 됨.

sftp chroot 설정

1. 사용자 추가

adduser [유저명]

만약, ssh는 접근 못하게하고, sftp만 사용하고자 하는 경우에는 뒤에 -s /bin/false 이란 인수를 추가한다.

 

2. 홈 디렉터리 확인

일반적인 경우에 홈디렉터리는 /home/[유저명] 임. 하지만 chroot를 적용하기 위해서는 이 폴더의 소유자가 root 여야 정상적으로 chroot가 작동.

chown root /home/[유저명]

만약 홈디렉터리의 그룹이 [유저명]이 아니라면 다음과 같이 입력

chown root:[유저명] /home/[유저명]

그리고 권한 변경 (755또는 775또는 777)

chmod 775 /home/[유저명]

 

 

3. sshd_config 파일 편집

vi /etc/ssh/sshd_config

그리고 거의 하단에

Subsystem sftp /usr/lib/openssh/sftp-server

부분을 찾아서 앞에 #을 붙여 주석처리하고 다음과 같이 작성

# Subsystem sftp /usr/lib/openssh/sftp-server
Subsystem sftp internal-sftp

 

그리고 sshd_config 파일 가장 하단에 다음 내용을 추가

Match User [유저명]
     ChrootDirectory /home/[유저명]
     ForceCommand internal-sftp
     X11Forwarding no
     AllowTCPForwarding no

만약 지금처럼 유저명으로 진행하는 것이 아니라 그룹 전체로 한다면 다음과 같이 입력

 

Match Group [그룹명]
     ChrootDirectory %h
     ForceCommand internal-sftp
     X11Forwarding no
     AllowTCPForwarding no

참고로 %h는 홈디렉터리를 뜻함.(홈디렉터리를 대체함) 이 내용은 /etc/passwd에서 확인 및 수정가능

%u 는 인정된 유저를 뜻함.

 

4. ssh restart 하기

restart ssh

또는

service ssh restart

 

 

일단, 참고 http://askubuntu.com/questions/280894/changing-write-permissions-for-jailed-sftp-denies-login

 

 

해당 내용 추가함

만약 user 라는 유저명을 chroot로 /home/user 에 가둬두고 싶으면(이미 sshd_config에서는 /home/user로 해야함. 귀찬으면 %h 입력함) 퍼미션 조정이 더 필요함.

일단 /home/user 의 소유자는 root:user 그리고 퍼미션은 무조건 755로만 해야함.

chown root:user /home/user
chmod 755 /home/user

 

 

그리고 /home/user 디렉터리 안에 적어도 쓰기 가능한 폴더가 하나 존재해야 함. 그래야 접속이 됨.

서브 디렉터리로 www를 만들고 소유자는 root:user 그리고 권한은 775(777도 가능할지 모름)

mkdir www
chown root:user /home/user/www
chmod 775 /home/user/www

이렇게 하고 나면 정상적으로 choroot 작동함. 휴~

 

부팅시 the disk drive for /dev/mapper/cryptswap1 is not ready yet or not present 해결

I did the following: root 계정으로 로그인 한 상태에서 진행

vi /etc/fstab

다음 문장을 찾아서

/dev/mapper/cryptswap1 none swap sw 0 0

아래처럼 바꾼다.

/dev/mapper/cryptswap1 none swap sw,noauto 0 0

그리고

vi /etc/rc.local

이 파일에는 아래와 같은 한줄만 있을 텐데 그 내용을 변경한다.

exit 0

아래의 내용을 그대로 복사 > 붙여넣기

sleep 5
swapon /dev/mapper/cryptswap1

 

smb 유저 추가

이미 등록된 사용자를 기준으로

 

smbpasswd -a [유저명]

으로 유저를 추가할 수 있다.

참고로 -x 는 삭제

samba 서버 세팅

/etc/samba/smb.conf 파일 수정

가장 아래에 붙여 넣을것

[root]
comment = root
path = /
public = no
browseable = yes
writable = yes
write list = root
create mask = 0777
directory mask = 0777