From 2f7bd8c32ab83e6a116a5b92628d981f1f096e4c Mon Sep 17 00:00:00 2001 From: root <paula.merino.porras@alumnos.uva.es> Date: Thu, 2 Jun 2022 11:41:32 +0200 Subject: [PATCH] =?UTF-8?q?Archivos=20m=C3=A1quina=2012?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Apache/12/000-default.conf | 43 +++++++ Apache/12/certificates/apache-cert.crt | 31 +++++ Apache/12/certificates/apache.key | 52 +++++++++ Apache/12/default-ssl.conf | 155 +++++++++++++++++++++++++ 4 files changed, 281 insertions(+) create mode 100644 Apache/12/000-default.conf create mode 100644 Apache/12/certificates/apache-cert.crt create mode 100644 Apache/12/certificates/apache.key create mode 100644 Apache/12/default-ssl.conf diff --git a/Apache/12/000-default.conf b/Apache/12/000-default.conf new file mode 100644 index 0000000..0afe6d5 --- /dev/null +++ b/Apache/12/000-default.conf @@ -0,0 +1,43 @@ +<VirtualHost *:80> + # The ServerName directive sets the request scheme, hostname and port that + # the server uses to identify itself. This is used when creating + # redirection URLs. In the context of virtual hosts, the ServerName + # specifies what hostname must appear in the request's Host: header to + # match this virtual host. For the default virtual host (this file) this + # value is not decisive as it is used as a last resort host regardless. + # However, you must set it for any further virtual host explicitly. + #ServerName www.example.com + + ServerAdmin webmaster@localhost + DocumentRoot /var/www/html + + # Available loglevels: trace8, ..., trace1, debug, info, notice, warn, + # error, crit, alert, emerg. + # It is also possible to configure the loglevel for particular + # modules, e.g. + #LogLevel info ssl:warn + + ErrorLog ${APACHE_LOG_DIR}/error.log + CustomLog ${APACHE_LOG_DIR}/access.log combined + + # For most configuration files from conf-available/, which are + # enabled or disabled at a global level, it is possible to + # include a line for only one particular virtual host. For example the + # following line enables the CGI configuration for this host only + # after it has been globally disabled with "a2disconf". + #Include conf-available/serve-cgi-bin.conf + +# ************************* TFG **************************** + + RewriteEngine On + RewriteCond %{HTTPS} off + RewriteRule ^(.*)$ https://192.168.2.12:443/$1 [L,R=301] + + + +# ********************************************************** + + +</VirtualHost> + +# vim: syntax=apache ts=4 sw=4 sts=4 sr noet diff --git a/Apache/12/certificates/apache-cert.crt b/Apache/12/certificates/apache-cert.crt new file mode 100644 index 0000000..9ac23be --- /dev/null +++ b/Apache/12/certificates/apache-cert.crt @@ -0,0 +1,31 @@ +-----BEGIN CERTIFICATE----- +MIIFazCCA1OgAwIBAgIUTr6dKW/DLq2hndac/YkLCy3ViikwDQYJKoZIhvcNAQEL +BQAwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoM +GEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDAeFw0yMjA1MjUxNTUwMDNaFw0yMzA1 +MjUxNTUwMDNaMEUxCzAJBgNVBAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEw +HwYDVQQKDBhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQwggIiMA0GCSqGSIb3DQEB +AQUAA4ICDwAwggIKAoICAQCpDpKDqcuMQsCYRmU9MJK0yqn/mGFFs6hJSaB6qjo+ +44r30U3gQc4ZsEJpMhZ/CzP5mOwJ4ohc8jAr+MjNnqQIf/1/cbhu898OYLGPedrV +RHdGioiiPm+hlU5NAy5neaV+k2OLvJvq9faPUYU/U87xz4xMkD0fJ9f2iIgSQQug +tepSS23I23Hyf0swFeboAyO8D1Z1N/WjJ2DuYWoqtPtXtd3vN2RmS+TYv54+kyFN +TLvatQL8Pxb8V/62lkl6nKofYKMo14LD7IAgK7CgCYsYIpnx/5OsGOphzXrFdCTd +6pTX4NcP5ZmZc0eyF2Hwla73X/bajgxCAGmxRoT0bXUtMJW/ZxMg3+udfZS2FHPD +5P0pOmWX2aJLxYHz1lOZmJQl9H3TDB8Zyy+fbSWmL09jz/m/lmKaeLa9V/ejvXaQ +PiM+XIhSo/p5kfsg2dUmNQh8sG2tuOxm1L7HfACUZqFoTpA/zO6iwrEFrZaMKJLH +PH91uxVZUS/+KPZxMWbHItdqLEqWB0w1ew14ampxwh82tmbzgpFAQlzicrPQDHtn +PldkoFjGTkxB0LyKftffrzeMNPheq0EMGdl/r5ikKna6FOxRKFHD7iBP2h0xHur4 +6s+62Tx/usq6pnGtavzAgwTFwc9USQqnxDR9RZftw9I/aUDW2PbiZOBnQPaWEN1y +owIDAQABo1MwUTAdBgNVHQ4EFgQUj0r09CU040XVF+dsRb3qNDEp00MwHwYDVR0j +BBgwFoAUj0r09CU040XVF+dsRb3qNDEp00MwDwYDVR0TAQH/BAUwAwEB/zANBgkq +hkiG9w0BAQsFAAOCAgEAWPvoqLghUPh0ZYe1kbnmmupcbaXiZuBtJ8R3ia+idvRf +ZG+hU+Bcivq6WtqCTG9z/ABO4bE0e0X75ULRMqWIbLLnlFmOYrgdbbb5LRQeTmTn +EZSgwyZ6JsUzd4phtS0HqerNjjy9qNahwhKiOXBS+MtmZSiS7XvKXoFDHNcNsIxk +J8cvli29J3lIpr5Wl7pwKzZuPdug7uOTg7WgAjX/S6H7eJw3SbeCSN7N7a5KsPYK +EySWDmOA+LmRdsuQXvwHcOb3btTj27ESBWMNSW1Bmn123xhOITB8nOXvST0uquMJ +bD5oHcky22ZnArzDaL74aW74CRg0h4lL9M6/j2dNxWkMz+v5qd+kJG8pYXnalP7J +95wCxQe8NFTN7heJohAPkgoApbY+jZVoh0A8QBleCtj4bicuilqCqunPZ3JPgkmv +X3t7K8G8DG2L00bVtJxKLSZdO3wcRevMBummg7CIj3Lq6S5E4UjCIscYNSsoQaLN +fC8Sq3sK/Uruhkzfe1u5OPWNR9anHVpFVUECgci6amKneNPIolj7NBKvVxyT8zVg +8K2aNSjMZnirt1t/aak2ZnriYJQmWLOZAuV/0+9TTaHUxrmhQXGOlY/I+8vcmTA5 +oTUzkvdjEwSHA4LzjrYT/IdzY138tsvtBU+MjOkcrVnCEP2VDTKw1bf/1rxkVLE= +-----END CERTIFICATE----- diff --git a/Apache/12/certificates/apache.key b/Apache/12/certificates/apache.key new file mode 100644 index 0000000..1d42c06 --- /dev/null +++ b/Apache/12/certificates/apache.key @@ -0,0 +1,52 @@ +-----BEGIN PRIVATE KEY----- +MIIJQgIBADANBgkqhkiG9w0BAQEFAASCCSwwggkoAgEAAoICAQCpDpKDqcuMQsCY +RmU9MJK0yqn/mGFFs6hJSaB6qjo+44r30U3gQc4ZsEJpMhZ/CzP5mOwJ4ohc8jAr ++MjNnqQIf/1/cbhu898OYLGPedrVRHdGioiiPm+hlU5NAy5neaV+k2OLvJvq9faP +UYU/U87xz4xMkD0fJ9f2iIgSQQugtepSS23I23Hyf0swFeboAyO8D1Z1N/WjJ2Du +YWoqtPtXtd3vN2RmS+TYv54+kyFNTLvatQL8Pxb8V/62lkl6nKofYKMo14LD7IAg +K7CgCYsYIpnx/5OsGOphzXrFdCTd6pTX4NcP5ZmZc0eyF2Hwla73X/bajgxCAGmx +RoT0bXUtMJW/ZxMg3+udfZS2FHPD5P0pOmWX2aJLxYHz1lOZmJQl9H3TDB8Zyy+f +bSWmL09jz/m/lmKaeLa9V/ejvXaQPiM+XIhSo/p5kfsg2dUmNQh8sG2tuOxm1L7H +fACUZqFoTpA/zO6iwrEFrZaMKJLHPH91uxVZUS/+KPZxMWbHItdqLEqWB0w1ew14 +ampxwh82tmbzgpFAQlzicrPQDHtnPldkoFjGTkxB0LyKftffrzeMNPheq0EMGdl/ +r5ikKna6FOxRKFHD7iBP2h0xHur46s+62Tx/usq6pnGtavzAgwTFwc9USQqnxDR9 +RZftw9I/aUDW2PbiZOBnQPaWEN1yowIDAQABAoICAQCP5/qqHyBIng3p0YqeQrmv +MhDxpNmwhpULBaSYpkz8eZ8zArUi34E8dsChYWSq8nNk1Vqfs3jWfcapt5XfClqh +banxEXGo6OkICSE8e8Le5fAOWSCj0zgdOMY1Yi7fIDrS+02yhnPG12bxarhdRs8T +IdRQ3DtbSQRaNLB3sWzfedskAFdMshhWDyuGnC45c2q4y+mR0HfFUWD+qmfAQNzv +Nb3cwq8xMQt1we9HXuDrNxV1v73x0RaU6abF8DpO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PcEdkSbpFOkt/qkg +dHxTeST2iBDPvrQyTTpshiv+z5XqDQ== +-----END PRIVATE KEY----- diff --git a/Apache/12/default-ssl.conf b/Apache/12/default-ssl.conf new file mode 100644 index 0000000..737f6dc --- /dev/null +++ b/Apache/12/default-ssl.conf @@ -0,0 +1,155 @@ +<IfModule mod_ssl.c> + <VirtualHost _default_:443> + ServerAdmin webmaster@localhost + + DocumentRoot /var/www/html + + # Available loglevels: trace8, ..., trace1, debug, info, notice, warn, + # error, crit, alert, emerg. + # It is also possible to configure the loglevel for particular + # modules, e.g. + #LogLevel info ssl:warn + + ErrorLog ${APACHE_LOG_DIR}/error.log + CustomLog ${APACHE_LOG_DIR}/access.log combined + + # For most configuration files from conf-available/, which are + # enabled or disabled at a global level, it is possible to + # include a line for only one particular virtual host. For example the + # following line enables the CGI configuration for this host only + # after it has been globally disabled with "a2disconf". + #Include conf-available/serve-cgi-bin.conf + + # SSL Engine Switch: + # Enable/Disable SSL for this virtual host. + SSLEngine on + + # A self-signed (snakeoil) certificate can be created by installing + # the ssl-cert package. See + # /usr/share/doc/apache2/README.Debian.gz for more info. + # If both key and certificate are stored in the same file, only the + # SSLCertificateFile directive is needed. + SSLCertificateFile /etc/apache2/certificates/apache-cert.crt + SSLCertificateKeyFile /etc/apache2/certificates/apache.key + + # Server Certificate Chain: + # Point SSLCertificateChainFile at a file containing the + # concatenation of PEM encoded CA certificates which form the + # certificate chain for the server certificate. Alternatively + # the referenced file can be the same as SSLCertificateFile + # when the CA certificates are directly appended to the server + # certificate for convinience. + #SSLCertificateChainFile /etc/apache2/ssl.crt/server-ca.crt + + # Certificate Authority (CA): + # Set the CA certificate verification path where to find CA + # certificates for client authentication or alternatively one + # huge file containing all of them (file must be PEM encoded) + # Note: Inside SSLCACertificatePath you need hash symlinks + # to point to the certificate files. Use the provided + # Makefile to update the hash symlinks after changes. + #SSLCACertificatePath /etc/ssl/certs/ + #SSLCACertificateFile /etc/apache2/ssl.crt/ca-bundle.crt + + # Certificate Revocation Lists (CRL): + # Set the CA revocation path where to find CA CRLs for client + # authentication or alternatively one huge file containing all + # of them (file must be PEM encoded) + # Note: Inside SSLCARevocationPath you need hash symlinks + # to point to the certificate files. Use the provided + # Makefile to update the hash symlinks after changes. + #SSLCARevocationPath /etc/apache2/ssl.crl/ + #SSLCARevocationFile /etc/apache2/ssl.crl/ca-bundle.crl + + # Client Authentication (Type): + # Client certificate verification type and depth. Types are + # none, optional, require and optional_no_ca. Depth is a + # number which specifies how deeply to verify the certificate + # issuer chain before deciding the certificate is not valid. + #SSLVerifyClient require + #SSLVerifyDepth 10 + + # SSL Engine Options: + # Set various options for the SSL engine. + # o FakeBasicAuth: + # Translate the client X.509 into a Basic Authorisation. This means that + # the standard Auth/DBMAuth methods can be used for access control. The + # user name is the `one line' version of the client's X.509 certificate. + # Note that no password is obtained from the user. Every entry in the user + # file needs this password: `xxj31ZMTZzkVA'. + # o ExportCertData: + # This exports two additional environment variables: SSL_CLIENT_CERT and + # SSL_SERVER_CERT. These contain the PEM-encoded certificates of the + # server (always existing) and the client (only existing when client + # authentication is used). This can be used to import the certificates + # into CGI scripts. + # o StdEnvVars: + # This exports the standard SSL/TLS related `SSL_*' environment variables. + # Per default this exportation is switched off for performance reasons, + # because the extraction step is an expensive operation and is usually + # useless for serving static content. So one usually enables the + # exportation for CGI and SSI requests only. + # o OptRenegotiate: + # This enables optimized SSL connection renegotiation handling when SSL + # directives are used in per-directory context. + #SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire + <FilesMatch "\.(cgi|shtml|phtml|php)$"> + SSLOptions +StdEnvVars + </FilesMatch> + <Directory /usr/lib/cgi-bin> + SSLOptions +StdEnvVars + </Directory> + + # SSL Protocol Adjustments: + # The safe and default but still SSL/TLS standard compliant shutdown + # approach is that mod_ssl sends the close notify alert but doesn't wait for + # the close notify alert from client. When you need a different shutdown + # approach you can use one of the following variables: + # o ssl-unclean-shutdown: + # This forces an unclean shutdown when the connection is closed, i.e. no + # SSL close notify alert is send or allowed to received. This violates + # the SSL/TLS standard but is needed for some brain-dead browsers. Use + # this when you receive I/O errors because of the standard approach where + # mod_ssl sends the close notify alert. + # o ssl-accurate-shutdown: + # This forces an accurate shutdown when the connection is closed, i.e. a + # SSL close notify alert is send and mod_ssl waits for the close notify + # alert of the client. This is 100% SSL/TLS standard compliant, but in + # practice often causes hanging connections with brain-dead browsers. Use + # this only for browsers where you know that their SSL implementation + # works correctly. + # Notice: Most problems of broken clients are also related to the HTTP + # keep-alive facility, so you usually additionally want to disable + # keep-alive for those clients, too. Use variable "nokeepalive" for this. + # Similarly, one has to force some clients to use HTTP/1.0 to workaround + # their broken HTTP/1.1 implementation. Use variables "downgrade-1.0" and + # "force-response-1.0" for this. + # BrowserMatch "MSIE [2-6]" \ + # nokeepalive ssl-unclean-shutdown \ + # downgrade-1.0 force-response-1.0 + + +# *************************************** TFG SOLUCION 2 ******************************* + SSLProxyEngine On + SSLProxyVerify none + SSLProxyCheckPeerCN off + SSLProxyCheckPeerExpire off + + + <Location /KTRhg_yaxFhjGXYNAWP4iwOxsNqPIoApEWI> + RewriteEngine on + RewriteCond %{REMOTE_ADDR} 192.168.2.14 + RewriteCond %{HTTP_USER_AGENT} "=Mozilla/5.0 (Macintosh; Intel Mac OS X 12_2_1) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.2 Safari/605.1.15" + RewriteRule ^(.*)$ "https://192.168.1.40:443/%{REQUEST_URI}" [L,P] + + RewriteCond %{REMOTE_ADDR} !192.168.2.14 + RewriteCond %{HTTP_USER_AGENT} "=Mozilla/5.0 (Macintosh; Intel Mac OS X 12_2_1) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.2 Safari/605.1.15" + RewriteRule ^(.*)$ "https://192.168.2.13:443/%{REQUEST_URI}" [L,P] + </Location> + +# ************************************************************************************** + + </VirtualHost> +</IfModule> + +# vim: syntax=apache ts=4 sw=4 sts=4 sr noet -- GitLab