반응형
반응형

아파치 2.4.25 conf 파일 


# # This is the main Apache HTTP server configuration file. It contains the # configuration directives that give the server its instructions. # See for detailed information.

# In particular, see # # for a discussion of each configuration directive. # # Do NOT simply read the instructions in here without understanding # what they do. They're here only as hints or reminders. If you are unsure # consult the online docs. You have been warned. # # Configuration and logfile names: If the filenames you specify for many # of the server's control files begin with "/" (or "drive:/" for Win32), the # server will use that explicit path. If the filenames do *not* begin # with "/", the value of ServerRoot is prepended -- so "logs/access_log" # with ServerRoot set to "/usr/local/apache2" will be interpreted by the # server as "/usr/local/apache2/logs/access_log", whereas "/logs/access_log" # will be interpreted as '/logs/access_log'. # # ServerRoot: The top of the directory tree under which the server's # configuration, error, and log files are kept. # # Do not add a slash at the end of the directory path. If you point # ServerRoot at a non-local disk, be sure to specify a local disk on the # Mutex directive, if file-based mutexes are used. If you wish to share the # same ServerRoot for multiple httpd daemons, you will need to change at # least PidFile. # ServerRoot "/usr" # # Mutex: Allows you to set the mutex mechanism and mutex file directory # for individual mutexes, or change the global defaults # # Uncomment and change the directory if mutexes are file-based and the default # mutex file directory is not on a local disk or is not appropriate for some # other reason. # # Mutex default:/private/var/run # # Listen: Allows you to bind Apache to specific IP addresses and/or # ports, instead of the default. See also the # directive. # # Change this to Listen on specific IP addresses as shown below to # prevent Apache from glomming onto all bound IP addresses. # #Listen 12.34.56.78:80 Listen 80 # # Dynamic Shared Object (DSO) Support # # To be able to use the functionality of a module which was built as a DSO you # have to place corresponding `LoadModule' lines at this location so the # directives contained in it are actually available _before_ they are used. # Statically compiled modules (those listed by `httpd -l') do not need # to be loaded here. # # Example: # LoadModule foo_module modules/mod_foo.so # LoadModule authn_file_module libexec/apache2/mod_authn_file.so #LoadModule authn_dbm_module libexec/apache2/mod_authn_dbm.so #LoadModule authn_anon_module libexec/apache2/mod_authn_anon.so #LoadModule authn_dbd_module libexec/apache2/mod_authn_dbd.so #LoadModule authn_socache_module libexec/apache2/mod_authn_socache.so LoadModule authn_core_module libexec/apache2/mod_authn_core.so LoadModule authz_host_module libexec/apache2/mod_authz_host.so LoadModule authz_groupfile_module libexec/apache2/mod_authz_groupfile.so LoadModule authz_user_module libexec/apache2/mod_authz_user.so #LoadModule authz_dbm_module libexec/apache2/mod_authz_dbm.so #LoadModule authz_owner_module libexec/apache2/mod_authz_owner.so #LoadModule authz_dbd_module libexec/apache2/mod_authz_dbd.so LoadModule authz_core_module libexec/apache2/mod_authz_core.so #LoadModule authnz_ldap_module libexec/apache2/mod_authnz_ldap.so LoadModule access_compat_module libexec/apache2/mod_access_compat.so LoadModule auth_basic_module libexec/apache2/mod_auth_basic.so #LoadModule auth_form_module libexec/apache2/mod_auth_form.so #LoadModule auth_digest_module libexec/apache2/mod_auth_digest.so #LoadModule allowmethods_module libexec/apache2/mod_allowmethods.so #LoadModule file_cache_module libexec/apache2/mod_file_cache.so #LoadModule cache_module libexec/apache2/mod_cache.so #LoadModule cache_disk_module libexec/apache2/mod_cache_disk.so #LoadModule cache_socache_module libexec/apache2/mod_cache_socache.so #LoadModule socache_shmcb_module libexec/apache2/mod_socache_shmcb.so #LoadModule socache_dbm_module libexec/apache2/mod_socache_dbm.so #LoadModule socache_memcache_module libexec/apache2/mod_socache_memcache.so #LoadModule watchdog_module libexec/apache2/mod_watchdog.so #LoadModule macro_module libexec/apache2/mod_macro.so #LoadModule dbd_module libexec/apache2/mod_dbd.so #LoadModule dumpio_module libexec/apache2/mod_dumpio.so #LoadModule echo_module libexec/apache2/mod_echo.so #LoadModule buffer_module libexec/apache2/mod_buffer.so #LoadModule data_module libexec/apache2/mod_data.so #LoadModule ratelimit_module libexec/apache2/mod_ratelimit.so LoadModule reqtimeout_module libexec/apache2/mod_reqtimeout.so #LoadModule ext_filter_module libexec/apache2/mod_ext_filter.so #LoadModule request_module libexec/apache2/mod_request.so #LoadModule include_module libexec/apache2/mod_include.so LoadModule filter_module libexec/apache2/mod_filter.so #LoadModule reflector_module libexec/apache2/mod_reflector.so #LoadModule substitute_module libexec/apache2/mod_substitute.so #LoadModule sed_module libexec/apache2/mod_sed.so #LoadModule charset_lite_module libexec/apache2/mod_charset_lite.so #LoadModule deflate_module libexec/apache2/mod_deflate.so #LoadModule xml2enc_module libexec/apache2/mod_xml2enc.so #LoadModule proxy_html_module libexec/apache2/mod_proxy_html.so LoadModule mime_module libexec/apache2/mod_mime.so #LoadModule ldap_module libexec/apache2/mod_ldap.so LoadModule log_config_module libexec/apache2/mod_log_config.so #LoadModule log_debug_module libexec/apache2/mod_log_debug.so #LoadModule log_forensic_module libexec/apache2/mod_log_forensic.so #LoadModule logio_module libexec/apache2/mod_logio.so LoadModule env_module libexec/apache2/mod_env.so #LoadModule mime_magic_module libexec/apache2/mod_mime_magic.so #LoadModule expires_module libexec/apache2/mod_expires.so LoadModule headers_module libexec/apache2/mod_headers.so #LoadModule usertrack_module libexec/apache2/mod_usertrack.so ##LoadModule unique_id_module libexec/apache2/mod_unique_id.so LoadModule setenvif_module libexec/apache2/mod_setenvif.so LoadModule version_module libexec/apache2/mod_version.so #LoadModule remoteip_module libexec/apache2/mod_remoteip.so #LoadModule proxy_module libexec/apache2/mod_proxy.so #LoadModule proxy_connect_module libexec/apache2/mod_proxy_connect.so #LoadModule proxy_ftp_module libexec/apache2/mod_proxy_ftp.so #LoadModule proxy_http_module libexec/apache2/mod_proxy_http.so #LoadModule proxy_fcgi_module libexec/apache2/mod_proxy_fcgi.so #LoadModule proxy_scgi_module libexec/apache2/mod_proxy_scgi.so #LoadModule proxy_wstunnel_module libexec/apache2/mod_proxy_wstunnel.so #LoadModule proxy_ajp_module libexec/apache2/mod_proxy_ajp.so #LoadModule proxy_balancer_module libexec/apache2/mod_proxy_balancer.so #LoadModule proxy_express_module libexec/apache2/mod_proxy_express.so #LoadModule proxy_hcheck_module libexec/apache2/mod_proxy_hcheck.so #LoadModule session_module libexec/apache2/mod_session.so #LoadModule session_cookie_module libexec/apache2/mod_session_cookie.so #LoadModule session_dbd_module libexec/apache2/mod_session_dbd.so LoadModule slotmem_shm_module libexec/apache2/mod_slotmem_shm.so #LoadModule slotmem_plain_module libexec/apache2/mod_slotmem_plain.so #LoadModule ssl_module libexec/apache2/mod_ssl.so #LoadModule dialup_module libexec/apache2/mod_dialup.so #LoadModule lbmethod_byrequests_module libexec/apache2/mod_lbmethod_byrequests.so #LoadModule lbmethod_bytraffic_module libexec/apache2/mod_lbmethod_bytraffic.so #LoadModule lbmethod_bybusyness_module libexec/apache2/mod_lbmethod_bybusyness.so ##LoadModule lbmethod_heartbeat_module libexec/apache2/mod_lbmethod_heartbeat.so LoadModule unixd_module libexec/apache2/mod_unixd.so #LoadModule heartbeat_module libexec/apache2/mod_heartbeat.so #LoadModule heartmonitor_module libexec/apache2/mod_heartmonitor.so #LoadModule dav_module libexec/apache2/mod_dav.so LoadModule status_module libexec/apache2/mod_status.so LoadModule autoindex_module libexec/apache2/mod_autoindex.so #LoadModule asis_module libexec/apache2/mod_asis.so #LoadModule info_module libexec/apache2/mod_info.so #LoadModule cgi_module libexec/apache2/mod_cgi.so #LoadModule dav_fs_module libexec/apache2/mod_dav_fs.so #LoadModule dav_lock_module libexec/apache2/mod_dav_lock.so #LoadModule vhost_alias_module libexec/apache2/mod_vhost_alias.so LoadModule negotiation_module libexec/apache2/mod_negotiation.so LoadModule dir_module libexec/apache2/mod_dir.so #LoadModule imagemap_module libexec/apache2/mod_imagemap.so #LoadModule actions_module libexec/apache2/mod_actions.so #LoadModule speling_module libexec/apache2/mod_speling.so #LoadModule userdir_module libexec/apache2/mod_userdir.so LoadModule alias_module libexec/apache2/mod_alias.so #LoadModule rewrite_module libexec/apache2/mod_rewrite.so #LoadModule php5_module libexec/apache2/libphp5.so #LoadModule perl_module libexec/apache2/mod_perl.so LoadModule hfs_apple_module libexec/apache2/mod_hfs_apple.so # # If you wish httpd to run as a different user or group, you must run # httpd as root initially and it will switch. # # User/Group: The name (or #number) of the user/group to run httpd as. # It is usually good practice to create a dedicated user and group for # running httpd, as with most system services. # User _www Group _www # 'Main' server configuration # # The directives in this section set up the values used by the 'main' # server, which responds to any requests that aren't handled by a # definition. These values also provide defaults for # any containers you may define later in the file. # # All of these directives may appear inside containers, # in which case these default settings will be overridden for the # virtual host being defined. # # # ServerAdmin: Your address, where problems with the server should be # e-mailed. This address appears on some server-generated pages, such # as error documents. e.g. admin@your-domain.com # ServerAdmin you@example.com # # ServerName gives the name and port that the server uses to identify itself. # This can often be determined automatically, but we recommend you specify # it explicitly to prevent problems during startup. # # If your host doesn't have a registered DNS name, enter its IP address here. # #ServerName www.example.com:80 # # Deny access to the entirety of your server's filesystem. You must # explicitly permit access to web content directories in other # blocks below. # AllowOverride none Require all denied # # Note that from this point forward you must specifically allow # particular features to be enabled - so if something's not working as # you might expect, make sure that you have specifically enabled it # below. # # # DocumentRoot: The directory out of which you will serve your # documents. By default, all requests are taken from this directory, but # symbolic links and aliases may be used to point to other locations. # DocumentRoot "/Library/WebServer/Documents" # # Possible values for the Options directive are "None", "All", # or any combination of: # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews # # Note that "MultiViews" must be named *explicitly* --- "Options All" # doesn't give it to you. # # The Options directive is both complicated and important. Please see # http://httpd.apache.org/docs/2.4/mod/core.html#options # for more information. # Options FollowSymLinks Multiviews MultiviewsMatch Any # # AllowOverride controls what directives may be placed in .htaccess files. # It can be "All", "None", or any combination of the keywords: # AllowOverride FileInfo AuthConfig Limit # AllowOverride None # # Controls who can get stuff from this server. # Require all granted # # DirectoryIndex: sets the file that Apache will serve if a directory # is requested. # DirectoryIndex index.html # # The following lines prevent .htaccess and .htpasswd files from being # viewed by Web clients. # Require all denied # # Apple specific filesystem protection. # Require all denied Require all denied # # ErrorLog: The location of the error log file. # If you do not specify an ErrorLog directive within a # container, error messages relating to that virtual host will be # logged here. If you *do* define an error logfile for a # container, that host's errors will be logged there and not here. # ErrorLog "/private/var/log/apache2/error_log" # # LogLevel: Control the number of messages logged to the error_log. # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. # LogLevel warn # # The following directives define some format nicknames for use with # a CustomLog directive (see below). # LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined LogFormat "%h %l %u %t \"%r\" %>s %b" common # You need to enable mod_logio.c to use %I and %O LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio # # The location and format of the access logfile (Common Logfile Format). # If you do not define any access logfiles within a # container, they will be logged here. Contrariwise, if you *do* # define per- access logfiles, transactions will be # logged therein and *not* in this file. # CustomLog "/private/var/log/apache2/access_log" common # # If you prefer a logfile with access, agent, and referer information # (Combined Logfile Format) you can use the following directive. # #CustomLog "/private/var/log/apache2/access_log" combined # # Redirect: Allows you to tell clients about documents that used to # exist in your server's namespace, but do not anymore. The client # will make a new request for the document at its new location. # Example: # Redirect permanent /foo http://www.example.com/bar # # Alias: Maps web paths into filesystem paths and is used to # access content that does not live under the DocumentRoot. # Example: # Alias /webpath /full/filesystem/path # # If you include a trailing / on /webpath then the server will # require it to be present in the URL. You will also likely # need to provide a section to allow access to # the filesystem path. # # ScriptAlias: This controls which directories contain server scripts. # ScriptAliases are essentially the same as Aliases, except that # documents in the target directory are treated as applications and # run by the server when requested rather than as documents sent to the # client. The same rules about trailing "/" apply to ScriptAlias # directives as to Alias. # ScriptAliasMatch ^/cgi-bin/((?!(?i:webobjects)).*$) "/Library/WebServer/CGI-Executables/$1" # # ScriptSock: On threaded servers, designate the path to the UNIX # socket used to communicate with the CGI daemon of mod_cgid. # #Scriptsock cgisock # # "/Library/WebServer/CGI-Executables" should be changed to whatever your ScriptAliased # CGI directory exists, if you have that configured. # AllowOverride None Options None Require all granted # # Avoid passing HTTP_PROXY environment to CGI's on this or any proxied # backend servers which have lingering "httpoxy" defects. # 'Proxy' request header is undefined by the IETF, not listed by IANA # RequestHeader unset Proxy early # # TypesConfig points to the file containing the list of mappings from # filename extension to MIME-type. # TypesConfig /private/etc/apache2/mime.types # # AddType allows you to add to or override the MIME configuration # file specified in TypesConfig for specific file types. # #AddType application/x-gzip .tgz # # AddEncoding allows you to have certain browsers uncompress # information on the fly. Note: Not all browsers support this. # #AddEncoding x-compress .Z #AddEncoding x-gzip .gz .tgz # # If the AddEncoding directives above are commented-out, then you # probably should define those extensions to indicate media types: # AddType application/x-compress .Z AddType application/x-gzip .gz .tgz # # AddHandler allows you to map certain file extensions to "handlers": # actions unrelated to filetype. These can be either built into the server # or added with the Action directive (see below) # # To use CGI scripts outside of ScriptAliased directories: # (You will also need to add "ExecCGI" to the "Options" directive.) # #AddHandler cgi-script .cgi # For type maps (negotiated resources): #AddHandler type-map var # # Filters allow you to process content before it is sent to the client. # # To parse .shtml files for server-side includes (SSI): # (You will also need to add "Includes" to the "Options" directive.) # #AddType text/html .shtml #AddOutputFilter INCLUDES .shtml # # The mod_mime_magic module allows the server to use various hints from the # contents of the file itself to determine its type. The MIMEMagicFile # directive tells the module where the hint definitions are located. # #MIMEMagicFile /private/etc/apache2/magic # # Customizable error responses come in three flavors: # 1) plain text 2) local redirects 3) external redirects # # Some examples: #ErrorDocument 500 "The server made a boo boo." #ErrorDocument 404 /missing.html #ErrorDocument 404 "/cgi-bin/missing_handler.pl" #ErrorDocument 402 http://www.example.com/subscription_info.html # # # MaxRanges: Maximum number of Ranges in a request before # returning the entire resource, or one of the special # values 'default', 'none' or 'unlimited'. # Default setting is to accept 200 Ranges. #MaxRanges unlimited # # EnableMMAP and EnableSendfile: On systems that support it, # memory-mapping or the sendfile syscall may be used to deliver # files. This usually improves server performance, but must # be turned off when serving from networked-mounted # filesystems or if support for these functions is otherwise # broken on your system. # Defaults: EnableMMAP On, EnableSendfile Off # #EnableMMAP off #EnableSendfile on TraceEnable off # Supplemental configuration # # The configuration files in the /private/etc/apache2/extra/ directory can be # included to add extra features or to modify the default configuration of # the server, or you may simply copy their contents here and change as # necessary. # Server-pool management (MPM specific) Include /private/etc/apache2/extra/httpd-mpm.conf # Multi-language error messages #Include /private/etc/apache2/extra/httpd-multilang-errordoc.conf # Fancy directory listings Include /private/etc/apache2/extra/httpd-autoindex.conf # Language settings #Include /private/etc/apache2/extra/httpd-languages.conf # User home directories #Include /private/etc/apache2/extra/httpd-userdir.conf # Real-time info on requests and configuration #Include /private/etc/apache2/extra/httpd-info.conf # Virtual hosts #Include /private/etc/apache2/extra/httpd-vhosts.conf # Local access to the Apache HTTP Server Manual #Include /private/etc/apache2/extra/httpd-manual.conf # Distributed authoring and versioning (WebDAV) #Include /private/etc/apache2/extra/httpd-dav.conf # Various default settings #Include /private/etc/apache2/extra/httpd-default.conf # Configure mod_proxy_html to understand HTML4/XHTML1 Include /private/etc/apache2/extra/proxy-html.conf # Secure (SSL/TLS) connections #Include /private/etc/apache2/extra/httpd-ssl.conf # # Note: The following must must be present to support # starting without SSL on platforms with no /dev/random equivalent # but a statically compiled-in mod_ssl. # SSLRandomSeed startup builtin SSLRandomSeed connect builtin Include /private/etc/apache2/other/*.conf


