Advertisement
OldManRiver

Apache2 Config

May 1st, 2021
119
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. I'm running Kubuntu 18.04 LTS with Apache2
  2.  
  3. In Apache config there are 3 files
  4.  
  5. 1.) /etc/hosts: Here is mine
  6. 127.0.0.1 localhost
  7. 127.0.1.1 TBNK-SVR.com
  8. 127.0.2.1 projects.com
  9. 127.0.3.1 TBotNik.com/
  10. 127.0.4.1 Webs-R-Us.com/
  11.  
  12. 2.) /etc/apache2/apache2.conf: Here is mine
  13. # Global configuration
  14. #
  15. ServerRoot "/etc/apache2"
  16. DefaultRuntimeDir ${APACHE_RUN_DIR}
  17. PidFile ${APACHE_PID_FILE}
  18. Timeout 300
  19. KeepAlive On
  20. MaxKeepAliveRequests 100
  21. KeepAliveTimeout 5
  22. User ${APACHE_RUN_USER}
  23. Group ${APACHE_RUN_GROUP}
  24. HostnameLookups Off
  25. ErrorLog ${APACHE_LOG_DIR}/error.log
  26. LogLevel warn
  27. IncludeOptional mods-enabled/*.load
  28. IncludeOptional mods-enabled/*.conf
  29. Include ports.conf
  30. <Directory />
  31. Options FollowSymLinks
  32. AllowOverride All
  33. Order deny,allow
  34. Allow from all
  35. # Require all granted
  36. </Directory>
  37. <Directory /var/www/html>
  38. Options FollowSymLinks
  39. AllowOverride All
  40. Order deny,allow
  41. Allow from all
  42. # Require all granted
  43. </Directory>
  44. <Directory /usr/share>
  45. AllowOverride None
  46. Require all granted
  47. </Directory>
  48. <Directory /3T/Syncs/>
  49. Options Indexes FollowSymLinks
  50. AllowOverride All
  51. Require all granted
  52. </Directory>
  53. <Directory /3T/Syncs/Projects/>
  54. Options Indexes FollowSymLinks
  55. AllowOverride All
  56. Require all granted
  57. </Directory>
  58. <Directory /var/www/>
  59. Options Indexes FollowSymLinks
  60. AllowOverride None
  61. Require all granted
  62. </Directory>
  63. AccessFileName .htaccess
  64. <FilesMatch "^\.ht">
  65. Require all denied
  66. </FilesMatch>
  67. LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
  68. LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
  69. LogFormat "%h %l %u %t \"%r\" %>s %O" common
  70. LogFormat "%{Referer}i -> %U" referer
  71. LogFormat "%{User-agent}i" agent
  72. IncludeOptional conf-enabled/*.conf
  73. IncludeOptional sites-enabled/*.conf
  74.  
  75. 3.) /etc/apache2/sites-available/000-default.conf: Here is mine
  76. <VirtualHost *:80>
  77. ServerAdmin webmaster@localhost
  78. DocumentRoot /var/www/
  79. <Directory /var/www/>
  80. Options Indexes FollowSymLinks MultiViews
  81. AllowOverride All
  82. Order deny,allow
  83. allow from all
  84. </Directory>
  85. ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
  86. <Directory "/usr/lib/cgi-bin">
  87. AllowOverride None
  88. Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
  89. Order allow,deny
  90. Allow from all
  91. </Directory>
  92. # Possible values include: debug, info, notice, warn, error, crit,
  93. # alert, emerg.
  94. LogLevel warn
  95. ErrorLog ${APACHE_LOG_DIR}/error.log
  96. CustomLog ${APACHE_LOG_DIR}/access.log combined
  97. Alias /doc/ "/usr/share/doc/"
  98. <Directory "/usr/share/doc/">
  99. Options Indexes MultiViews FollowSymLinks
  100. AllowOverride None
  101. Order deny,allow
  102. Deny from all
  103. Allow from 127.0.0.0/255.0.0.0 ::1/128
  104. </Directory>
  105. <Location />
  106. Deny from all
  107. Options None
  108. ErrorDocument 403 Forbidden.
  109. </Location>
  110. </VirtualHost>
  111.  
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement