Apache 설치 on Windows
- Apache VC14 binaries(VC 2015) and modules download > httpd-2.4.25-win64-VC14.zip
- zip file 을 적당한 곳에 unzip 하자. 여기서는 다음 path 를 이용했다.
- c:\Program Files\Apache\Apache24
windows 와 관련된 아파치 설정과 관련해서는 ref. 1 을 보자.
httpd.conf 백업
default 설정을 하나 back up 해놓자. 보통 backup file 이름은 httpd.conf.default 로 한다.
- <Apache24>\conf\httpd.conf.default
httpd.conf 수정
기본적으로 httpd.conf 의 ServerRoot / DocumentRoot / ServerName 을 설정해 줘야 한다.
기본적으로 httpd.conf 에 있는 c:/Apache24 로 되어 있는 값들을 현재 자신이 설치한 path 로 설정해 준다.
기본적으로 httpd.conf 에 있는 c:/Apache24 로 되어 있는 값들을 현재 자신이 설치한 path 로 설정해 준다.
ServerRoot "c:/Program Files/Apache/Apache24" ... DocumentRoot "c:/Program Files/Apache/Apache24/htdocs" <Directory "c:/Program Files/Apache/Apache24/htdocs"> ... ServerName localhost:8080 ... Listen 8080
VirtualHost 를 사용하는 경우
VirtualHost 에 지정한 port 가 Listen 에 지정되어야 한다. 그점만 주의하면 크게 어려울 것은 없다.
Listen 8081 ... # Virtual hosts Include conf/extra/httpd-vhosts.conf
# Test GnuBoard # for port check the LISTEN configuration <VirtualHost *:8081> ServerAdmin webmaster@dummy-host.example.com DocumentRoot "c:/a/programming/php/gnuboard/src" ServerName localhost ServerAlias gnuboard.com ErrorLog "logs/gnuboard-error.log" CustomLog "logs/gnuboard-access.log" common <Directory "c:/a/programming/php/gnuboard/src"> # # 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 Indexes FollowSymLinks # # 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 </Directory> DirectoryIndex index.html index.php </VirtualHost>
아파치를 service 로 설치하기
아파치 bin 하위디렉토리에서 명령행 프롬프트에 다음과 같이 입력하면 아파치를 Windows NT service로 설치한다httpd.exe -k install
"Apache Service Monitor" 라는 이름으로 service 가 설치된다. 이름을 바꾸거나(-n), conf file 의 path 도(-f) 변경할 수 있다. 자세한 것은 여기를 참고하자.
service 삭제
httpd.exe -k uninstall
댓글 없음:
댓글 쓰기