Sun WebServer 설치 설명서, Solaris 인트라넷 판

Sun WebServer 변환

아래 예제에서 Sun WebServer 1.0 httpd.confaccess.acl 파일의 Sun WebServer 2.0으로의 완전한 변환을 보여줍니다. 아래 예제에서는 새 2.0 지시문은 변환에 꼭 필요한 경우가 아니면 무시하였습니다.

Sun WebServer 1.0 httpd.conf의 2.0 변환
  1. 다음 Sun WebServer 1.0 /etc/http/httpd.conf 파일을 가정해 봅니다.


    server {
    	server_root								"/var/http/demo"
    	server_user								"root"
    	mime_file										"/etc/http/mime.types"
    	mime_default_type			text/html
    
    	acl_enable									"yes"
    	acl_file											"/etc/http/access.acl"
    	acl_delegate_depth		3
    	cache_enable							"yes"
    	cache_small_file_cache_size	8
    	cache_large_file_cache_size	256
    	cache_max_file_size									1
    	cache_verification_time					10
    
    	map			 /cgi-bin/					/var/http/demo/cgi-bin/			cgi
    	map				/sws-icons/			/var/http/demo/sws-icons/
    
    	mime_add		"appication/java"				class
    	mime_add		"audio/basic"								au
    	mime_add		"audio/basic"								snd
    }
    
    url {
    	doc_root									 "/var/http/demo/public"
    	user_doc_enable			"no"
    	user_doc_root					"public_html"
    	cgi_enable							 "no"
    	cgi_dns_enable		"no"
    	cgi_suffix_enable	    "no"
    	cgi_user										"nobody"
    	log_type										"elf"
    	log_prefix								"/var/http/logs/http"
    	log_max_files						7
    	log_cycle_time					1440
    	log_max_file_size		1048576
    	ssi_enable									"no"
    	ssi_exec											"no"
    	ssi_xbithack							"off"
    
    	mime_add								"application/x-csh"		csh
    	mime_add								"application/xsh"				sh
    }
    
    url //widgets {
    	doc_root								 "/var/http/widgets/public"
    	user_doc_enable		"yes"
    	user_doc_root				"public_html"
    	cgi_enable						 "yes"
    	cgi_dns_enable			"yes"
    	cgi_suffix_enable	 "yes"
    	cgi_user									"nobody"
    
    	log_type								"clf"
    	log_prefix						"/var/http/logs/widgets"
    	log_max_files				7
    	log_cycle_time			1440
    	log_max_file_size		1048576
    	ssi_enable							"yes"
    	ssi_exec									"yes"
    	ssi_xbithack					"full"
    
    	map 		/cgi-bin/				/var/http/widgets/cgi-bin/		cgi
    	map 		/sws-icons/		/var/http/widgets/sws-icons/
    }
    
    port 80 {
    	keepalive_enable			"yes"
    	request_timeout				180
    }
    
    port 1880 {
    	ip_address										129.128.127.126
    	keepalive_enable			"yes"
    	request_timeout				180
    	hosts_supported				widgets
    }
  2. 변환용 새 서버를 작성합니다(여기서는 1.0 값의 새 서버에 작성된 구성 파일을 수정합니다).


    #htserver add "server1"
    
  3. 웹 사이트, 제품을 추가합니다.


    # hthost add -i server1 -h widgets \
    	-s /var/http/server1/websites/widgets
    
  4. 서버 레벨 파일 /etc/http/server1.httpd.conf을 수정합니다.


    server {
    	server_root						"/var/http/server1/"
    	server_user						"root"
    	mime_file								"/etc/http/mime.types"
    	mime_default_type	 	text/html
    	access_enable					"yes"
    	cache_enable						"yes"
    	cache_small_file_cache_size		8
    	cache_large_file_cache_size		256
    	cache_max_file_size									 1
    	cache_verification_time					 10
    }
    
    url {
    	site_path					/var/http/server1/websites/default_site
    	site_config			"conf/default_site.site.conf"
    	site_enable			"yes"
    }
    
    url //widgets {
    	site_enable				"yes"
    	site_path						"/var/http/server1/websites/widgets"
    	site_config				"conf/widgets.site.conf"
    	conn_end_points	129.128.127.126:1880 :80
    }
    
    port 80 {
    	ip_address							0.0.0.0
    	keepalive_enable	"yes"
    	request_timeout		180
    }
    
    port 1880 {
    	ip_address						129.128.127.126
    	keepalive_enable	"yes"
    	request_timeout			180
    }
  5. /etc/http/mime.types을 수정합니다.


    application/java				class
    audio/basic									au snd
  6. /var/http/server1/websites/default_site/conf/default_site.site.conf을 수정합니다.


    url {
    	doc_root						/var/http/demo/public
    
    	map_file						conf/map.conf
    	realm_file				conf/realms.conf
    	access_file			conf/access.conf
    	content_file		conf/content.conf
    	mime_file					conf/mime.types
    
    	user_doc_enable		"no"
    	user_doc_root				"public_html"
    	cgi_enable							"no"
    	cgi_dns_enable			"no"
    	cgi_suffix_enable	"no"
    	cgi_user									"nobody"
    	log_type									"elf"
    	log_prefix							"/var/http/server1/logs/default"
    	log_max_files					7
    	log_cycle_time				1440
    	log_max_file_size	 1048576
    	ssi_enable							"no"
    	ssi_exec									"no"
    	ssi_xbithack					"off"
    }
  7. /var/http/server1/websites/default_site/conf/mime.types를 작성합니다.


    application/x-csh			csh
    application/x-sh				sh
  8. /var/http/server1/websites/default_site/conf/map.conf를 수정합니다.


    map 		/cgi-bin/				 /var/http/demo/cgi-bin/		cgi
    map			/sws-icons/			/var/http/demo/sws-icons/
  9. /var/http/server1/websites/widgets/conf/widgets.site.conf을 수정합니다.


    url {
    	doc_root						/var/http/widgets/public
    
    	map_file						conf/map.conf
    	realm_file				conf/realms.conf
    	access_file			conf/access.conf
    	content_file		conf/content.conf
    	mime_file					conf/mime.types
    
    	user_doc_enable			"yes"
    	cgi_enable							 "yes"
    	cgi_dns_enable				"yes"
    	cgi_suffix_enable	 "yes"
    	cgi_user									 "nobody"
    	log_type									 "clf"
    	log_prefix							 "/var/http/server1/logs/widgets"
    	log_max_files					7
    	log_cycle_time				1440
    	log_max_file_size		1048576
    	ssi_enable								"yes"
    	ssi_exec										"yes"
    	ssi_xbithack					  "full"
    }
  10. /var/http/server1/websites/widgets/conf/map.conf을 수정합니다.


    map 	/cgi-bin/				 /var/http/widgets/cgi-bin/ 	cgi
    map 	/sws-icons/			/var/http/widgets/sws-icons/
