Apache 가 웹서버,

Tomcat 이 WAS 일 때


Apache 가 Tomcat 의 앞단에서 프록시 역할을 하려면


site-available/000-default.conf 파일의 <VirtualHost *:80> 내부에

ProxyPass / http://localhost:8080/

ProxyPassReverse / http://localhost:8080/

ProxyVia on


위와 같은 코드를 추가하면 된다.


추가한 후 적용을 위해

 $ sudo service apache2 restart

로 서버 재시작을 해준다.


단, 이렇게 해서 다음 에러가 날 수 있다.


AH00526: Syntax error on line 13 of /etc/apache2/sites-enabled/000-default.conf:

Invalid command 'ProxyPass', perhaps misspelled or defined by a module not included in the server configuration

Action 'configtest' failed.


이는 프록시 모듈이 Enabled 되지 않아서 그러는 것이니 다음을 실행해준다.

 $ sudo a2enmod proxy_http



그러면 아래와 같이 나오면서 처리된다.

Considering dependency proxy for proxy_http:

Enabling module proxy.

Enabling module proxy_http.

To activate the new configuration, you need to run:

  service apache2 restart


(서버를 재시작해야 적용된다는 말이 포함되어 있다.)


+ Recent posts