Advertisement
Guest User

estefano

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