반응형
반응형

1. HTTPS와 HTTP

- HTTP : Hypertext Transfer Protocol로 즉 HyperText인 html을 전송하기 위한 통신규약을 의미한다.

- 마지막에 S를 붙인다면 Secure라는 뜻으로 보안이 강화된 통신규약을 의미한다.

- HTTP는 암호화가 되어있지 않은 방법으로 서버에 데이터를 전송하기 때문에 서버와 클라이언트가 서로 주고받는 메시지를 알아내기가 쉽다.

- 그러므로 로그인을 위해서 서버로 비밀번호나 계좌번호 등 중요한 데이터를 서버로 전송할 경우에는 HTTPS 프로토콜을 사용하여 통신하는 것이 중요하다.


2. HTTPS와 SSL

- HTTPS는 SSL 프로토콜을 기반으로 돌아가는 프로토콜 중 하나다.


3. SSL과 TLS

- SSL과 TLS는 같은 뜻으로 말하며 TLS1.0은 SSL3.0을 계승한다. 

- 하지만, TLS라는 이름보단 SSL이라는 이름으로 더 많이 사용되고 있다.


4. SSL이란 무엇일까?

- SSL 인증서란 클라이언트와 서버간의 통신을 제 3자가 보증을 해주는 문서이다.

- 클라이언트가 서버에 접속한 직후에 서버는 클라이언트에게 이 인증서를 전달한다. 그러면 클라이언트는 이 인증서를 보고 신뢰할 수 있는 사람인지 확인을 한 다음에 데이터를 보내는 등 다음 절차를 수행하게 된다.


* SSL를 사용하면 좋은 점

(1) 전달되는 내용이 다른 사람에게 노출되는 것을 막을 수 있다.

(2) 클라이언트가 접속하려는 서버가 신뢰할 수 있는 서버 인지 알 수 있다.

(3) 전달되는 내용이 악의적으로 변경되는 것을 막을 수 있다.


5. SSL에서 사용하는 암호화의 종류

(1) 대칭키

(2) 공개키


5-1. 대칭키

암호를 만드는 행위인 암호화를 할 때 사용하는 일종의 비밀번호를 키(key)라고 한다. 이 키에 따라서 암호화된 결과가 달라지기 때문에 키를 모른다면 암호를 푸는 행위인 복호화도 할 수 없다. 이 중, 대칭키 방식은 동일한 키로 암호화와 복호화를 할 수 있는 기법을 말한다. (Ex. 암호화를 할 때 1234라는 값을 사용했다면, 복호화를 할 때도 1234를 입력해야 복호화가 완료되는 방식이다.)


그러나, 대칭키의 단점이 있다.

암호를 주고 받는 사람들 사이에서 이 키(key)로 암호화하라고 사용자에게 전달하는 것이 어렵다는 점이다. 왜냐하면, 중간에 대칭키가 유출된다면 키를 획득한 공격자는 암호의 내용을 복호화하여 무슨 데이터를 전달하려고 했는지 알 수 있기 때문에 HTTPS를 쓰는 이유가 없어진다. 그래서 나온 방식이 바로 공개키 기법이다.


