Ubuntu10.04ã§dpkgã使ã£ã¦ãNginxã«ã¢ã¸ã¥ã¼ã«ã追å ãã
前回の記事ã§ãNginxã«ãµã¼ããã¼ãã£ã¢ã¸ã¥ã¼ã«ã追å ãã¦ã³ã³ãã¤ã«ãã¦ã¤ã³ã¹ãã¼ã«ããæé ãæ¸ãã¾ããããUbuntu(Debian)ã®ä½æ³ã«ä¹ã£åã£ã¦dpkgã使ãã¨ããã£ã¨ç°¡åã«ã¢ã¸ã¥ã¼ã«è¿½å ãã§ããã®ã§ãã®æé ãã¡ã¢ãã¦ããã¾ãã
dpkg-devã®ã¤ã³ã¹ãã¼ã«ãNginxã®ã³ã³ãã¤ã«ã«å¿ è¦ãªã©ã¤ãã©ãªã®ã¤ã³ã¹ãã¼ã«ãNginxã®ã½ã¼ã¹ã®åå¾ã¾ã§
$ sudo apt-get install dpkg-dev $ sudo apt-get update $ sudo apt-get build-dep nginx $ apt-get source nginx $ cd nginx-0.7.65
追å ããã¢ã¸ã¥ã¼ã«ã¯ãAWS Authã追å ãããã®ã§gitãã³ãã³ããå ¥ãã¦ãã¢ã¸ã¥ã¼ã«ã®ã½ã¼ã¹ã³ã¼ããåå¾
$ sudo apt-get install git-core $ git clone https://github.com/anomalizer/ngx_aws_auth.git
ã¢ã¸ã¥ã¼ã«ãconfigureã«æå®
$ vi debian/rules .. ./configure --conf-path=/etc/nginx/nginx.conf \ --error-log-path=/var/log/nginx/error.log \ --pid-path=/var/run/nginx.pid \ --lock-path=/var/lock/nginx.lock \ --http-log-path=/var/log/nginx/access.log \ --http-client-body-temp-path=/var/lib/nginx/body \ --http-proxy-temp-path=/var/lib/nginx/proxy \ --http-fastcgi-temp-path=/var/lib/nginx/fastcgi \ --with-debug \ --with-http_stub_status_module \ --with-http_flv_module \ --with-http_ssl_module \ --with-http_dav_module \ --with-http_gzip_static_module \ --with-http_realip_module \ --with-mail \ --with-mail_ssl_module \ --with-ipv6 \ --add-module=$(CURDIR)/modules/nginx-upstream-fair \ --add-module=$(CURDIR)/anomalizer-ngx_aws_auth-37adfc3/ --add-module=$(CURDIR)/ngx_aws_auth \ $(CONFIGURE_OPTS) ...
ã³ã³ãã¤ã«ãã¦ãããã±ã¼ã¸ãä½æ
$ dpkg-buildpackage -b ... gcc -c -Wall -g -O2 -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules -I src/mail \ -o objs/addon/anomalizer-ngx_aws_auth-37adfc3/ngx_http_aws_auth.o \ /root/nginx-0.7.65/anomalizer-ngx_aws_auth-37adfc3//ngx_http_aws_auth.c gcc -c -Wall -g -O2 -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \ -o objs/ngx_modules.o \ objs/ngx_modules.c gcc -o objs/nginx \ objs/src/core/nginx.o \ objs/src/core/ngx_log.o \ objs/src/core/ngx_palloc.o \ objs/src/core/ngx_array.o \ objs/src/core/ngx_list.o \ objs/src/core/ngx_hash.o \ objs/src/core/ngx_buf.o \ objs/src/core/ngx_queue.o \ objs/src/core/ngx_output_chain.o \ objs/src/core/ngx_string.o \ objs/src/core/ngx_parse.o \ objs/src/core/ngx_inet.o \ objs/src/core/ngx_file.o \ objs/src/core/ngx_crc32.o \ objs/src/core/ngx_rbtree.o \ objs/src/core/ngx_radix_tree.o \ objs/src/core/ngx_slab.o \ objs/src/core/ngx_times.o \ objs/src/core/ngx_shmtx.o \ objs/src/core/ngx_connection.o \ objs/src/core/ngx_cycle.o \ objs/src/core/ngx_spinlock.o \ objs/src/core/ngx_cpuinfo.o \ objs/src/core/ngx_conf_file.o \ objs/src/core/ngx_resolver.o \ objs/src/core/ngx_open_file_cache.o \ objs/src/event/ngx_event.o \ objs/src/event/ngx_event_timer.o \ objs/src/event/ngx_event_posted.o \ objs/src/event/ngx_event_busy_lock.o \ objs/src/event/ngx_event_accept.o \ objs/src/event/ngx_event_connect.o \ objs/src/event/ngx_event_pipe.o \ objs/src/os/unix/ngx_time.o \ objs/src/os/unix/ngx_errno.o \ objs/src/os/unix/ngx_alloc.o \ objs/src/os/unix/ngx_files.o \ objs/src/os/unix/ngx_socket.o \ objs/src/os/unix/ngx_recv.o \ objs/src/os/unix/ngx_readv_chain.o \ objs/src/os/unix/ngx_udp_recv.o \ objs/src/os/unix/ngx_send.o \ objs/src/os/unix/ngx_writev_chain.o \ objs/src/os/unix/ngx_channel.o \ objs/src/os/unix/ngx_shmem.o \ objs/src/os/unix/ngx_process.o \ objs/src/os/unix/ngx_daemon.o \ objs/src/os/unix/ngx_setproctitle.o \ objs/src/os/unix/ngx_posix_init.o \ objs/src/os/unix/ngx_user.o \ objs/src/os/unix/ngx_process_cycle.o \ objs/src/os/unix/ngx_linux_init.o \ objs/src/event/modules/ngx_epoll_module.o \ objs/src/os/unix/ngx_linux_sendfile_chain.o \ objs/src/event/ngx_event_openssl.o \ objs/src/core/ngx_regex.o \ objs/src/http/ngx_http.o \ objs/src/http/ngx_http_core_module.o \ objs/src/http/ngx_http_special_response.o \ objs/src/http/ngx_http_request.o \ objs/src/http/ngx_http_parse.o \ objs/src/http/ngx_http_header_filter_module.o \ objs/src/http/ngx_http_write_filter_module.o \ objs/src/http/ngx_http_copy_filter_module.o \ objs/src/http/modules/ngx_http_log_module.o \ objs/src/http/ngx_http_request_body.o \ objs/src/http/ngx_http_variables.o \ objs/src/http/ngx_http_script.o \ objs/src/http/ngx_http_upstream.o \ objs/src/http/ngx_http_upstream_round_robin.o \ objs/src/http/ngx_http_parse_time.o \ objs/src/http/modules/ngx_http_static_module.o \ objs/src/http/modules/ngx_http_index_module.o \ objs/src/http/modules/ngx_http_chunked_filter_module.o \ objs/src/http/modules/ngx_http_range_filter_module.o \ objs/src/http/modules/ngx_http_headers_filter_module.o \ objs/src/http/modules/ngx_http_not_modified_filter_module.o \ objs/src/http/ngx_http_busy_lock.o \ objs/src/http/ngx_http_file_cache.o \ objs/src/http/modules/ngx_http_gzip_filter_module.o \ objs/src/http/ngx_http_postpone_filter_module.o \ objs/src/http/modules/ngx_http_charset_filter_module.o \ objs/src/http/modules/ngx_http_ssi_filter_module.o \ objs/src/http/modules/ngx_http_userid_filter_module.o \ objs/src/http/modules/ngx_http_gzip_static_module.o \ objs/src/http/modules/ngx_http_dav_module.o \ objs/src/http/modules/ngx_http_autoindex_module.o \ objs/src/http/modules/ngx_http_auth_basic_module.o \ objs/src/http/modules/ngx_http_access_module.o \ objs/src/http/modules/ngx_http_limit_zone_module.o \ objs/src/http/modules/ngx_http_limit_req_module.o \ objs/src/http/modules/ngx_http_realip_module.o \ objs/src/http/modules/ngx_http_geo_module.o \ objs/src/http/modules/ngx_http_map_module.o \ objs/src/http/modules/ngx_http_referer_module.o \ objs/src/http/modules/ngx_http_rewrite_module.o \ objs/src/http/modules/ngx_http_ssl_module.o \ objs/src/http/modules/ngx_http_proxy_module.o \ objs/src/http/modules/ngx_http_fastcgi_module.o \ objs/src/http/modules/ngx_http_memcached_module.o \ objs/src/http/modules/ngx_http_empty_gif_module.o \ objs/src/http/modules/ngx_http_browser_module.o \ objs/src/http/modules/ngx_http_flv_module.o \ objs/src/http/modules/ngx_http_upstream_ip_hash_module.o \ objs/src/http/modules/ngx_http_stub_status_module.o \ objs/src/mail/ngx_mail.o \ objs/src/mail/ngx_mail_core_module.o \ objs/src/mail/ngx_mail_handler.o \ objs/src/mail/ngx_mail_parse.o \ objs/src/mail/ngx_mail_ssl_module.o \ objs/src/mail/ngx_mail_pop3_module.o \ objs/src/mail/ngx_mail_pop3_handler.o \ objs/src/mail/ngx_mail_imap_module.o \ objs/src/mail/ngx_mail_imap_handler.o \ objs/src/mail/ngx_mail_smtp_module.o \ objs/src/mail/ngx_mail_smtp_handler.o \ objs/src/mail/ngx_mail_auth_http_module.o \ objs/src/mail/ngx_mail_proxy_module.o \ objs/addon/nginx-upstream-fair/ngx_http_upstream_fair_module.o \ objs/addon/anomalizer-ngx_aws_auth-37adfc3/ngx_http_aws_auth.o \ objs/ngx_modules.o \ -lcrypt -lssl -lpcre -lssl -lcrypto -lz ...
debããã±ã¼ã¸ãã¤ã³ã¹ãã¼ã«
$ cd .. $ sudo dpkg -i nginx_0.7.65-1ubuntu2.3_amd64.deb
ãµã¼ãã¼åèµ·å
$sudo service nginx restart
é常ã«ç°¡åã§ãã
åèã«ãããµã¤ã:
Nginx AWS auth on Ubuntu 10.04
S3ã«ä¿åããããã¡ã¤ã«ãç´æ¥S3ã«ã¢ã¯ã»ã¹ãããããªãå ´åã®Nginxã®è¨å®ã§ãã
é常ã¯ãç´ ç´ã«ã¯ã©ã¦ãããã³ããå©ç¨ããã°ãããããªæ°ããã¾ããã調ã¹ã¦ã¿ãã®ã§ã¡ã¢ãã¦ããã¾ãã
Nginxããèªè¨¼ä»ãã§S3ã«ã¢ã¯ã»ã¹ããã«ã¯ãµã¼ããã¼ãã£ã®ã¢ã¸ã¥ã¼ã«AWS Authãå©ç¨ãã¾ãã
ã¢ã¸ã¥ã¼ã«ã¯ä»¥ä¸ã®ãªã³ã¯ãããã¦ã³ãã¼ãã§ãã¾ãã
http://wiki.nginx.org/3rdPartyModulesJa
ã¤ã³ã¹ãã¼ã«
ã¢ã¸ã¥ã¼ã«ã追å ãã¦Nginxãã³ã³ãã¤ã«ããããã«å¿
è¦ãª
unzipã¨gccãå«ãbuild-essentialããããããã¤ã³ã¹ãã¼ã«ãã¦ããã¾ãã
$ sudo apt-get update
2012.11.03ç¾å¨ã§ã¯ãapt-get updateãã¦ãããªãã¨ãªãã¸ããªã®ãã¹ãå¤ãã£ã¦ãã¦gccã®ã¤ã³ã¹ãã¼ã«ã«å¤±æãã¾ã
$ sudo apt-get install unzip gcc build-essential $ sudo apt-get install libpcre3 libpcre3-dev $ sudo apt-get install zlib1g-dev $ sudo apt-get install openssl libssl-dev
Nginxã®ã½ã¼ã¹ããã¦ã³ãã¼ããã¦è§£åãã¦ããã¾ãã
$ wget http://nginx.org/download/nginx-1.2.4.tar.gz $ tar xvfz nginx-1.2.4.tar.gz $ cd nginx-1.2.4
次ã«AWS Authã¢ã¸ã¥ã¼ã«ããã¦ã³ãã¼ããã¾ãã
$ wget https://github.com/anomalizer/ngx_aws_auth/zipball/master $ mv master aws-auth.zip $ unzip aws-auth.zip
configureãã¦make
$./configure --sbin-path=/usr/sbin \ --conf-path=/etc/nginx/nginx.conf \ --error-log-path=/var/log/nginx/error.log \ --pid-path=/var/run/nginx.pid \ --lock-path=/var/lock/nginx.lock \ --http-log-path=/var/log/nginx/access.log \ --http-client-body-temp-path=/var/lib/nginx/body \ --http-proxy-temp-path=/var/lib/nginx/proxy \ --http-fastcgi-temp-path=/var/lib/nginx/fastcgi \ --with-debug \ --with-http_stub_status_module \ --with-http_flv_module \ --with-http_ssl_module \ --with-http_dav_module \ --with-http_gzip_static_module \ --with-http_realip_module \ --with-mail \ --with-mail_ssl_module \ --with-ipv6 \ --add-module=./anomalizer-ngx_aws_auth-37adfc3 ... configuring additional modules adding module in ./anomalizer-ngx_aws_auth-37adfc3/ + ngx_http_aws_auth was configured checking for PCRE library ... found checking for PCRE JIT support ... not found checking for system md library ... not found checking for system md5 library ... not found checking for OpenSSL md5 crypto library ... not found checking for sha1 in system md library ... not found checking for OpenSSL sha1 crypto library ... not found checking for zlib library ... found creating objs/Makefile Configuration summary + using system PCRE library + using system OpenSSL library + md5: using OpenSSL library + sha1: using OpenSSL library + using system zlib library nginx path prefix: "/usr/local/nginx" nginx binary file: "/usr/sbin" nginx configuration prefix: "/etc/nginx" nginx configuration file: "/etc/nginx/nginx.conf" nginx pid file: "/var/run/nginx.pid" nginx error log file: "/var/log/nginx/error.log" nginx http access log file: "/var/log/nginx/access.log" nginx http client request body temporary files: "/var/lib/nginx/body" nginx http proxy temporary files: "/var/lib/nginx/proxy" nginx http fastcgi temporary files: "/var/lib/nginx/fastcgi" nginx http uwsgi temporary files: "uwsgi_temp" nginx http scgi temporary files: "scgi_temp" $ make ... objs/src/http/modules/ngx_http_browser_module.o \ objs/src/http/modules/ngx_http_upstream_ip_hash_module.o \ objs/src/http/modules/ngx_http_upstream_least_conn_module.o \ objs/src/http/modules/ngx_http_upstream_keepalive_module.o \ objs/addon/anomalizer-ngx_aws_auth-37adfc3/ngx_http_aws_auth.o \ objs/ngx_modules.o \ -lpthread -lcrypt -lssl -lpcre -lcrypto -lcrypto -lz make[1]: Leaving directory `/home/hrendoh/nginx-1.2.2' make -f objs/Makefile manpage make[1]: Entering directory `/home/hrendoh/nginx-1.2.2' sed -e "s|%%PREFIX%%|/usr/local/nginx|" \ -e "s|%%PID_PATH%%|/var/run/nginx.pid|" \ -e "s|%%CONF_PATH%%|/etc/nginx/nginx.conf|" \ -e "s|%%ERROR_LOG_PATH%%|/var/log/nginx/error.log|" \ < man/nginx.8 > objs/nginx.8 make[1]: Leaving directory `/home/hrendoh/nginx-1.2.2' ...
ã¤ã³ã¹ãã¼ã«
$ sudo make install
è¨å®
ãããªæãã§ã
location /s/attachment/ { proxy_pass http://<ãã±ããå>.s3.amazonaws.com/; aws_access_key xxxxxxxxxxxxxxxx; aws_secret_key xxxxxxxxxxxxxxxx s3_bucket <ãã±ããå>; chop_prefix /s/attachment; proxy_set_header Authorization $s3_auth_token; proxy_set_header x-amz-date $aws_date; }
tarã使ã£ã¦ãã£ã¬ã¯ããªãã¨ãã¡ã¤ã«ãã³ãã¼
Macã®å ´åãmvã³ãã¼å ã«ååã®ãã£ã¬ã¯ããªãããã¨-fä»ãã¦ãã¯ããããã®ã§éå®ãããã(å¯è½ãªãªãã·ã§ã³ãããã§ãããï¼)
ã«ã¬ã³ããã£ã¬ã¯ããªã®å ¨ã¦ãã¡ã¤ã«ããã³ãã£ã¬ã¯ããªãã¿ã¼ã²ããããã£ã¬ã¯ããª(target_dir)ã«ã³ãã¼
$ tar cf - * | ( cd /target_dir; tar xfp -)
ã«ã¬ã³ããã£ã¬ã¯ããªã®æå®ãããã£ã¬ã¯ããª(source_dir)ãã¿ã¼ã²ããããã£ã¬ã¯ããª(target_dir)ã«ã³ãã¼
$ tar cvf - ./source_dir | (cd /target_dir; tar xvfp -)
ãããã£ã¯ã©ã¦ãã§rsyncãå©ç¨ããããã¯ã¢ãããè¡ã£ãå ´å Disk200ã¨Disk40ã©ã¡ãã使ãã¹ããï¼
ã¯ã©ã¦ãä¸ã§ãµã¼ãã¹ãæä¾ããå ´åãã¼ã¿ã®å®å ¨æ§ã«ã¤ãã¦ã¯ããã¼ãé¢ã®HAã¯ãµã¼ãã¹ãæä¾ãã¦ãããã*1ãã¢ããªã±ã¼ã·ã§ã³ã®é害ã人çºçãã¹ã«ãããã¼ã¿æå·ã«å¯¾å¿ããããã®ããã¯ã¢ãããæä½éå¿ è¦ã«ãªãã¾ãã
co-meetingã¯ããã¼ã¿ãã¼ã¹ä»¥å¤ã®ãã¼ã¿ã®ããã¯ã¢ããã¯ãã·ã³ãã«ã«è¿½å ãã£ã¹ã¯ã«rsyncã§å·®åããã¯ã¢ãããæ°æ¥éä¿æãã¦ãã¾ãã
co-meetingã¯ããããã£ã¯ã©ã¦ãä¸ã§ãµã¼ãã¹ãæä¾ãã¦ãã¾ããããããã£ã¯ã©ã¦ãã¯ã¹ãã¬ã¼ã¸ã«3x3éã®åé·æ§ãæããã¦ããã®ã§ããã¯ä¿¡é ¼ãã¦ããã¯ã¢ãããã¡ã¤ã«ãS3ãªã©å¤é¨ãµã¼ãã¹ã«ä¿åãããã¨ã¯è¡ã£ã¦ãã¾ãã*2ã
ã¾ããããã¯ã¢ããã®ä»çµã¿ã«ã¯LVMã®ã¹ãããã·ã§ãããæ¤è¨ãã¦ãã¾ãããLVMã®éç¨çµé¨ãç¡ããããä»ã®ã¨ãã復æ§ãããã·ã³ãã«ã§ç¢ºå®ãªrsyncãæ¡ç¨ãã¦ãã¾ã*3
ã§ã¯ãæ¬é¡ã
ãããã£ã¯ã©ã¦ãã§å©ç¨å¯è½ãªã¹ãã¬ã¼ã¸ã¯ä»¥ä¸ã®ç©ãããã¾ãã
- ãã¼ã«ã«ãã£ã¹ã¯
- Disk200
- Disk40
- ãããã£ã¯ã©ã¦ãã¹ãã¬ã¼ã¸
rsyncã¯ãæ¯æcronã§å®è¡ãã¦ãã¾ãããå·®åã®ã¿ã®ã³ãã¼ã¨ã¯ããã³ãã³ãã®å®è¡æéãçãã«è¶
ãããã¨ã¯ããã¾ããã
ã³ã¹ããèããªããã°ãDisk200ãè¿·ããé¸ã³ã¾ãããã
ãã ãDisk200ã¯10500å/100Gbytesã¨çµæ§ãããå¤æ®µããã¾ãã
ããã«å¯¾ãã¦ãDisk40ã¯4100å/100Gbytesã¨ãæé ä¾¡æ ¼ã§ãã
ã³ãã³ãã®å®è¡ã¯ãCPUããããã¯ã¼ã¯ããã£ã¬ã¯ããª/ãã¡ã¤ã«ã®æ§é ã«ãå½±é¿ãããã®ã§åç´ã«ãã£ã¹ã¯ã®ã¹ãã¼ãã ãã§ã¯æ¯è¼ã§ãã¾ããã
ããã§ãåã¹ãã¬ã¼ã¸ã«å¯¾ãã¦ã³ãã³ããå®è¡ãã¦è¨æ¸¬ãã¦ã¿ã¾ããã
*1:復æ§ã§ããªãã¬ãã«ã®ã¹ãã¬ã¼ã¸é害ãèµ·ããããµã¼ãã¹ãããã¤ãããã®ã§ä»ã®ã¯ã©ã¦ãã«ããã¼ã¿ã¯ããã¯ã¢ãããããã¨ããã§ãããããã¯ã³ã¹ãã¨ã®å ¼ãåãã«ãªãã¾ã
*2:å ã ã¯s3syncã使ã£ã¦ãã¾ããããã¼ã¿éãå¢ãã¦æ¥ãããå³ãããªã£ã¦ãã¾ãããEnterpriseçã¯å度æ¤è¨ããäºå®ã§ã
*3:ãããã£ã¯ã©ã¦ããããã£ã¹ã¯ã®ã¹ãããã·ã§ããæ©è½ãæä¾ãã¦ãããã°ãããã®ä»çµã¿ãå¿ è¦ãªããªãã¾ããã追å ãã£ã¹ã¯ãã¤ãã¦ã¯å³ãããã§ããã
SSHè¶ãã®ãã¡ã¤ã«æä½ã¾ã¨ã
ãµã¼ãã¼éã§ãã¡ã¤ã«ãããåããããå ´åã«ãã¤ãã³ãã³ããæ¤ç´¢ããªããã¦ãã¾ãã®ã§sshè¶ãã«ãã¡ã¤ã«ãã³ãã¼ããã³ãã³ããã¾ã¨ãã¦ã¿ã¾ããã
ã¾ãããã®è¨äºãæ¸ãã¦ããéä¸ã«åæ§ã®å 容ãã¾ã¨ãã¦ããããã°ãè¦ã¤ããã®ã§ãªã³ã¯ãè²¼ã£ã¦ããã¾ãã
åæºå
ãã¼ãã¡ã¤ã«ã®æ¨©éå¤æ´
ã³ãã¼å¾ã¯æ¨©éãè¨å®ãç´ãã¦ãã
$ chmod 600 keyfile.pem
ãã¹ã¯ã¼ãç¡ãã®ãã¼ãã¡ã¤ã«ãä½æãã¦ãã
ããã§ç´¹ä»ããã³ãã³ãã使ç¨ããã·ã§ã«ãcronã«ç»é²ããå ´åã¯ãã¹ãã¬ã¼ãºç¡ãã®ãã¼ãã¡ã¤ã«ãç¨æãã¦ããå¿ è¦ãããã¾ãã
$ openssl rsa -in keyfile.pem > keyfile-nopass.pem Enter pass phrase for keyfile.pem: writing RSA key
cronã§ä½¿ç¨ããå ´åã¯ã以ä¸ã«ç´¹ä»ããã³ãã³ãã®keyfileãkeyfile-nopass.pemã«ç½®ãæãã¦ãã ããã
åã³ãã³ãã®ç¢ºèªã¯ãubuntu10.04ã§è¡ã£ã¦ãã¾ãã
WebSocket(node + socket.io)ãstunnel + HAProxyã§ãããã·ãã - ãã®3 - stunnelã®ã»ããã¢ãã
以ä¸ã®å³ã®ãããªãstunnelã¨HAProxyã使ã£ã¦node.jsã¨nginxã1ã¤ã«ã¾ã¨ããæ§æã®ãµã¼ãã¼æ§ç¯æé ãã¾ã¨ãã¦ãã¾ãã
その1ã§ã¯HAProxyã®ã¤ã³ã¹ãã¼ã«ãその2ã§ã¯ãããã·ã®è¨å®ä¾ã«ã¤ãã¦ã¾ã¨ãã¾ããã
OSã«ä¾åããç®æã¯Ubuntu 10.04ãä¾ã«èª¬æãã¦ãã¾ãã
ä»åã¯ãæå¾ã«HAProxyã®åã«stunnelã建ã¦ã¦SSLã§Webãµã¼ãã¹ã«ã¢ã¯ã»ã¹ã§ããããã«ãã¦è¡ãã¾ãã
stunnelã®ã¤ã³ã¹ãã¼ã« (ããã±ã¼ã¸ã¤ã³ã¹ãã¼ã«)
stunnelã®ã¤ã³ã¹ãã¼ã«æé ã«ã¤ãã¦ã¯ã主ã«ä»¥ä¸ã®ããã°ãåèã«ãã¾ãã:
https://www.siamnet.org/Wiki/Ubuntu-SettingUpStunnel
stunnelã¯aptã§ã¤ã³ã¹ãã¼ã«ã§ãã¾ã*1ã
$ sudo apt-get install stunnel4
/etc/default/stunnel4ã®ãENABLEDãã®å¤ãã0ãããã1ãã«å¤æ´ãã¾ãã
#ENABLED=0 ENABLED=1
*1:ã¯ã©ã¤ã¢ã³ãIPã¢ãã¬ã¹ããX-Forwareded-ForããããHAProxyããã¢ããªã±ã¼ã·ã§ã³ã«éä¿¡ããå ´åã¯ãHAPorxyããã¸ã§ã¯ããç¨æãã¦ãããããããã¦ã¦ã½ã¼ã¹ããã¤ã³ã¹ãã¼ã«ããå¿ è¦ãããã¾ã
WebSocket(node + socket.io)ãstunnel + HAProxyã§ãããã·ãã - ãã®2 - HAProxyã®è¨å®
Nginxã¨node.jsãHAProxy+stunnelã§ã¾ã¨ããæ¹æ³ã«ã¤ãã¦ã¾ã¨ãã¦ãã¾ãã
ãµã¼ãã¼ã®æ§æã¯ä»¥ä¸ã®ããã«ãªãã¾ãã
ååã®è¨äºã¯HAProxyã®ã¤ã³ã¹ãã¼ã«ã¾ã§ç´¹ä»ãã¾ããã
http://d.hatena.ne.jp/hrendoh/20120328/1332917793
ä»åã¯ãHAProxyã§Nginxã¨node.jsã®ãµã¼ãã¼ã«æ¯ãåããè¨å®æ¹æ³ã¨ãå種ãã©ã¡ã¼ã¿ã«ã¤ãã¦å®éã®è¨å®ä¾ãåºã«ã¾ã¨ãã¦ã¿ã¾ãã
è¨å®ã®ãªãã¡ã¬ã³ã¹ã¯ãå ¬å¼ãµã¤ãã®Documentãã¼ã¸ã«ãªã³ã¯ãããããã¹ãã®ãã®ã¨ãGoogle codeã«ãåãå 容ã®ãã®ãã¾ã¨ã¾ã£ã¦ãã¾ãã
Google codeã®ããã¥ã¡ã³ãã®æ¹ãè¦ãããã®ã§ãè¦ãã§ãã
haproxy.cfgã®è¨å®
HAProxyã®è¨å®ã¯ /etc/haproxy/haproxy.cfg ã«è¨è¿°ãã¾ãã
ä»åã®ä¾ã¯ã以ä¸ã®ããã«ãªãã¾ãã