配置tomcat+apache
1、Tomcat配置: /opt/apps/acc/cas/*bin/start.sh
bin/stop.sh
conf/catalina.policy
conf/catalina.properties
conf/logging.properties
conf/server.xml
conf/web.xml
lib/
logs/
temp/
webapps/ROOT/
work/
start.sh
export JAVA_HOME=/usr/java/latest
export CATALINA_HOME=/usr/local/tomcat
export CATALINA_BASE=/opt/apps/acc/cas
export CATALINA_PID=${CATALINA_BASE}/tomcat.pid
${CATALINA_HOME}/bin/catalina.sh start
stop.sh
export JAVA_HOME=/usr/java/latest
export CATALINA_HOME=/usr/local/tomcat
export CATALINA_BASE=/opt/apps/acc/cas
export CATALINA_PID=${CATALINA_BASE}/tomcat.pid
${CATALINA_HOME}/bin/catalina.sh stop
server.xml
2、Apache配置:
/usr/local/apache2/conf/extra/httpd-vhosts.conf
# Site: Account
LISTEN 15013
ServerName 11.22.33.44
DocumentRoot /opt/apps/acc/cas/webapps/ROOT/
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
FileETag None
ProxyPass /cache.appcache !
ProxyPass /favicon.ico !
ProxyPass /css/ !
ProxyPass /images/ !
ProxyPass /img/ !
ProxyPass /js/ !
ProxyPass /pic/ !
ProxyPass /theme/ !
ProxyPass /res/ !
AddOutputFilter DEFLATE css
AddOutputFilter DEFLATE htm html shtml xhtml
AddOutputFilter DEFLATE js
AddOutputFilter DEFLATE txt text
AddOutputFilterByType DEFLATE text/html
ProxyPass / http://127.0.0.1:5015/
ProxyPassReverse / http://127.0.0.1:5015/
ProxyPreserveHost On
RequestHeader set X-Forwarded-Proto HTTP
因为tomcat使用的是http,
所以apache使用的ProxyPass也是http, ProxyPass / http://127.0.0.1:5015/
如果tomcat使用的是AJP,
则apache使用的ProxyPass使用的是ajp, ProxyPass / ajp://127.0.0.1:5015/
重启apache使用:
/usr/local/apache2/bin/apachectl restart
补充,如果是配置HTTPS,写法如下:
LISTEN 6443
ServerName t-id.gionee.com
DocumentRoot /opt/apps/acc/cas/webapps/ROOT/
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
FileETag None
ProxyPass /cache.appcache !
ProxyPass /favicon.ico !
ProxyPass /css/ !
ProxyPass /images/ !
ProxyPass /img/ !
ProxyPass /js/ !
ProxyPass /pic/ !
ProxyPass /theme/ !
AddOutputFilter DEFLATE css
AddOutputFilter DEFLATE htm html shtml xhtml
AddOutputFilter DEFLATE js
AddOutputFilter DEFLATE txt text
AddOutputFilterByType DEFLATE text/html
ProxyPass / ajp://127.0.0.1:5015/
ProxyPassReverse / ajp://127.0.0.1:5015/
ProxyPreserveHost On
RequestHeader set X-Forwarded-Proto HTTPS
SSLEngine on
SSLCertificateFile "/usr/local/apache/conf/t-id.xxx.com.crt"
SSLCertificateKeyFile "/usr/local/apache/conf/t-id.xxx.com.key"
SSLCACertificateFile "/usr/local/apache/conf/ca.crt"
页:
[1]