DanPacu

apache conf

Jul 22nd, 2020
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.45 KB | None | 0 0
  1. sudo systemctl status apache2.service
  2. ● apache2.service - The Apache HTTP Server
  3. Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
  4. Active: failed (Result: exit-code) since Wed 2020-07-22 14:29:50 CEST; 2min 7s ago
  5. Docs: https://httpd.apache.org/docs/2.4/
  6. Process: 1247 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE)
  7.  
  8. jul 22 14:29:50 raspberrypi systemd[1]: Starting The Apache HTTP Server...
  9. jul 22 14:29:50 raspberrypi apachectl[1247]: AH00526: Syntax error on line 171 of /etc/apache2/apache2.conf:
  10. jul 22 14:29:50 raspberrypi apachectl[1247]: Either all Options must start with + or -, or no Option may.
  11. jul 22 14:29:50 raspberrypi apachectl[1247]: Action 'start' failed.
  12. jul 22 14:29:50 raspberrypi apachectl[1247]: The Apache error log may have more information.
  13. jul 22 14:29:50 raspberrypi systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE
  14. jul 22 14:29:50 raspberrypi systemd[1]: apache2.service: Failed with result 'exit-code'.
  15. jul 22 14:29:50 raspberrypi systemd[1]: Failed to start The Apache HTTP Server.
  16.  
  17.  
  18.  
  19. El apache2.conf:
  20. This is the main Apache server configuration file. It contains the
  21. # configuration directives that give the server its instructions.
  22. # See http://httpd.apache.org/docs/2.4/ for detailed information about
  23. # the directives and /usr/share/doc/apache2/README.Debian about Debian specific
  24. # hints.
  25. #
  26. #
  27. # Summary of how the Apache 2 configuration works in Debian:
  28. # The Apache 2 web server configuration in Debian is quite different to
  29. # upstream's suggested way to configure the web server. This is because Debian's
  30. # default Apache2 installation attempts to make adding and removing modules,
  31. # virtual hosts, and extra configuration directives as flexible as possible, in
  32. # order to make automating the changes and administering the server as easy as
  33. # possible.
  34.  
  35. # It is split into several files forming the configuration hierarchy outlined
  36. # below, all located in the /etc/apache2/ directory:
  37. #
  38. # /etc/apache2/
  39. # |-- apache2.conf
  40. # | `-- ports.conf
  41. # |-- mods-enabled
  42. # | |-- *.load
  43. # | `-- *.conf
  44. # |-- conf-enabled
  45. # | `-- *.conf
  46. # `-- sites-enabled
  47. # `-- *.conf
  48. #
  49. #
  50. # * apache2.conf is the main configuration file (this file). It puts the pieces
  51. # together by including all remaining configuration files when starting up the
  52. # web server.
  53. #
  54. # * ports.conf is always included from the main configuration file. It is
  55. # supposed to determine listening ports for incoming connections which can be
  56. # customized anytime.
  57. #
  58. # * Configuration files in the mods-enabled/, conf-enabled/ and sites-enabled/
  59. # directories contain particular configuration snippets which manage modules,
  60. They are activated by symlinking available configuration files from their
  61. # respective *-available/ counterparts. These should be managed by using our
  62. # helpers a2enmod/a2dismod, a2ensite/a2dissite and a2enconf/a2disconf. See
  63. # their respective man pages for detailed information.
  64. #
  65. # * The binary is called apache2. Due to the use of environment variables, in
  66. # the default configuration, apache2 needs to be started/stopped with
  67. # /etc/init.d/apache2 or apache2ctl. Calling /usr/bin/apache2 directly will not
  68. # work with the default configuration.
  69.  
  70.  
  71.  
  72. # Global configuration
  73. #
  74.  
  75. #
  76. # ServerRoot: The top of the directory tree under which the server's
  77. # configuration, error, and log files are kept.
  78. #
  79. # NOTE! If you intend to place this on an NFS (or otherwise network)
  80. # mounted filesystem then please read the Mutex documentation (available
  81. # at <URL:http://httpd.apache.org/docs/2.4/mod/core.html#mutex>);
  82. # you will save yourself a lot of trouble.
  83. #
  84. # Do NOT add a slash at the end of the directory path.
  85. #
  86. #ServerRoot "/etc/apache2"
  87.  
  88. #
  89. # The accept serialization lock file MUST BE STORED ON A LOCAL DISK.
  90. #
  91. #Mutex file:${APACHE_LOCK_DIR} default
  92.  
  93. #
  94. # The directory where shm and other runtime files will be stored.
  95. #
  96.  
  97.  
  98. DefaultRuntimeDir ${APACHE_RUN_DIR}
  99.  
  100. #
  101. # PidFile: The file in which the server should record its process
  102. # identification number when it starts.
  103. # This needs to be set in /etc/apache2/envvars
  104. #
  105. PidFile ${APACHE_PID_FILE}
  106.  
  107. #
  108. # Timeout: The number of seconds before receives and sends time out.
  109. #
  110. Timeout 300
  111.  
  112. #
  113. # KeepAlive: Whether or not to allow persistent connections (more than
  114. # one request per connection). Set to "Off" to deactivate.
  115. #
  116. KeepAlive On
  117.  
  118. #
  119. # MaxKeepAliveRequests: The maximum number of requests to allow
  120. # during a persistent connection. Set to 0 to allow an unlimited amount.
  121. # We recommend you leave this number high, for maximum performance.
  122. #
  123. MaxKeepAliveRequests 100
  124.  
  125. #
  126. # KeepAliveTimeout: Number of seconds to wait for the next request from the
  127. # same client on the same connection.
  128. #
  129. KeepAliveTimeout 5
  130.  
  131.  
  132. # These need to be set in /etc/apache2/envvars
  133. User ${APACHE_RUN_USER}
  134. Group ${APACHE_RUN_GROUP}
  135.  
  136. #
  137. # HostnameLookups: Log the names of clients or just their IP addresses
  138. # e.g., www.apache.org (on) or 204.62.129.132 (off).
  139. # The default is off because it'd be overall better for the net if people
  140. # had to knowingly turn this feature on, since enabling it means that
  141. # each client request will result in AT LEAST one lookup request to the
  142. # nameserver.
  143. #
  144. HostnameLookups Off
  145.  
  146. # ErrorLog: The location of the error log file.
  147. # If you do not specify an ErrorLog directive within a <VirtualHost>
  148. # container, error messages relating to that virtual host will be
  149. # logged here. If you *do* define an error logfile for a <VirtualHost>
  150. # container, that host's errors will be logged there and not here.
  151. #
  152. ErrorLog ${APACHE_LOG_DIR}/error.log
  153.  
  154. #
  155. # LogLevel: Control the severity of messages logged to the error_log.
  156. # Available values: trace8, ..., trace1, debug, info, notice, warn,
  157. # error, crit, alert, emerg.
  158. # It is also possible to configure the log level for particular modules, e.g.
  159. # "LogLevel info ssl:warn"
  160. #
  161. LogLevel warn
  162.  
  163. # Include module configuration:
  164. IncludeOptional mods-enabled/*.load
  165. IncludeOptional mods-enabled/*.conf
  166.  
  167. # Include list of ports to listen on
  168. Include ports.conf
  169.  
  170.  
  171. # Sets the default security model of the Apache2 HTTPD server. It does
  172. # not allow access to the root filesystem outside of /usr/share and /var/www.
  173. # The former is used by web applications packaged in Debian,
  174. # the latter may be used for local directories served by the web server. If
  175. # your system is serving content from a sub-directory in /srv you must allow
  176.  
  177. <Directory />
  178. Options FollowSymLinks
  179. AllowOverride All
  180. Require all denied
  181. </Directory>
  182.  
  183. <Directory /usr/share>
  184. AllowOverride None
  185. Require all granted
  186. </Directory>
  187.  
  188. <Directory /var/www/>
  189. Options Indexes +FollowSymLinks
  190. AllowOverride All
  191. Require all granted
  192. </Directory>
  193.  
  194. #<Directory /srv/>
  195. # Options Indexes FollowSymLinks
  196. # AllowOverride None
  197. # Require all granted
  198. #</Directory>
  199.  
  200.  
  201.  
  202.  
  203. # AccessFileName: The name of the file to look for in each directory
  204. # for additional configuration directives. See also the AllowOverride
  205. # directive.
  206. #
  207. AccessFileName .htaccess
  208.  
  209. #
  210. # The following lines prevent .htaccess and .htpasswd files from being
  211. # viewed by Web clients.
  212. #
  213. <FilesMatch "^\.ht">
  214. Require all denied
  215. </FilesMatch>
  216.  
  217.  
  218. #
  219. # The following directives define some format nicknames for use with
  220. # a CustomLog directive.
  221. #
  222. # These deviate from the Common Log Format definitions in that they use %O
  223. # (the actual bytes sent including headers) instead of %b (the size of the
  224. # requested file), because the latter makes it impossible to detect partial
  225. # requests.
  226. #
  227. # Note that the use of %{X-Forwarded-For}i instead of %h is not recommended.
  228. # Use mod_remoteip instead.
  229. #
  230. LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
  231. LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
  232. LogFormat "%h %l %u %t \"%r\" %>s %O" common
  233.  
  234. LogFormat "%{Referer}i -> %U" referer
  235. LogFormat "%{User-agent}i" agent
  236.  
  237. # Include of directories ignores editors' and dpkg's backup files,
  238. # see README.Debian for details.
  239.  
  240. # Include generic snippets of statements
  241. IncludeOptional conf-enabled/*.conf
  242.  
  243. # Include the virtual host configurations:
  244. IncludeOptional sites-enabled/*.conf
  245.  
  246. # vim: syntax=apache ts=4 sw=4 sts=4 sr noet
Advertisement
Add Comment
Please, Sign In to add comment