Sun WebServer 1.0 access.acl의 2.0 변환
  1. 다음 Sun WebServer 1.0 /etc/http/access.acl 파일과 위임된 파일 /var/http/widgets/widgets.acl을 가정해 봅니다.

    • /etc/http/access.acl:


      url "/sws-administration" {
      	authentication_type			md5
      	realm																serverAdmin
      	password_file								 /etc/http/swsadmin.pw
      	+ user															 *
      }
      
      url "/statistics" {
      	authentication_type			basic
      	realm																statsRealm
      	password_file								/var/http/demo/stats/usrs
      	group_file											/var/http/demo/stats/grps
      	+ user															*
      }
      
      url "//widgets" {
      	delegate										/var/http/widgets/widgets.acl
      }
    • /var/http/widgets/widgets.acl:


      url "/" {
      	authentication_type			basic
      	realm																widgetsRealm
      	password_file								/var/http/widgets/users
      	group_file											/var/http/widgets/groups
      
      	+ user						 *
      	- user						 Joe
      	- group						thoseDenied
      }
  2. /etc/http/realms/에 전역 serverAdmin 영역을 작성하고, 사용자 파일을 /etc/http/swsadmin.pw으로 바꿉니다.


    주 -

    영역이 이미 존재한다면 복사 명령을 바로 실행합니다.



    # htrealm add -r serverAdmin -s HTPASSWD
    # cp /etc/http/swsadmin.pw /etc/http/realms/serverAdmin/users
    
  3. 전역 statsRealm을 작성하여 사용자 및 그룹 파일을 위의 "/statistics" URL에서 지정한 파일로 바꿉니다. 이 새 영역을 기본 사이트와 제품 사이트의 realms.conf 파일에 추가합니다.


    주 -

    아래의 <hostname>은 기본 사이트를 지정하는 데 사용하는 워크스테이션의 hostname을 말합니다.



    # htrealm add -r statsRealm -s HTPASSWD
    # cp /var/http/demo/stats/usrs /etc/http/realms/statsRealm/users
    # cp /var/http/demo/stats/grps /etc/http/realms/statsRealm/groups
    # htrealm add -i server1 -h widgets -r statsRealm \
    	-s HTPASSWD -d /etc/http/realms/statsRealm
    # htrealm add -i server1 -h <hostname> -r statsRealm \
    	-s HTPASSWD -d /etc/http/realms/statsRealm
    
  4. 제품 사이트에 지역 widgetsRealm 을 작성하고, 사용자 및 그룹 파일을 위에서 지정한 것으로 바꿉니다.


    # htrealm add -i server1 -h widgets -r widgetsRealm -s HTPASSWD
    # cp /var/http/widgets/users \
    	var/http/server1/websites/widgets/conf/realms/widgetsRealm/
    # cp /var/http/widgets/groups \
    	/var/http/server1/websites/widgets/conf/realms/widgetsRealm/
    
  5. /etc/http/access.conf을 수정합니다.


    url /sws-administration {
    	authentication_type				md5
    	realm																	serverAdmin
    
    	+ user																*
    }
  6. /var/http/server1/websites/default_site/conf/access.conf을 수정합니다.


    # Specify /sws-administration ACL here for site administration,
    #         create a  siteAdmin realm and add administraors to that realm
    # url "/sws-administration" {
    # 	authentication_type			md5
    # 	realm																siteAdmin
    # 	+ user															*
    # }
    
    url "/statistics" {
    	authentication_type				basic
    	realm 																statsRealm
    
    	+ user																*
    }
  7. /var/http/server1/websites/widgets/conf/access.conf를 수정합니다.


    # Spedify /sws-administration ACL here for site administration.
    url "/statistics" {
    	authentication_type				basic
    	realm																	statsRealm
    
    	+ user															*
    }
    
    url "/" {
    	authentication_type				basic
    	realm															 		widgetsRealm
    
    	+ user																*
    	- user																Joe
    	- group															thoseDenied
    }