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 15:13]
procacci@tem-tsp.eu [enable et start]
docpublic:systemes:shibboleth:idpv3xc8 [2020/07/04 15:15] (current)
procacci@tem-tsp.eu [proxy et TLS via apache]
Line 84: Line 84:
  
 <code> <code>
-[root@idpx ~]# wget https://downloads.apache.org/tomcat/tomcat-9/v9.0.35/src/apache-tomcat-9.0.35-src.tar.gz+[root@idpx ~]# wget https://downloads.apache.org/tomcat/tomcat-9/v9.0.35/bin/apache-tomcat-9.0.35.tar.gz 
  
 [root@idpx ~]# cd /opt [root@idpx ~]# cd /opt
-[root@idpx opt]# tar xvfz /root/apache-tomcat-9.0.35-src.tar.gz +[root@idpx opt]# tar xvfz /root/apache-tomcat-9.0.35.tar.gz
  
-[root@idpx opt]# mv apache-tomcat-9.0.35-src/* ./tomcat/+[root@idpx opt]# mv apache-tomcat-9.0.35/* ./tomcat/
  
 </code> </code>
Line 97: Line 98:
 <code> <code>
 [root@idpx opt]# ls -al tomcat/ [root@idpx opt]# ls -al tomcat/
-total 368 +total 164 
-drwx------  9 tomcat tomcat   4096  4 juin  16:43 +drwx------ 9 tomcat tomcat  4096 Jun  21:56 
-drwxr-xr-x  root   root     4096  4 juin  16:41 .. +drwxr-xr-x root   root    4096 Jun  21:54 .. 
--rw-r--r--  1 tomcat tomcat     18  1 oct.   2019 .bash_logout +-rw-r--r-- 1 tomcat tomcat    18 Oct   2019 .bash_logout 
--rw-r--r--  1 tomcat tomcat    141  1 oct.   2019 .bash_profile +-rw-r--r-- 1 tomcat tomcat   141 Oct   2019 .bash_profile 
--rw-r--r--  1 tomcat tomcat    312  1 oct.   2019 .bashrc +-rw-r--r-- 1 tomcat tomcat   312 Oct   2019 .bashrc 
-drwxr-xr-x  2 root   root     4096  4 juin  16:41 bin +-rw-r----1 root   root   18982 May  5 22:40 BUILDING.txt 
--rw-r--r--  1 root   root    19086  mai   22:46 BUILDING.txt +-rw-r----1 root   root    5409 May  5 22:40 CONTRIBUTING.md 
--rw-r--r--  1 root   root    15759  mai   22:46 build.properties.default +-rw-r----1 root   root   57092 May  5 22:40 LICENSE 
--rw-r--r--  1 root   root   142678  mai   22:46 build.xml +-rw-r----1 root   root    2333 May  5 22:40 NOTICE 
-drwxr-xr-x  2 root   root     4096  4 juin  16:41 conf +-rw-r----1 root   root    3255 May  5 22:40 README.md 
--rw-r--r--  1 root   root     5409  mai   22:46 CONTRIBUTING.md +-rw-r----1 root   root    6898 May  5 22:40 RELEASE-NOTES 
-drwxr-xr-x  4 root   root     4096  5 mai   22:40 java +-rw-r----1 root   root   16262 May  5 22:40 RUNNING.txt 
--rw-r--r--  1 root   root    38129  mai   22:46 KEYS +drwxr-x--- 2 root   root    4096 Jun  4 21:54 bin 
--rw-r--r--  1 root   root    57092  mai   22:46 LICENSE +drwx------ root   root    4096 May  5 22:40 conf 
--rw-r--r--  1 root   root     2661  mai   22:46 MERGE.txt +drwxr-x--- root   root    4096 Jun  4 21:54 lib 
-drwxr-xr-x  3 root   root     4096  5 mai   22:40 modules +drwxr-x--- root   root    4096 May  5 22:36 logs 
--rw-r--r--  root   root     2333  mai   22:46 NOTICE +drwxr-x--- 2 root   root    4096 Jun  21:54 temp 
--rw-r--r--  1 root   root     3255  5 mai   22:46 README.md +drwxr-x--- root   root    4096 May  5 22:37 webapps 
--rw-r--r--  1 root   root     6991  mai   22:46 RELEASE-NOTES +drwxr-x--- 2 root   root    4096 May  5 22:36 work
-drwxr-xr-x 15 root   root     4096  4 juin  16:41 res +
--rw-r--r--  1 root   root    16451  mai   22:46 RUNNING.txt +
-drwxr-xr-x 24 root   root     4096  5 mai   22:40 test +
-drwxr-xr-x  7 root   root     4096  5 mai   22:40 webapps+
 </code> </code>
  
Line 186: Line 183:
  
  
-==== enable ==== 
  
-divers soucis de droit d'exicution sur les shell scripts de demarrage et presence du repertoire de logs et temp  a corriger :  
- 
-<code> 
-[root@idpx ~]# chmod 754 /opt/tomcat/bin/startup.sh 
-[root@idpx ~]# chmod 754 /opt/tomcat/bin/catalina.sh 
-[root@idpx ~]# mkdir /opt/tomcat/logs/ 
-[root@idpx ~]# chown tomcat:tomcat /opt/tomcat/logs/ 
-[root@idpx ~]# mkdir /opt/tomcat/temp/ 
-[root@idpx ~]# chown tomcat:tomcat /opt/tomcat/temp/ 
- 
-</code> 
  
 ==== start ==== ==== start ====
Line 207: 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 228: 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 237: 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.1591283626.txt.gz · Last modified: 2020/06/04 15:13 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