vhost 1.2 KB

123456789101112131415161718192021222324252627282930313233
  1. # -*- mode: snippet -*-
  2. # name: vhost
  3. # key: vhost
  4. # --
  5. <VirtualHost 127.0.0.1:${1:port}>
  6. ServerName ${2:domain}
  7. ServerAlias www.${2:domain}
  8. ScriptAlias /cgi-bin /home/${3:web-root}/${2:domain}/www/cgi-bin
  9. DocumentRoot /home/${3:web-root}/${2:domain}/www
  10. <Directory /home/${3:web-root}/${2:domain}/www>
  11. Options +FollowSymLinks -MultiViews +Includes -ExecCGI
  12. DirectoryIndex index.php index.html index.htm
  13. Require all granted
  14. AllowOverride all
  15. </Directory>
  16. AddDefaultCharset UTF-8
  17. UseCanonicalName Off
  18. AddHandler server-parsed .shtml .shtm
  19. php_admin_flag allow_url_fopen on
  20. php_admin_value mbstring.func_overload 0
  21. # php_admin_value opcache.file_cache "/opcache/5cebd4b5b5259b00018a63f7"
  22. <IfModule mod_setenvif.c>
  23. SetEnvIf X-Forwarded-Proto https HTTPS=on
  24. SetEnvIf X-Forwarded-Proto https PORT=443
  25. </IfModule>
  26. <IfFile /home/${3:web-root}/logs>
  27. CustomLog /home/${3:web-root}/logs/www.${2:domain}-access.log common-time
  28. ErrorLog /home/${3:web-root}/logs/www.${2:domain}-error_log
  29. </IfFile>
  30. MaxClientsVHost 20
  31. AssignUserID "#${4:user}" "#${4:user}"
  32. </VirtualHost>