Guest User

Untitled

a guest
Dec 10th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.59 KB | None | 0 0
  1. Syntax error on line 29 of /etc/apache2/sites-enabled/001-example.conf:
  2. <VirtualHost not allowed here
  3. Action 'start' failed.
  4.  
  5. Define server_name example.com
  6. Define home_name example
  7. Define group_name www-data
  8. Define has_ssl 1
  9. Define has_phpmyadmin 1
  10.  
  11. <VirtualHost *:80>
  12. ServerName ${server_name}
  13. ServerAlias www.${server_name}
  14. DocumentRoot /home/${home_name}/public_html
  15.  
  16. ErrorLog ${APACHE_LOG_DIR}/error.${server_name}.log
  17. CustomLog ${APACHE_LOG_DIR}/access.${server_name}.log combined
  18.  
  19. SuexecUserGroup ${home_name} ${group_name}
  20.  
  21. <Directory /home/${home_name}/public_html>
  22. Require all granted
  23. AllowOverride All
  24. </Directory>
  25. # Redireccionar a httpsa
  26. <If "${has_ssl} == '1'">
  27. Redirect permanent / https://${server_name}/
  28. </If>
  29.  
  30. </VirtualHost>
  31.  
  32. <If "${has_ssl} == '1'">
  33. <VirtualHost *:443>
  34. ServerName ${server_name}
  35. ServerAlias www.${server_name}
  36. DocumentRoot /home/${home_name}/public_html
  37.  
  38. ErrorLog ${APACHE_LOG_DIR}/error.${server_name}.log
  39. CustomLog ${APACHE_LOG_DIR}/access.${server_name}.log combined
  40.  
  41. SSLEngine on
  42. SSLCertificateFile /etc/letsencrypt/live/${server_name}/cert.pem
  43. SSLCertificateKeyFile /etc/letsencrypt/live/${server_name}/privkey.pem
  44. SSLCertificateChainFile /etc/letsencrypt/live/${server_name}/chain.pem
  45.  
  46. SuexecUserGroup ${home_name} ${group_name}
  47.  
  48. <Directory /home/${home_name}/public_html>
  49. Require all granted
  50. AllowOverride All
  51. </Directory>
  52.  
  53. </VirtualHost>
  54. </If>
  55.  
  56. <If "${has_phpmyadmin} == '1'">
  57. Include /etc/phpmyadmin/apache.conf
  58. </If>
Add Comment
Please, Sign In to add comment