Guest User

Apache Vhost config

a guest
Oct 26th, 2024
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 KB | Source Code | 0 0
  1. ServerName localdomain.com
  2.  
  3. <VirtualHost *:80>
  4. ServerName api.localdomain.com
  5. DocumentRoot /var/www/myprojectpath/public
  6.  
  7. <Directory "/var/www/myprojectpath">
  8. DirectoryIndex index.php
  9. AllowOverride all
  10. Require all granted
  11.  
  12. RewriteEngine On
  13. RewriteBase /
  14. RewriteCond %{REQUEST_FILENAME} !-f
  15. RewriteCond %{REQUEST_FILENAME} !-d
  16. RewriteRule ^(.*)$ index.php [L]
  17.  
  18. RewriteCond %{REQUEST_METHOD} OPTIONS
  19. RewriteRule ^.*$ - [R=200,L]
  20.  
  21. Header set Access-Control-Allow-Origin "*"
  22. Header set Access-Control-Allow-Methods "HEAD, GET, POST, PUT, PATCH, DELETE, OPTIONS"
  23. Header set Access-Control-Allow-Headers "X-API-KEY, Origin, X-Requested-With, Content-Type, Accept, Access-Control-Request-Method,Access-Control-Request-Headers, Authorization"
  24. </Directory>
  25.  
  26.  
  27. SSLCACertificateFile /var/www/myprojectpath/etc/certs/fnmt.cer
  28. SSLSessionCacheTimeout 600
  29. SSLOptions +StdEnvVars
  30. <Location />
  31. SSLVerifyClient require
  32. SSLVerifyDepth 5
  33. </Location>
  34.  
  35.  
  36. LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" \"%{Cookie}i\"" with_cookies
  37.  
  38. ErrorLog ${APACHE_LOG_DIR}/error.log
  39. CustomLog ${APACHE_LOG_DIR}/access.log combined
  40.  
  41. </VirtualHost>
  42.  
Advertisement
Add Comment
Please, Sign In to add comment