Advertisement
Guest User

[ask]apache2 https

a guest
Nov 28th, 2012
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.09 KB | None | 0 0
  1.  
  2. 1 apt-get install openssl ssl-cert
  3. 2 mkdir /etc/apache2/ssl
  4. 3 make-ssl-cert /usr/share/ssl-cert/ssleay.cnf /etc/apache2/ssl/apache.pem
  5. 4 cp /etc/apache2/sites-available/default /etc/apache2/sites-available/ssl
  6.  
  7. this is /etc/apache2/sites-available/ssl
  8.  
  9. -----------------------------------------------
  10. <VirtualHost *:443>
  11. ServerAdmin webmaster@localhost
  12.  
  13. DocumentRoot /var/www
  14. <Directory />
  15. Options FollowSymLinks
  16. AllowOverride None
  17. </Directory>
  18. <Directory /var/www/>
  19. Options Indexes FollowSymLinks MultiViews
  20. AllowOverride None
  21. Order allow,deny
  22. allow from all
  23. </Directory>
  24.  
  25. ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
  26. <Directory "/usr/lib/cgi-bin">
  27. AllowOverride None
  28. Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
  29. Order allow,deny
  30. Allow from all
  31. </Directory>
  32.  
  33. ErrorLog ${APACHE_LOG_DIR}/error.log
  34.  
  35. # Possible values include: debug, info, notice, warn, error, crit,
  36. # alert, emerg.
  37. LogLevel warn
  38.  
  39. CustomLog ${APACHE_LOG_DIR}/access.log combined
  40.  
  41. Alias /doc/ "/usr/share/doc/"
  42. <Directory "/usr/share/doc/">
  43. Options Indexes MultiViews FollowSymLinks
  44. AllowOverride None
  45. Order deny,allow
  46. Deny from all
  47. Allow from 127.0.0.0/255.0.0.0 ::1/128
  48. </Directory>
  49. SSLEngine On
  50. SSLCertificateFile /etc/apache2/ssl/apache2.pem
  51. </VirtualHost>
  52.  
  53. -----------------------------------------------
  54. and this is /etc/apache2/sites-available/ssl /etc/apache2/sites-available/default
  55.  
  56. 5. /etc/init.d/apache2 force-reload
  57. 6. a2ensite ssl
  58. 7. /etc/init.d/apache2 restart
  59. 8. and i try to visit https://localhost i got error
  60.  
  61. Secure Connection Failed
  62.  
  63.  
  64. An error occurred during a connection to localhost.
  65.  
  66. SSL received a record that exceeded the maximum permissible length.
  67.  
  68. (Error code: ssl_error_rx_record_too_long)
  69.  
  70.  
  71. The page you are trying to view cannot be shown because the authenticity of the received data could not be verified.
  72. Please contact the website owners to inform them of this problem. Alternatively, use the command found in the help menu to report this broken site.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement