GarbageYard

ApacheServer VirtualHost

Sep 16th, 2021
828
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Following works fine:
  2. -----------------------------------------------------------------
  3. <VirtualHost *:80>
  4.     ServerName   "devops"
  5.     DocumentRoot "/www/example1/html"
  6.     <Directory />
  7.         AllowOverride None
  8.         Require all granted
  9.     </Directory>
  10.     ErrorLog     "/www/example1/log/error.log"
  11.     CustomLog    "/www/example1/log/access_log" combined
  12. </VirtualHost>
  13. <VirtualHost *:80>
  14.     ServerName   www.mydomain.com
  15.     ServerAlias  mydomain
  16.     DocumentRoot "/www/example2/html"
  17.     <Directory />
  18.         AllowOverride None
  19.         Require all granted
  20.     </Directory>
  21.     ErrorLog     "/www/example2/log/error.log"
  22.     CustomLog    "/www/example2/log/access_log" combined
  23. </VirtualHost>
  24. -----------------------------------------------------------------
  25.  
  26. Following doesn't:
  27. -----------------------------------------------------------------
  28. <VirtualHost 32.64.128.7:80>
  29.    ServerName   "devops"
  30.    DocumentRoot "/www/example1/html"
  31.    <Directory />
  32.        AllowOverride None
  33.        Require all granted
  34.    </Directory>
  35.    ErrorLog     "/www/example1/log/error.log"
  36.    CustomLog    "/www/example1/log/access_log" combined
  37. </VirtualHost>
  38. <VirtualHost *:80>
  39.    ServerName   www.mydomain.com
  40.    ServerAlias  mydomain
  41.    DocumentRoot "/www/example2/html"
  42.    <Directory />
  43.        AllowOverride None
  44.        Require all granted
  45.    </Directory>
  46.    ErrorLog     "/www/example2/log/error.log"
  47.    CustomLog    "/www/example2/log/access_log" combined
  48. </VirtualHost>
  49. -----------------------------------------------------------------
RAW Paste Data