5-2. 공개키

공개키 방식은 대칭키 방식과 다르게 두 개의 키를 가지고 시작한다. 두 개의 키 중 하나를 비공개키(private key, 개인키/비밀키)라고 부르고 나머지 키를 공개키(public key)라고 말한다. 비공개키는 자신만이 가지고 있고, 공개키는 타인에게 제공한다. 그럼 내가 발행한 공개키를 받은 타인은 공개키를 이용하여 정보를 암호화하고, 암호화된 정보를 비공개키를 가지고 있는 나에게 다시 전달하면 나는 그 데정보를 복호화하여 확인할 수 있다. 


Ex. 클라이언트가 받은 키(key)를 가지고 1234(정보)를 암호화하여 서버에게 !@#$라는 text를 전달 → 서버는 클라이언트가 보낸 !@#$라는 단어를 비공개키로 복호화하여서 1234라는 것을 확인!

여기까지가 공개키의 기본 통신 방법이다.


이제 이 공개키 기법을 응용해보자. 

아깐 공개키를 가진 사람이 암호화해서 전달했으나, 이번엔 비밀키를 가진 사람이 비밀키로 암호화해서 공개키와 함께 암호화된 정보(!@#$)를 전송한다.


정보와 공개키를 획득한 사람은 공개키를 이용하여서 암호화된 정보를 복호화한다. 이 과정에서 공개키가 유출된다면 안되겠지만, 데이터를 보호하려는 목적이 아니고 서로의 신원을 확인하기 위한 방식이므로 유출되어도 상관이 없다. 그러므로 이때, 암호화된 데이터를 공개키로 복호화 할 수 있다는 것은 해당 데이터가 공개키와 쌍을 이루는 비공개키에 의해서 암호화 되었다는 것을 의미한다. 


즉, 공개키가 데이터를 제공한 사람의 신원을 보장해주었다는 것이다.

이것을 우리는 '전자서명'이라고 부른다. 




6. SSL 통신 주고 받는 과정

즉, 위에서 말한 것과 같이 상대방의 공개키를 획득하여 암호화해서 상대방에게 암화된 정보를 제공하고 신원을 확인하는 것이 중요하다. 이러한 절차를 SSL 악수 과정(SSL Handshake)이라고 한다.


<실제 통신 과정>

1단계. Client Hello : 클라이언트가 브라우저나 다른 TCP 통신을 통해서 서버에게 접속한다. 

- 이때 클라이언트는 랜덤한 데이터를 생성하여 서버에게 전송한다. 

- 또 클라이언트가 SSL 통신을 하기 위해 현재 지원가능한 암호화 방식을 서버에게 전덜한다. (자신의 능력을 서버에게 말해주기)


2단계. Server Hello : Client Hello에 대한 응답으로 서버에서 Server Hello를 한다.

- 이번엔 서버에서 생성한 랜덤한 데이터를 클라이언트에게 전송한다.

- 또 이번에는 클라이언트가 지원가능한 암호화 방식에 맞춰 현재 서버에서 제공할 수 있는 가장 안전한 암호화 수단 방식을 클라이언트로 전달한다.

- 또한, 서버가 클라이언트에게 인증서를 전달한다. 


3단계. 클라이언튼 서버가 보내준 인증서가 어떤 CA에 의해서 발급된 것인지 확인하기 위해서 클라이언트에 내장되어있는 CA리스트를 확인한다.

CA리스트에 없는 인증서라면 사용자에게 경고의 메시지를 띄운다.

이때, 인증서가 어떠한 CA에 의해서 발급된 것인지 확인하기 위해서 클라이언트에 내장된 CA의 공개키를 이용하여서 복호화를 한다.

복호화를 정상적으로 성공했다면, 해당 인증서는 CA의 개인키로 암호화 한 문서임이 암시적으로 보증되었고 인증서를 통해서 서버를 믿게 된다. 


클라이언트는 1단계를 통해서 받은 서버의 랜덤 데이터와 클라이언트가 생성한 랜덤 데이터를 조합하여서 pre master secret라는 키를 생성한다.

이 키는 뒤에 살펴볼 세션 단계에서 데이터를 주고 받을 때 사용된다.

이 pre mster secret 키는 3자에게 노출되어선 절대안되는 키다.


이때, pre master secret 키를 다시 서버로 전송을 하는데, 이때 공개키 방식을 이용하여 또 전달한다.


4단계. 서버는 클라이언트가 전송한 pre master secret 값을 자신의 비공개키로 복호화를 한다.

이로서 서버와 클라이언트 모두 pre mater secret 값을 공유하게 되었고, 서버와 클라이언트는 일련의 과정을 거쳐 pre matser secret 값을 master secret 값으로 만든다. 

master secret은 session key를 생성하는데, 이 session key를 이용하여서 대칭키 방식으로 암호화하여 주고 받는다. 



참고 문서


반응형
반응형

아파치 POI란? (https://ko.wikipedia.org/wiki/%EC%95%84%ED%8C%8C%EC%B9%98_POI)

아파치 POI(Apache POI)는 아파치 소프트웨어 재단에서 만든 라이브러리로서 마이크로소프트 오피스 파일 포맷을 순수 자바 언어로서 읽고 쓰는 기능을 제공한다. 주로 워드엑셀파워포인트와 파일을 지원하며 최근의 오피스 포맷인 Office Open XML File Formats [1] (OOXML, 즉 xml 기반의 *.docx, *.xlsx, *.pptx 등) 이나 아웃룩비지오퍼블리셔 등으로 지원 파일 포맷을 늘려가고 있다.


아파치 POI 다운로드 경로 : https://www.apache.org/dyn/closer.lua/poi/release/bin/poi-bin-3.15-20160924.tar.gz

Binary Distribution > poi-bin-3.15 버전 다운로드 

21 September 2016 - POI 3.15 available#

The Apache POI team is pleased to announce the release of 3.15. Featured are a handful of new areas of functionality and numerous bug fixes.

A summary of changes is available in the Release Notes. A full list of changes is available in the change log. People interested should also follow the dev list to track progress.

The POI source release as well as the pre-built binary deployment packages are listed below. Pre-built versions of all POI components are available in the central Maven repository under Group ID "org.apache.poi" and Version "3.15".



라이브러리 내용 : https://poi.apache.org/overview.html#components)

 파일명

 내용

 비고

 poi-3.15.jar

 

 

 poi-examples-3.15.jar

 

 

 poi-excelant-3.15.jar

 

 

 poi-ooxml-3.15.jar

 MS Office Open XML (https://en.wikipedia.org/wiki/Office_Open_XML)

 MS사의 XML 기반의 파일형식을 읽는데 필요한 lib

ooxml-lib\curvesapi-1.04.jar

ooxml-lib\xmlbeans-2.6.0.jar

commons-collections4-x.x.jar 

(https://commons.apache.org/proper/commons-collections/download_collections.cgi)

poi-ooxml-schemas-3.15.jar


위에 있는 lib 파일을 모두 import 해야 함..

디펜던시 ㅡㅡ 

 poi-ooxml-schemas-3.15.jar

 

 

 poi-scratchpad-3.15.jar

 

 


2003 Excel 버전은 XSSF(확장자가 xls)로 읽고

2007 Excel 버전 이후는 HSSF(확장자가 xlsx)를 통해서 파일을 읽고 쓸 수 있다. 


참고 예제 : 

https://www.mkyong.com/java/apache-poi-reading-and-writing-excel-file-in-java/

http://www.programcreek.com/java-api-examples/index.php?api=org.apache.poi.ss.usermodel.WorkbookFactory

파일 읽기

<기존 - 각각 읽어들이는 방법>

HSSFWorkbook wb = new HSSFWorkbook(new File("파일명.xls"));

XSSFWorkbook wb = new XSSFWorkbook(new File("파일명.xlsx"));


<WorkbookFactory를 통해선 구분없이 읽어들이는 방법> : https://poi.apache.org/apidocs/org/apache/poi/ss/usermodel/WorkbookFactory.html

Workbook wb = WorkbookFactory.create( File객체 );

Workbook wb = WorkbookFactory.create( File객체);


첫번째 Sheet 불러오기

Sheet sf = wb.getSheetAt(0); 


첫번째 Sheet의 rows수 가져오기

sf.getLastRowNum();


* 최종

 try {


            FileInputStream excelFile = new FileInputStream(new File(FILE_NAME));

            Workbook workbook = new XSSFWorkbook(excelFile);

            Sheet datatypeSheet = workbook.getSheetAt(0);

            Iterator<Row> iterator = datatypeSheet.iterator();


            while (iterator.hasNext()) {


                Row currentRow = iterator.next();

                Iterator<Cell> cellIterator = currentRow.iterator();


                while (cellIterator.hasNext()) {


                    Cell currentCell = cellIterator.next();

                    //getCellTypeEnum shown as deprecated for version 3.15

                    //getCellTypeEnum ill be renamed to getCellType starting from version 4.0

                    if (currentCell.getCellTypeEnum() == CellType.STRING) {

                        System.out.print(currentCell.getStringCellValue() + "--");

                    } else if (currentCell.getCellTypeEnum() == CellType.NUMERIC) {

                        System.out.print(currentCell.getNumericCellValue() + "--");

                    }


                }

                System.out.println();


            }

        } catch (FileNotFoundException e) {

            e.printStackTrace();

        } catch (IOException e) {

            e.printStackTrace();

        }


외 참고사항

MultipartFile to File로 변경하는 방법 : http://stackoverflow.com/questions/24339990/how-to-convert-a-multipart-file-to-file

File convFile = new File(multipart.getOriginalFilename());

multipart.transferTo(convFile); 

return convFile;



반응형
반응형

1. 아파치 HTTP 웹 서버(https://www.apache.org/)

- 아파치는 아파치 소프트웨어 재단에서 개발된 HTTP 웹 서버를 말한다. 

- 다양한 운영체제에서 사용할 수 있다.

- HTTP 웹 서버이므로 당연히 HTTP 요청을 처리할 수 있는 서버를 뜻한다.

- 클라이언트는 GET, POST 등의 메소드를 활용하여서 정보를 요청하면 아파치는 해당 Request를 받아서 처리해준다.

- 주로 클라이언트와 통신을 주로 담당한다. 

- 응용프로그래밍 언어를 해석하지 못한다. ex) 자바, php, jsp 등

역할 : 정적인 데이터 처리를 주로 담당한다. ex) 단순 html파일 등


2. 톰캣 

- 흔히 WAS (Web Application Server)라고 부른다.

- WAS는 웹 서버(HTTP) + 웹 컨테이너(Jsp, Servlet)의 결합으로 이루어진 것을 말한다.

- 그래서 아파치 없이 톰캣만으로도 웹 서버의 역할을 시킬 수 있다.

역할 : 동적인 데이터 처리를 주로 담당한다. 그러므로 데이터 처리나 db 연결, 비즈니스 로직 처리가 필요한 경우 was를 활용한다. 


Q. 아파치와 톰캣을 둘 다 사용하는 이유는?

- 정적인 처리는 아파치로, 동적인 처리는 톰캣을 쓰도록 활용을 하기 위해서다.


Q. 아파치 같은 웹서버의 역할을 하는 제품들은 무엇이 있는가?

nginx, IIS 등!

주로 리눅스 기반에선 nginx, apache를 많이쓰고, 윈도우에서는 IIS를 통해서 사용한다.


Q. 톰캣 같은 역할을 하는 제품들은 무엇이 있는가?

resin, jeus 등



반응형

+ Recent posts