웹서버 분류

Nginx에서 에어코믹스 암호 추가하기

컨텐츠 정보

본문

Nginx에서 암호를 추가하는 방법은 알려진대로 쉽습니다.


이와 마찬가지로 에어코믹스에서는 AirComix라는 정해진 ID를 가지고 있어야 인식을 합니다.


Putty에서



cd /에어코믹스폴더


위와 같이 에어코믹스폴더에 들어갑니다.



printf "AirComix:$(openssl passwd -crypt 비번)\n" >> .htpasswd


위와 같이 아이디는 AirComix로 정해져 있고, 비번만 지정하면 됩니다.



chown root:www-data /에어코믹스폴더/.htpasswd


위와 같이 에어코믹스폴더 안에 있는 비번 저장파일의 권한을 줍니다.



chmod 640 /에어코믹스폴더/.htpasswd


640 권한을 줍니다.



server {

listen 원하는포트;

server_name 본인의서버네임;

charset UTF-8; 

root /에어코믹스폴더;

location / {

autoindex on;

index index.php;

auth_basic "Restricted Access";

auth_basic_user_file /에어코믹스폴더/.htpasswd;

}

location ~ \.php$ {

fastcgi_pass unix:/var/run/php5-fpm.sock;

fastcgi_index index.php;

include fastcgi_params;

}

location ~ ^/manga(.*)$ {

include fastcgi_params;

fastcgi_pass unix:/var/run/php5-fpm.sock;

fastcgi_param SCRIPT_FILENAME /에어코믹스폴더/handler.php; 

}

}


위의 빨간 부분을 추가해줍니다.


그리고 


service nginx restart


위 명령어로 nginx를 재시작하면 이제 암호를 넣어야 에어코믹스 폴더가 보입니다.

관련자료

  • 서명
    우성짱의 NAS를 운영하고 있습니다.

    저의 즐거움이 여러분의 즐거움이면 좋겠습니다.

댓글 0
등록된 댓글이 없습니다.
전체 43 / 2 페이지
RSS

최근글


새댓글


알림 0