Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
docpublic:systemes:shibboleth:idpv3xc8 [2020/06/04 20:00]
procacci@tem-tsp.eu [enable]
docpublic:systemes:shibboleth:idpv3xc8 [2020/07/04 15:15] (current)
procacci@tem-tsp.eu [proxy et TLS via apache]
Line 192: Line 192:
 [root@idpx ~]# systemctl start tomcat.service [root@idpx ~]# systemctl start tomcat.service
 </code> </code>
 +
 +
 +===== firewall =====
 +
 +<code>
 +[root@idpx opt]# firewall-cmd --permanent --add-rich-rule 'rule family="ipv4" source address="157.19.19.0/24" port port=8080 protocol=tcp log prefix="http8080" accept'
 +success
 +[root@idpx opt]# firewall-cmd --reload
 +success
 +
 +[root@idpx opt]# firewall-cmd --permanent --add-rich-rule 'rule family="ipv4" source address="157.19.19.0/16" service name="http" log prefix="http" accept'
 +success
 +[root@idpx opt]# firewall-cmd --permanent --add-rich-rule 'rule family="ipv4" source address="157.19.19.0/16" service name="https" log prefix="https" accept'
 +success
 +[root@idpx opt]# firewall-cmd --reload
 +success
 +
 +</code>
 +ou plus generalement 
 +
 +firewall-cmd --zone=public --permanent --add-port=8080/tcp
 +
 +
 +
  
 ==== acces tomcat ==== ==== acces tomcat ====
  
-le serveur est maintenant acessible , exemple +le serveur est maintenant accessible , exemple 
  
-http://idp3.tem-tsp.eu:8080/manager/html (login/pass definit plus haut) +http://idpx.tem-tsp.eu:8080/manager/html (login/pass definit plus haut) 
  
-==== proxy-ajp et TLS via apache =====+sauf si l'adresse ip source de consultation n'est pas autorisé par le control d'acces de l'application manager , cf adresse IP dans le parametre allow : 
  
-mise en place d'un proxy ajp pour une gestion de TLS et ports par defaut (80/443) par apache +<code> 
 +[root@idpx ~]# vim /opt/tomcat/webapps/manager/META-INF/context.xml  
 + 
 +<Context antiResourceLocking="false" privileged="true"
 +  <Valve className="org.apache.catalina.valves.RemoteAddrValve" 
 +         allow="127\.\d+\.\d+\.\d+|::1|0:0:0:0:0:0:0:1|192.168.0.10|10.10.10.11" /> 
 +  <Manager sessionAttributeValueClassNameFilter="java\.lang\.(?:Boolean|Integer|Long|Number|String)|org\.apache\.catalina\.filters\.CsrfPreventionFilter\$LruCache(?:\$1)?|java\.util\.(?:Linked)?HashMap"/> 
 +</Context> 
 +</code> 
 +==== proxy et TLS via apache ===== 
 + 
 +https://tomcat.apache.org/tomcat-9.0-doc/proxy-howto.html 
 +https://tomcat.apache.org/tomcat-9.0-doc/connectors.html 
 +https://rimuhosting.com/mod_jk2_and_mod_proxy_ajp.jsp (secretRequired="false"
 + 
 + 
 +mise en place d'un proxy pour une gestion de TLS et ports par defaut (80/443) par apache 
 il faut installer le mod_ssl d'apache pour disposer d'https  il faut installer le mod_ssl d'apache pour disposer d'https 
  
 <code> <code>
-[root@idp34 tomcat]# yum install mod_ssl +[root@idpx opt]# yum install httpd mod_ssl 
-Installé : + 
-  mod_ssl.x86_64 1:2.4.6-88.el7.centos                            +Total download size: 2.0 M 
 +Is this ok [y/N]: y 
 +                 
 </code> </code>
  
Line 213: Line 255:
  
 <code> <code>
-[root@idp34 certs]#grep ^SSL /etc/httpd/conf.d/ssl.conf | tail -3+[root@idpx certs]#grep ^SSL /etc/httpd/conf.d/ssl.conf | tail -3
 SSLCertificateFile /etc/pki/tls/certs/idp.imtbstsp_eu.pem SSLCertificateFile /etc/pki/tls/certs/idp.imtbstsp_eu.pem
 SSLCertificateKeyFile /etc/pki/tls/private/idp.imtbstsp.key SSLCertificateKeyFile /etc/pki/tls/private/idp.imtbstsp.key
Line 222: Line 264:
  
 <code> <code>
-[root@idp3' ~]# cat /etc/httpd/conf.d/shibboleth.conf+[root@idpx ~]# cat /etc/httpd/conf.d/shibboleth.conf
 ProxyPass /idp/ ajp://127.0.0.1:8009/idp/ retry=0 ProxyPass /idp/ ajp://127.0.0.1:8009/idp/ retry=0
 ProxyPass /manager/ ajp://127.0.0.1:8009/manager/ ProxyPass /manager/ ajp://127.0.0.1:8009/manager/
 +</code>
 +
 +et l'activer coté tomcat 
 +
 +<code>
 +[root@idpx opt]# vim /opt/tomcat/conf/server.xml 
 +<!-- Define an AJP 1.3 Connector on port 8009 -->
 + <Connector protocol="AJP/1.3"
 +               port="8009"
 +               secretRequired="false"
 +               address="127.0.0.1"
 +               redirectPort="8443" />
 +</code>
 +
 +sans l'option secretRequired="false" (cf https://rimuhosting.com/mod_jk2_and_mod_proxy_ajp.jsp ) , impossible d'acceder au manager via proxy_ajp, il faudrai mieux controler cet acces en limitant les acces proxy uniquement a 127.0.0.1 entre httpd et tomcat . 
 +
 +lancement httpd et verification de la presence du module AJP
 +
 +<code>
 +[root@idpx opt]# systemctl start httpd.service 
 +[root@idpx opt]# httpd -M | grep ajp
 +
 + proxy_ajp_module (shared)
 +
 </code> </code>
  
 acces sans le port 8080 : acces sans le port 8080 :
  
-http://idp3.tem-tsp.eu/manager/html+http://idpx.imtbstsp.eu/manager/html
  
 puis en https via le proxy-ajp sans precision du port 443 puis en https via le proxy-ajp sans precision du port 443
  
-https://idp3.tem-tsp.eu/manager/html+https://idpx.imtbstsp.eu/manager/html
  
  
docpublic/systemes/shibboleth/idpv3xc8.1591300858.txt.gz · Last modified: 2020/06/04 20:00 by procacci@tem-tsp.eu
[unknown link type]Back to top
CC Attribution-Noncommercial-Share Alike 4.0 International
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0