miniserver:xenial
차이
문서의 선택한 두 판 사이의 차이를 보여줍니다.
| 양쪽 이전 판이전 판다음 판 | 이전 판 | ||
| miniserver:xenial [2017/07/24 00:48] – resilio-sync 부분 추가. changwoo | miniserver:xenial [2018/01/02 02:34] (현재) – [Torrent] 잘못된 스크립트 수정 changwoo | ||
|---|---|---|---|
| 줄 140: | 줄 140: | ||
| ==== Dokuwiki ==== | ==== Dokuwiki ==== | ||
| + | |||
| <code - vhost-wiki.conf> | <code - vhost-wiki.conf> | ||
| # Nginx Configuration | # Nginx Configuration | ||
| + | |||
| + | # 아래 설정은 https 적용 이후 http -> https 이동에 사용됨. | ||
| + | server { | ||
| + | listen 80; | ||
| + | server_name | ||
| + | return | ||
| + | } | ||
| server { | server { | ||
| 줄 194: | 줄 202: | ||
| </ | </ | ||
| + | nginx라면 복구 이후 멋진 URL에서 .htaccess 방식을 선택해야 문서가 올바르게 보인다. | ||
| ==== WordPress ==== | ==== WordPress ==== | ||
| 이 녀석은 조금 복잡하다. | 이 녀석은 조금 복잡하다. | ||
| 줄 270: | 줄 279: | ||
| <code - vhost-wordpress.conf> | <code - vhost-wordpress.conf> | ||
| + | |||
| + | # 아래 설정은 https 적용 이후 http -> https 이동에 사용됨. | ||
| + | server { | ||
| + | listen 80; | ||
| + | server_name | ||
| + | return | ||
| + | } | ||
| + | |||
| server { | server { | ||
| server_name blog.changwoo.pe.kr; | server_name blog.changwoo.pe.kr; | ||
| 줄 277: | 줄 294: | ||
| index index.php; | index index.php; | ||
| - | include | + | # wp-login.php, |
| + | location ~ ^/(wp-admin(?!/admin-ajax\.php)|wp-login.php) { | ||
| + | allow 192.168.0.0/24; | ||
| + | deny all; | ||
| + | include snippets/ | ||
| + | fastcgi_pass unix:/ | ||
| + | } | ||
| + | include / | ||
| include / | include / | ||
| } | } | ||
| 줄 668: | 줄 692: | ||
| <code - deluge-daemon> | <code - deluge-daemon> | ||
| #!/bin/sh | #!/bin/sh | ||
| - | ### BEGIN INIT INFO | ||
| - | # Provides: | ||
| - | # Required-Start: | ||
| - | # Required-Stop: | ||
| - | # Should-Start: | ||
| - | # Should-Stop: | ||
| - | # Default-Start: | ||
| - | # Default-Stop: | ||
| - | # Short-Description: | ||
| - | # Description: | ||
| - | # / | ||
| - | ### END INIT INFO | ||
| - | |||
| - | # Author: Adolfo R. Brandes | ||
| - | # Updated by: Jean-Philippe " | ||
| - | |||
| - | PATH=/ | ||
| - | DESC=" | ||
| - | NAME1=" | ||
| - | NAME2=" | ||
| - | DAEMON1=/ | ||
| - | DAEMON1_ARGS=" | ||
| - | DAEMON2=/ | ||
| - | DAEMON2_ARGS="" | ||
| - | PIDFILE1=/ | ||
| - | PIDFILE2=/ | ||
| - | UMASK=022 | ||
| - | PKGNAME=deluge-daemon | ||
| - | SCRIPTNAME=/ | ||
| - | |||
| - | # Exit if the package is not installed | ||
| - | [ -x " | ||
| - | |||
| - | # Read configuration variable file if it is present | ||
| - | [ -r / | ||
| - | |||
| - | # Load the VERBOSE setting and other rcS variables | ||
| - | [ -f / | ||
| - | |||
| - | # Define LSB log_* functions. | ||
| - | # Depend on lsb-base (>= 3.0-6) to ensure that this file is present. | ||
| - | . / | ||
| - | |||
| - | if [ -z " | ||
| - | then | ||
| - | | ||
| - | exit 0 | ||
| - | fi | ||
| - | |||
| - | if [ -z " | ||
| - | then | ||
| - | log_warning_msg "Not starting $PKGNAME, DELUGED_USER not set in / | ||
| - | exit 0 | ||
| - | fi | ||
| - | |||
| - | # | ||
| - | # Function to verify if a pid is alive | ||
| - | # | ||
| - | is_alive() | ||
| - | { | ||
| - | | ||
| - | kill -0 $pid > /dev/null 2>&1 | ||
| - | | ||
| - | } | ||
| - | |||
| - | # | ||
| - | # Function that starts the daemon/ | ||
| - | # | ||
| - | do_start() | ||
| - | { | ||
| - | # Return | ||
| - | # | ||
| - | # | ||
| - | # | ||
| - | |||
| - | | ||
| - | | ||
| - | |||
| - | if [ $RETVAL1 != 0 ]; then | ||
| - | rm -f $PIDFILE1 | ||
| - | | ||
| - | | ||
| - | | ||
| - | else | ||
| - | | ||
| - | | ||
| - | [ " | ||
| - | fi | ||
| - | |||
| - | | ||
| - | | ||
| - | |||
| - | if [ $RETVAL2 != 0 ]; then | ||
| - | sleep 2 | ||
| - | rm -f $PIDFILE2 | ||
| - | start-stop-daemon --start --background --quiet --pidfile $PIDFILE2 --make-pidfile \ | ||
| - | --exec $DAEMON2 --chuid $DELUGED_USER --user $DELUGED_USER --umask $UMASK -- $DAEMON2_ARGS | ||
| - | RETVAL2=" | ||
| - | fi | ||
| - | [ " | ||
| - | } | ||
| - | |||
| - | # | ||
| - | # Function that stops the daemon/ | ||
| - | # | ||
| - | do_stop() | ||
| - | { | ||
| - | # Return | ||
| - | # | ||
| - | # | ||
| - | # | ||
| - | # | ||
| - | |||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | [ " | ||
| - | |||
| - | rm -f $PIDFILE1 $PIDFILE2 | ||
| - | |||
| - | [ " | ||
| - | } | ||
| - | |||
| - | case " | ||
| - | start) | ||
| - | [ " | ||
| - | | ||
| - | case " | ||
| - | 0|1) [ " | ||
| - | 2) [ " | ||
| - | esac | ||
| - | ;; | ||
| - | stop) | ||
| - | [ " | ||
| - | | ||
| - | case " | ||
| - | 0|1) [ " | ||
| - | 2) [ " | ||
| - | esac | ||
| - | ;; | ||
| - | restart|force-reload) | ||
| - | | ||
| - | | ||
| - | case " | ||
| - | 0|1) | ||
| - | do_start | ||
| - | case " | ||
| - | 0) log_end_msg 0 ;; | ||
| - | 1) log_end_msg 1 ;; # Old process is still running | ||
| - | *) log_end_msg 1 ;; # Failed to start | ||
| - | esac | ||
| - | ;; | ||
| - | *) | ||
| - | # Failed to stop | ||
| - | log_end_msg 1#!/bin/sh | ||
| ### BEGIN INIT INFO | ### BEGIN INIT INFO | ||
| # Provides: | # Provides: | ||
| 줄 980: | 줄 848: | ||
| # Failed to stop | # Failed to stop | ||
| log_end_msg 1 | log_end_msg 1 | ||
| - | ;; | ||
| - | esac | ||
| - | ;; | ||
| - | *) | ||
| - | echo " | ||
| - | exit 3 | ||
| - | ;; | ||
| - | esac | ||
| - | |||
| - | : | ||
| ;; | ;; | ||
| esac | esac | ||
| 줄 1044: | 줄 902: | ||
| - | ==== Resilio-Sync ==== | + | ===== Resilio-Sync |
| [[https:// | [[https:// | ||
| 줄 1056: | 줄 914: | ||
| User=changwoo | User=changwoo | ||
| Group=changwoo | Group=changwoo | ||
| + | PIDFile= | ||
| PIDFile=/ | PIDFile=/ | ||
| + | ExecStartPre= | ||
| ExecStartPre=/ | ExecStartPre=/ | ||
| - | ExecStart=/bin/chown -R changwoo: | + | ExecStartPre=/bin/chown -R changwoo: |
| + | ExecStart= | ||
| ExecStart=/ | ExecStart=/ | ||
| </ | </ | ||
| - | systemctl edit 명령은 파일 자체를 변경하는 것이 아니라 overriding 하는 방식이다. 그러므로 | + | systemctl edit 명령은 파일 자체를 변경하는 것이 아니라 overriding 하는 방식이다.그리고 override 할 때 기존 명령어는 한번 비워주는 작업이 필요하다. 그래서 "'' |
| - | < | + | < |
| $ sudo systemctl cat resilio-sync.service | $ sudo systemctl cat resilio-sync.service | ||
| 줄 1091: | 줄 952: | ||
| User=changwoo | User=changwoo | ||
| Group=changwoo | Group=changwoo | ||
| + | PIDFile= | ||
| PIDFile=/ | PIDFile=/ | ||
| + | ExecStartPre= | ||
| ExecStartPre=/ | ExecStartPre=/ | ||
| - | ExecStart=/bin/chown -R changwoo: | + | ExecStartPre=/bin/chown -R changwoo: |
| + | ExecStart= | ||
| ExecStart=/ | ExecStart=/ | ||
| + | |||
| </ | </ | ||
| 줄 1100: | 줄 965: | ||
| 이렇게 덧붙여지는 것을 참고하자. | 이렇게 덧붙여지는 것을 참고하자. | ||
| - | </code> | + | |
| - | </code> | + | ===== SSL 설비 ===== |
| + | 이제는 필수로 구비하자. Let's Encrypt가 있다. 아래의 가이드를 따라하면 어렵지 않다. | ||
| + | * https:// | ||
| + | * http:// | ||
| + | 3개월마다 갱신해야 하는데, 나는 아직 자동 갱신을 하지는 않았다. 나중에 확인하고 달아 보도록 하자. | ||
miniserver/xenial.1500857298.txt.gz · 마지막으로 수정됨: 2017/07/24 00:48 저자 changwoo
