From 3bc11d1ed64ae5f40df7e0b0a65bf81da45cb538 Mon Sep 17 00:00:00 2001 From: root <ypaula.merino.porras@alumnos.uva.es> Date: Thu, 2 Jun 2022 11:47:46 +0200 Subject: [PATCH] =?UTF-8?q?Archivos=20m=C3=A1quina=2013?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Apache/13/000-default.conf | 40 ++++++ Apache/13/certificates/apache-cert.crt | 31 +++++ Apache/13/certificates/apache.key | 52 ++++++++ Apache/13/default-ssl.conf | 171 +++++++++++++++++++++++++ 4 files changed, 294 insertions(+) create mode 100644 Apache/13/000-default.conf create mode 100644 Apache/13/certificates/apache-cert.crt create mode 100644 Apache/13/certificates/apache.key create mode 100644 Apache/13/default-ssl.conf diff --git a/Apache/13/000-default.conf b/Apache/13/000-default.conf new file mode 100644 index 0000000..9273d15 --- /dev/null +++ b/Apache/13/000-default.conf @@ -0,0 +1,40 @@ +<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.13:443/$1 [L,R=301] + + + +# ********************************************************** +</VirtualHost> + +# vim: syntax=apache ts=4 sw=4 sts=4 sr noet diff --git a/Apache/13/certificates/apache-cert.crt b/Apache/13/certificates/apache-cert.crt new file mode 100644 index 0000000..c48aec4 --- /dev/null +++ b/Apache/13/certificates/apache-cert.crt @@ -0,0 +1,31 @@ +-----BEGIN CERTIFICATE----- +MIIFazCCA1OgAwIBAgIUSE9B/3IJYMA5TNf1IEyPANTPPGQwDQYJKoZIhvcNAQEL +BQAwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoM +GEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDAeFw0yMjA1MTYxNzM0MTFaFw0yMzA1 +MTYxNzM0MTFaMEUxCzAJBgNVBAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEw +HwYDVQQKDBhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQwggIiMA0GCSqGSIb3DQEB +AQUAA4ICDwAwggIKAoICAQCeq2PNRAbl/bymPSz1H0uvIcDq7Svc8vtTt7GnmUpD +l8Yl5p/Ml712YFZFZf6Rnp8A1izpU2KQs/4SLczplyA1SKOI+f9LjC7HD8jXD9Ky +99GJB6ShtTAZijCuu1v6q3ON1D1kHm2gKX+zAhbk/XMuYEe0o1wWQPsyZcHnzKtg +yeoclJDyr+7XsHKVgPc51TSE5Dzk8ZzWay90LIQrwBNmH9F7VNgUB4QvWollS6+O +dwbBvz//Lmm6PipbYrfNQwUYqBAajcEyAj1pLutYjFVJDz25OjkOTqS0WXJFdLHd +v8xXZAYLGUugQO8qZRjjRJZZKXYRzP6ZMWMaPS0crJ9bZshEdHWj+801inSNpWX3 +sDw67LT9sIEZ/Y19RbGUAesuC5rJFDvBgf9Q+73PxCE8hom0daNijQ8skiAO7BnC +sHbu6JoVh6+STTRLNEG3ZVxJyMJr5A7ZiJm0E7gdIflobD1KKcIV4xSQxZc0BQoB +pvXFKV2ogAhiZqIRE9RxZFma9BGmbvtOpZSoYBMVQqiZrCu9qPxF3t9z8nbiM8MP +BDyeNSYJYko4gJhmEmzzyVqXFe6q2JOrbLoPQlc2vO1QsfG8CXzoX9RvkWMB+Fl2 +G8Vc0AIKxTiMh97M0/CV/d8fDMeUmbQNjpeBG45IwDsOirzTJhHMh7Q72/vdDQcs +0wIDAQABo1MwUTAdBgNVHQ4EFgQUQ4kem/8Zlc+8UURuutyDokjUlGYwHwYDVR0j +BBgwFoAUQ4kem/8Zlc+8UURuutyDokjUlGYwDwYDVR0TAQH/BAUwAwEB/zANBgkq +hkiG9w0BAQsFAAOCAgEAGvtnsMlZ3csxDlEbSr6uS2s67KpsvONH1E9w++p4pTx6 +seeSLKGFjbH2QdWP+vQH/8yXf2VD2eaIzT7cBIDUnnY1/HgORkYng9h7KkIm6rRB +fyYcM9LtTvmR7FScOK+x0N1t1YZo0dCpHbR6wdJRhwbsfObYPCKqh2lUAXpmO8b3 +hdTIToKzJY/hP6COXoKJkUpCz7PAxegxjI6/kALUQAYRmv03ut4keP07N4W51Hkp +1la1EQbZbJi+YB9YAbeJERCM0SQl31PR4rNusAYcBhzP4DzxbmgEawD6+ATDaIkG +cIaq3iAwoYnJH3FnAi9T2pQnOXC9A7On/6oOXAfXyhl9MVZ9PXYwzD+lwyU6trQu +bu/0OtPII6fN0An2lDUfBMhdk0fjObnQ3Cs+hBCy32c1IABEsee4oCWV8iaW8m+G +HOwW/ccEZZDDxlToUhuKgGI/5RifAhQ1wlvKIle46wklOBzAw6KVOlunev5E/BB5 +jIuY1RKgcSjxIZkPS4+pYP8e66NBDQtX6oj5haJhCYwllAL3mCuAUr6HR2MzzxGV +ZXFtoctwMBA8TaS4jOmgFmVi2rQqqlgqiC9Hv86yLdODTUcOHom4ZnXmICNCIsNF +arBrJg1mF0bEQdzK1spGjo89m/S27BitBqAGI7JctVaDDUI5+CBqg319SGk1heQ= +-----END CERTIFICATE----- diff --git a/Apache/13/certificates/apache.key b/Apache/13/certificates/apache.key new file mode 100644 index 0000000..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kYDkKnoe1hyHcTTq9CYgg12P5cUULji1x2L/ytlHmqVZDl +QnrYHdrNq3+6D8pIE0uwUirbr6/gEw== +-----END PRIVATE KEY----- diff --git a/Apache/13/default-ssl.conf b/Apache/13/default-ssl.conf new file mode 100644 index 0000000..b7a6869 --- /dev/null +++ b/Apache/13/default-ssl.conf @@ -0,0 +1,171 @@ +<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 - SOLCUION 1 ***************************** +# ************************************************************************************ + +# SSLProxyEngine On +# SSLProxyVerify none +# SSLProxyCheckPeerCN off +# SSLProxyCheckPeerExpire off + + +# <Location /KTRhg_yaxFhjGXYNAWP4iwOxsNqPIoApEWI> +# RewriteEngine on +# 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] +# </Location> + +# ************************************ TFG - SOLUCION 2 ******************************* + + SSLProxyEngine On + SSLProxyVerify none + SSLProxyCheckPeerCN off + SSLProxyCheckPeerExpire off + + + <Location /KTRhg_yaxFhjGXYNAWP4iwOxsNqPIoApEWI> + RewriteEngine on + RewriteCond %{REMOTE_ADDR} 192.168.2.12 + 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.12 + 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.11:443/%{REQUEST_URI}" [L,P] + </Location> + +# ************************************************************************************* + + + </VirtualHost> +</IfModule> + +# vim: syntax=apache ts=4 sw=4 sts=4 sr noet -- GitLab