Guest User

Untitled

a guest
Jan 23rd, 2017
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.69 KB | None | 0 0
  1. I'm using Raspberry as webserver, actually you said that I need to edit this file "conf.d/ssl.conf", I assume that's located inside: "/etc/apache2/sites-available/default-ssl.conf", note that in this folder I've only theese files:
  2.  
  3. 000-default.conf
  4. default-ssl.conf
  5. example.com
  6.  
  7. the "000-default.conf" have this content:
  8.  
  9. <VirtualHost *:80>
  10. ServerAdmin localhost@gmail.com
  11. DocumentRoot /var/www/html/progetti
  12. ErrorLog ${APACHE_LOG_DIR}/error.log
  13. CustomLog ${APACHE_LOG_DIR}/access.log combined
  14.  
  15. <Directory /var/www/html/progetti/>
  16. Options Indexes FollowSymLinks MultiViews
  17. AllowOverride All
  18. Order allow,deny
  19. allow from all
  20. </Directory>
  21.  
  22. </VirtualHost>
  23.  
  24. how you can see all the php application are inside "/var/www/html/progetti". Now the "default-ssl.conf" have this content:
  25.  
  26. <IfModule mod_ssl.c>
  27.  
  28. <VirtualHost *:443>
  29. ServerAlias *.scheduler.com
  30. DocumentRoot "/var/www/html/progetti/scheduler"
  31. </VirtualHost>
  32.  
  33. <VirtualHost _default_:443>
  34. ServerAdmin webmaster@localhost
  35.  
  36. DocumentRoot /var/www/html
  37.  
  38. # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
  39. # error, crit, alert, emerg.
  40. # It is also possible to configure the loglevel for particular
  41. # modules, e.g.
  42. #LogLevel info ssl:warn
  43.  
  44. ErrorLog ${APACHE_LOG_DIR}/error.log
  45. CustomLog ${APACHE_LOG_DIR}/access.log combined
  46.  
  47. # For most configuration files from conf-available/, which are
  48. # enabled or disabled at a global level, it is possible to
  49. # include a line for only one particular virtual host. For example the
  50. # following line enables the CGI configuration for this host only
  51. # after it has been globally disabled with "a2disconf".
  52. #Include conf-available/serve-cgi-bin.conf
  53.  
  54. # SSL Engine Switch:
  55. # Enable/Disable SSL for this virtual host.
  56. SSLEngine on
  57.  
  58. # A self-signed (snakeoil) certificate can be created by installing
  59. # the ssl-cert package. See
  60. # /usr/share/doc/apache2/README.Debian.gz for more info.
  61. # If both key and certificate are stored in the same file, only the
  62. # SSLCertificateFile directive is needed.
  63. SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
  64. SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
  65.  
  66. # Server Certificate Chain:
  67. # Point SSLCertificateChainFile at a file containing the
  68. # concatenation of PEM encoded CA certificates which form the
  69. # certificate chain for the server certificate. Alternatively
  70. # the referenced file can be the same as SSLCertificateFile
  71. # when the CA certificates are directly appended to the server
  72. # certificate for convinience.
  73. #SSLCertificateChainFile /etc/apache2/ssl.crt/server-ca.crt
  74.  
  75. # Certificate Authority (CA):
  76. # Set the CA certificate verification path where to find CA
  77. # certificates for client authentication or alternatively one
  78. # huge file containing all of them (file must be PEM encoded)
  79. # Note: Inside SSLCACertificatePath you need hash symlinks
  80. # to point to the certificate files. Use the provided
  81. # Makefile to update the hash symlinks after changes.
  82. #SSLCACertificatePath /etc/ssl/certs/
  83.  
  84. # Certificate Revocation Lists (CRL):
  85. # Set the CA revocation path where to find CA CRLs for client
  86. # authentication or alternatively one huge file containing all
  87. # of them (file must be PEM encoded)
  88. # Note: Inside SSLCARevocationPath you need hash symlinks
  89. # to point to the certificate files. Use the provided
  90. # Makefile to update the hash symlinks after changes.
  91. #SSLCARevocationPath /etc/apache2/ssl.crl/
  92. #SSLCARevocationFile /etc/apache2/ssl.crl/ca-bundle.crl
  93.  
  94. # Client Authentication (Type):
  95. # Client certificate verification type and depth. Types are
  96. # none, optional, require and optional_no_ca. Depth is a
  97. # number which specifies how deeply to verify the certificate
  98. # issuer chain before deciding the certificate is not valid.
  99. #SSLVerifyClient require
  100. #SSLVerifyDepth 10
  101.  
  102. # SSL Engine Options:
  103. # Set various options for the SSL engine.
  104. # o FakeBasicAuth:
  105. # Translate the client X.509 into a Basic Authorisation. This means that
  106. # the standard Auth/DBMAuth methods can be used for access control. The
  107. # user name is the `one line' version of the client's X.509 certificate.
  108. # Note that no password is obtained from the user. Every entry in the user
  109. # file needs this password: `xxj31ZMTZzkVA'.
  110. # o ExportCertData:
  111. # This exports two additional environment variables: SSL_CLIENT_CERT and
  112. # SSL_SERVER_CERT. These contain the PEM-encoded certificates of the
  113. # server (always existing) and the client (only existing when client
  114. # authentication is used). This can be used to import the certificates
  115. # into CGI scripts.
  116. # o StdEnvVars:
  117. # This exports the standard SSL/TLS related `SSL_*' environment variables.
  118. # Per default this exportation is switched off for performance reasons,
  119. # because the extraction step is an expensive operation and is usually
  120. # useless for serving static content. So one usually enables the
  121. # exportation for CGI and SSI requests only.
  122. # o OptRenegotiate:
  123. # This enables optimized SSL connection renegotiation handling when SSL
  124. # directives are used in per-directory context.
  125. #SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire
  126. <FilesMatch "\.(cgi|shtml|phtml|php)$">
  127. SSLOptions +StdEnvVars
  128. </FilesMatch>
  129. <Directory /usr/lib/cgi-bin>
  130. SSLOptions +StdEnvVars
  131. </Directory>
  132.  
  133. # SSL Protocol Adjustments:
  134. # The safe and default but still SSL/TLS standard compliant shutdown
  135. # approach is that mod_ssl sends the close notify alert but doesn't wait for
  136. # the close notify alert from client. When you need a different shutdown
  137. # approach you can use one of the following variables:
  138. # o ssl-unclean-shutdown:
  139. # This forces an unclean shutdown when the connection is closed, i.e. no
  140. # SSL close notify alert is send or allowed to received. This violates
  141. # the SSL/TLS standard but is needed for some brain-dead browsers. Use
  142. # this when you receive I/O errors because of the standard approach where
  143. # mod_ssl sends the close notify alert.
  144. # o ssl-accurate-shutdown:
  145. # This forces an accurate shutdown when the connection is closed, i.e. a
  146. # SSL close notify alert is send and mod_ssl waits for the close notify
  147. # alert of the client. This is 100% SSL/TLS standard compliant, but in
  148. # practice often causes hanging connections with brain-dead browsers. Use
  149. # this only for browsers where you know that their SSL implementation
  150. # works correctly.
  151. # Notice: Most problems of broken clients are also related to the HTTP
  152. # keep-alive facility, so you usually additionally want to disable
  153. # keep-alive for those clients, too. Use variable "nokeepalive" for this.
  154. # Similarly, one has to force some clients to use HTTP/1.0 to workaround
  155. # their broken HTTP/1.1 implementation. Use variables "downgrade-1.0" and
  156. # "force-response-1.0" for this.
  157. BrowserMatch "MSIE [2-6]" \
  158. nokeepalive ssl-unclean-shutdown \
  159. downgrade-1.0 force-response-1.0
  160. # MSIE 7 and newer should be able to use keepalive
  161. BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown
  162.  
  163. </VirtualHost>
  164. </IfModule>
  165.  
  166. # vim: syntax=apache ts=4 sw=4 sts=4 sr noet
  167.  
  168.  
  169. Now how you can see I've added
  170.  
  171. <VirtualHost *:443>
  172. ServerAlias *.scheduler.com
  173. DocumentRoot "/var/www/html/scheduler/progetti/scheduler"
  174. </VirtualHost>
  175.  
  176. and restarted the apache2 service, but when I add this address in my browser: http://webserver/foo.scheduler.com
  177. I get no redirection to "http://webserver/scheduler", note that I need to display only the app, not to change the url in the browser, thanks.
Add Comment
Please, Sign In to add comment