Advertisement
Guest User

apache config file performance issue

a guest
Mar 9th, 2012
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.54 KB | None | 0 0
  1. #
  2. # This is the main Apache HTTP server configuration file. It contains the
  3. # configuration directives that give the server its instructions.
  4. # See <URL:http://httpd.apache.org/docs/2.2> for detailed information.
  5. # In particular, see
  6. # <URL:http://httpd.apache.org/docs/2.2/mod/directives.html>
  7. # for a discussion of each configuration directive.
  8. #
  9. # Do NOT simply read the instructions in here without understanding
  10. # what they do. They're here only as hints or reminders. If you are unsure
  11. # consult the online docs. You have been warned.
  12. #
  13. # Configuration and logfile names: If the filenames you specify for many
  14. # of the server's control files begin with "/" (or "drive:/" for Win32), the
  15. # server will use that explicit path. If the filenames do *not* begin
  16. # with "/", the value of ServerRoot is prepended -- so "logs/foo.log"
  17. # with ServerRoot set to "@@ServerRoot@@" will be interpreted by the
  18. # server as "@@ServerRoot@@/logs/foo.log".
  19.  
  20. #
  21. # ServerRoot: The top of the directory tree under which the server's
  22. # configuration, error, and log files are kept.
  23. #
  24. # Do not add a slash at the end of the directory path. If you point
  25. # ServerRoot at a non-local disk, be sure to point the LockFile directive
  26. # at a local disk. If you wish to share the same ServerRoot for multiple
  27. # httpd daemons, you will need to change at least LockFile and PidFile.
  28. #
  29. ServerRoot "/usr/syno/apache"
  30.  
  31. #
  32. # Listen: Allows you to bind Apache to specific IP addresses and/or
  33. # ports, instead of the default. See also the <VirtualHost>
  34. # directive.
  35. #
  36. # Change this to Listen on specific IP addresses as shown below to
  37. # prevent Apache from glomming onto all bound IP addresses.
  38. #
  39. #Listen 12.34.56.78:80
  40. Listen 80
  41.  
  42. #
  43. # Dynamic Shared Object (DSO) Support
  44. #
  45. # To be able to use the functionality of a module which was built as a DSO you
  46. # have to place corresponding `LoadModule' lines at this location so the
  47. # directives contained in it are actually available _before_ they are used.
  48. # Statically compiled modules (those listed by `httpd -l') do not need
  49. # to be loaded here.
  50. #
  51. # Example:
  52. # LoadModule foo_module modules/mod_foo.so
  53. LoadModule rewrite_module modules/mod_rewrite.so
  54.  
  55. <IfModule !mpm_netware_module>
  56. #
  57. # If you wish httpd to run as a different user or group, you must run
  58. # httpd as root initially and it will switch.
  59. #
  60. # User/Group: The name (or #number) of the user/group to run httpd as.
  61. # It is usually good practice to create a dedicated user and group for
  62. # running httpd, as with most system services.
  63. #
  64. User nobody
  65. Group nobody
  66. </IfModule>
  67.  
  68. # 'Main' server configuration
  69. #
  70. # The directives in this section set up the values used by the 'main'
  71. # server, which responds to any requests that aren't handled by a
  72. # <VirtualHost> definition. These values also provide defaults for
  73. # any <VirtualHost> containers you may define later in the file.
  74. #
  75. # All of these directives may appear inside <VirtualHost> containers,
  76. # in which case these default settings will be overridden for the
  77. # virtual host being defined.
  78. #
  79.  
  80. #
  81. # ServerAdmin: Your address, where problems with the server should be
  82. # e-mailed. This address appears on some server-generated pages, such
  83. # as error documents. e.g. admin@your-domain.com
  84. #
  85. ServerAdmin admin
  86.  
  87. #
  88. # ServerName gives the name and port that the server uses to identify itself.
  89. # This can often be determined automatically, but we recommend you specify
  90. # it explicitly to prevent problems during startup.
  91. #
  92. # If your host doesn't have a registered DNS name, enter its IP address here.
  93. #
  94. ServerName *:80
  95.  
  96. #
  97. # DocumentRoot: The directory out of which you will serve your
  98. # documents. By default, all requests are taken from this directory, but
  99. # symbolic links and aliases may be used to point to other locations.
  100. #
  101. #DocumentRoot "/var/services/web"
  102.  
  103. #
  104. # Each directory to which Apache has access can be configured with respect
  105. # to which services and features are allowed and/or disabled in that
  106. # directory (and its subdirectories).
  107. #
  108. # First, we configure the "default" to be a very restrictive set of
  109. # features.
  110. #
  111. <Directory />
  112. Options FollowSymLinks
  113. AllowOverride All
  114. </Directory>
  115.  
  116. #
  117. # Note that from this point forward you must specifically allow
  118. # particular features to be enabled - so if something's not working as
  119. # you might expect, make sure that you have specifically enabled it
  120. # below.
  121. #
  122.  
  123. #
  124. # This should be changed to whatever you set DocumentRoot to.
  125. #
  126. <Directory "/var/services/web">
  127. #
  128. # Possible values for the Options directive are "None", "All",
  129. # or any combination of:
  130. # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
  131. #
  132. # Note that "MultiViews" must be named *explicitly* --- "Options All"
  133. # doesn't give it to you.
  134. #
  135. # The Options directive is both complicated and important. Please see
  136. # http://httpd.apache.org/docs/2.2/mod/core.html#options
  137. # for more information.
  138. #
  139. Options MultiViews FollowSymLinks ExecCGI
  140.  
  141. #
  142. # AllowOverride controls what directives may be placed in .htaccess files.
  143. # It can be "All", "None", or any combination of the keywords:
  144. # Options FileInfo AuthConfig Limit
  145. #
  146. AllowOverride All
  147.  
  148. #
  149. # Controls who can get stuff from this server.
  150. #
  151. Order allow,deny
  152. Allow from all
  153.  
  154. </Directory>
  155.  
  156. <Directory "/usr/syno/synoman/phpsrc/web">
  157. #
  158. # Possible values for the Options directive are "None", "All",
  159. # or any combination of:
  160. # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
  161. #
  162. # Note that "MultiViews" must be named *explicitly* --- "Options All"
  163. # doesn't give it to you.
  164. #
  165. # The Options directive is both complicated and important. Please see
  166. # http://httpd.apache.org/docs/2.2/mod/core.html#options
  167. # for more information.
  168. #
  169. Options MultiViews FollowSymLinks ExecCGI
  170.  
  171. #
  172. # AllowOverride controls what directives may be placed in .htaccess files.
  173. # It can be "All", "None", or any combination of the keywords:
  174. # Options FileInfo AuthConfig Limit
  175. #
  176. AllowOverride None
  177.  
  178. #
  179. # Controls who can get stuff from this server.
  180. #
  181. Order allow,deny
  182. Allow from all
  183.  
  184. </Directory>
  185.  
  186. <Directory "/usr/syno/synoman/empty/web">
  187. #
  188. # Possible values for the Options directive are "None", "All",
  189. # or any combination of:
  190. # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
  191. #
  192. # Note that "MultiViews" must be named *explicitly* --- "Options All"
  193. # doesn't give it to you.
  194. #
  195. # The Options directive is both complicated and important. Please see
  196. # http://httpd.apache.org/docs/2.2/mod/core.html#options
  197. # for more information.
  198. #
  199. Options MultiViews FollowSymLinks ExecCGI
  200.  
  201. #
  202. # AllowOverride controls what directives may be placed in .htaccess files.
  203. # It can be "All", "None", or any combination of the keywords:
  204. # Options FileInfo AuthConfig Limit
  205. #
  206. AllowOverride None
  207.  
  208. #
  209. # Controls who can get stuff from this server.
  210. #
  211. Order allow,deny
  212. Allow from all
  213.  
  214. </Directory>
  215. #
  216. # DirectoryIndex: sets the file that Apache will serve if a directory
  217. # is requested.
  218. #
  219. <IfModule dir_module>
  220. DirectoryIndex index.html index.htm index.cgi index.php index.php3
  221. </IfModule>
  222.  
  223. #
  224. # The following lines prevent .htaccess and .htpasswd files from being
  225. # viewed by Web clients.
  226. #
  227. <FilesMatch "^\.ht">
  228. Order allow,deny
  229. Deny from all
  230. Satisfy All
  231. </FilesMatch>
  232.  
  233. #
  234. # ErrorLog: The location of the error log file.
  235. # If you do not specify an ErrorLog directive within a <VirtualHost>
  236. # container, error messages relating to that virtual host will be
  237. # logged here. If you *do* define an error logfile for a <VirtualHost>
  238. # container, that host's errors will be logged there and not here.
  239. #
  240. #ErrorLog /var/log/httpd-error-user.log
  241. ErrorLog /dev/null
  242. TraceEnable off
  243.  
  244. #
  245. # LogLevel: Control the number of messages logged to the error_log.
  246. # Possible values include: debug, info, notice, warn, error, crit,
  247. # alert, emerg.
  248. #
  249. #LogLevel debug
  250. LogLevel warn
  251.  
  252. <IfModule log_config_module>
  253. #
  254. # The following directives define some format nicknames for use with
  255. # a CustomLog directive (see below).
  256. #
  257. LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
  258. LogFormat "%h %l %u %t \"%r\" %>s %b" common
  259.  
  260. <IfModule logio_module>
  261. # You need to enable mod_logio.c to use %I and %O
  262. LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
  263. </IfModule>
  264.  
  265. #
  266. # The location and format of the access logfile (Common Logfile Format).
  267. # If you do not define any access logfiles within a <VirtualHost>
  268. # container, they will be logged here. Contrariwise, if you *do*
  269. # define per-<VirtualHost> access logfiles, transactions will be
  270. # logged therein and *not* in this file.
  271. #
  272. #CustomLog /var/log/httpd-access-user.log combined
  273. CustomLog /dev/null combined
  274.  
  275. #
  276. # If you prefer a logfile with access, agent, and referer information
  277. # (Combined Logfile Format) you can use the following directive.
  278. #
  279. #CustomLog logs/access_log combined
  280. </IfModule>
  281.  
  282. <IfModule alias_module>
  283. #
  284. # Redirect: Allows you to tell clients about documents that used to
  285. # exist in your server's namespace, but do not anymore. The client
  286. # will make a new request for the document at its new location.
  287. # Example:
  288. # Redirect permanent /foo http://www.example.com/bar
  289.  
  290. #
  291. # Alias: Maps web paths into filesystem paths and is used to
  292. # access content that does not live under the DocumentRoot.
  293. # Example:
  294. # Alias /webpath /full/filesystem/path
  295. #
  296. # If you include a trailing / on /webpath then the server will
  297. # require it to be present in the URL. You will also likely
  298. # need to provide a <Directory> section to allow access to
  299. # the filesystem path.
  300.  
  301. #
  302. # ScriptAlias: This controls which directories contain server scripts.
  303. # ScriptAliases are essentially the same as Aliases, except that
  304. # documents in the target directory are treated as applications and
  305. # run by the server when requested rather than as documents sent to the
  306. # client. The same rules about trailing "/" apply to ScriptAlias
  307. # directives as to Alias.
  308. #
  309. #ScriptAlias /cgi-bin/ "/usr/syno/apache/cgi-bin/"
  310.  
  311. </IfModule>
  312.  
  313. <IfModule cgid_module>
  314. #
  315. # ScriptSock: On threaded servers, designate the path to the UNIX
  316. # socket used to communicate with the CGI daemon of mod_cgid.
  317. #
  318. #Scriptsock logs/cgisock
  319. </IfModule>
  320.  
  321. #
  322. # "/usr/syno/apache/cgi-bin" should be changed to whatever your ScriptAliased
  323. # CGI directory exists, if you have that configured.
  324. #
  325. #<Directory "/usr/syno/apache/cgi-bin">
  326. # AllowOverride None
  327. # Options None
  328. # Order allow,deny
  329. # Allow from all
  330. #</Directory>
  331.  
  332. #
  333. # DefaultType: the default MIME type the server will use for a document
  334. # if it cannot otherwise determine one, such as from filename extensions.
  335. # If your server contains mostly text or HTML documents, "text/plain" is
  336. # a good value. If most of your content is binary, such as applications
  337. # or images, you may want to use "application/octet-stream" instead to
  338. # keep browsers from trying to display binary files as though they are
  339. # text.
  340. #
  341. DefaultType text/plain
  342.  
  343. <IfModule mime_module>
  344. #
  345. # TypesConfig points to the file containing the list of mappings from
  346. # filename extension to MIME-type.
  347. #
  348. TypesConfig /usr/syno/apache/conf/mime.types
  349.  
  350. #
  351. # AddType allows you to add to or override the MIME configuration
  352. # file specified in TypesConfig for specific file types.
  353. #
  354. #AddType application/x-gzip .tgz
  355. #
  356. # AddEncoding allows you to have certain browsers uncompress
  357. # information on the fly. Note: Not all browsers support this.
  358. #
  359. AddEncoding x-compress Z
  360. AddEncoding x-gzip gz tgz
  361. #
  362. # If the AddEncoding directives above are commented-out, then you
  363. # probably should define those extensions to indicate media types:
  364. #
  365. AddType application/x-compress .Z
  366. AddType application/x-gzip .gz .tgz
  367.  
  368. #
  369. # AddHandler allows you to map certain file extensions to "handlers":
  370. # actions unrelated to filetype. These can be either built into the server
  371. # or added with the Action directive (see below)
  372. #
  373. # To use CGI scripts outside of ScriptAliased directories:
  374. # (You will also need to add "ExecCGI" to the "Options" directive.)
  375. #
  376. AddHandler cgi-script .cgi
  377.  
  378. # For type maps (negotiated resources):
  379. #AddHandler type-map var
  380.  
  381. #
  382. # Filters allow you to process content before it is sent to the client.
  383. #
  384. # To parse .shtml files for server-side includes (SSI):
  385. # (You will also need to add "Includes" to the "Options" directive.)
  386. #
  387. #AddType text/html .shtml
  388. #AddOutputFilter INCLUDES .shtml
  389. AddType image/x-icon .ico
  390. </IfModule>
  391.  
  392. #
  393. # The mod_mime_magic module allows the server to use various hints from the
  394. # contents of the file itself to determine its type. The MIMEMagicFile
  395. # directive tells the module where the hint definitions are located.
  396. #
  397. MIMEMagicFile /usr/syno/apache/conf/magic
  398.  
  399. <IfDefine HAVE_PHP>
  400. #
  401. # Customizable error responses come in three flavors:
  402. # 1) plain text 2) local redirects 3) external redirects
  403. #
  404. # Some examples:
  405. # Forbidden (eg. list files in a directory)
  406. ErrorDocument 403 /webdefault/sample.php?status=403
  407. # Page not found in apache
  408. ErrorDocument 404 /webdefault/sample.php?status=404
  409. # Page not found in thttpd
  410. ErrorDocument 500 /webdefault/sample.php?status=500
  411. #ErrorDocument 500 "The server made a boo boo."
  412. #ErrorDocument 404 /missing.html
  413. #ErrorDocument 404 "/cgi-bin/missing_handler.pl"
  414. #ErrorDocument 402 http://www.example.com/subscription_info.html
  415. #
  416. </IfDefine>
  417.  
  418. #
  419. # EnableMMAP and EnableSendfile: On systems that support it,
  420. # memory-mapping or the sendfile syscall is used to deliver
  421. # files. This usually improves server performance, but must
  422. # be turned off when serving from networked-mounted
  423. # filesystems or if support for these functions is otherwise
  424. # broken on your system.
  425. #
  426. #EnableMMAP off
  427. #EnableSendfile off
  428.  
  429. # Supplemental configuration
  430. #
  431. # The configuration files in the conf/extra/ directory can be
  432. # included to add extra features or to modify the default configuration of
  433. # the server, or you may simply copy their contents here and change as
  434. # necessary.
  435.  
  436. # Server-pool management (MPM specific)
  437. Include conf/extra/httpd-mpm.conf-user
  438.  
  439. # Multi-language error messages
  440. #Include conf/extra/httpd-multilang-errordoc.conf
  441.  
  442. # Fancy directory listings
  443. Include conf/extra/httpd-autoindex.conf-user
  444.  
  445. # Language settings
  446. Include conf/extra/httpd-languages.conf-user
  447.  
  448. # User home directories
  449. #Include conf/extra/httpd-userdir.conf
  450.  
  451. # Real-time info on requests and configuration
  452. #Include conf/extra/httpd-info.conf
  453.  
  454. # Virtual hosts
  455. #Include conf/extra/httpd-vhosts.conf
  456.  
  457. # Local access to the Apache HTTP Server Manual
  458. #Include conf/extra/httpd-manual.conf
  459.  
  460. # Distributed authoring and versioning (WebDAV)
  461. #Include conf/extra/httpd-dav.conf
  462.  
  463. # Various default settings
  464. Include conf/extra/httpd-default.conf-user
  465.  
  466. <IfDefine SSL>
  467. # Secure (SSL/TLS) connections
  468. LoadModule ssl_module modules/mod_ssl.so
  469. Include conf/extra/httpd-ssl.conf
  470. #
  471. # Note: The following must must be present to support
  472. # starting without SSL on platforms with no /dev/random equivalent
  473. # but a statically compiled-in mod_ssl.
  474. #
  475. <IfModule ssl_module>
  476. SSLRandomSeed startup builtin
  477. SSLRandomSeed connect builtin
  478. </IfModule>
  479. </IfDefine>
  480.  
  481. <IfDefine HAVE_PHP>
  482. AddType application/x-httpd-php .php
  483. LoadModule php5_module /lib/libphp5.so
  484. </IfDefine>
  485.  
  486. LoadModule deflate_module modules/mod_deflate.so
  487.  
  488. <IfModule mod_deflate.c>
  489. DeflateCompressionLevel 2
  490. AddOutputFilterByType DEFLATE text/html text/plain text/xml
  491. AddOutputFilter DEFLATE js css
  492. BrowserMatch ^Mozilla/4 gzip-only-text/html
  493. BrowserMatch ^Mozilla/4\.[0678] no-gzip
  494. BrowserMatch \bMSIE\s7 !no-gzip !gzip-only-text/html
  495. </IfModule>
  496.  
  497. LoadModule headers_module modules/mod_headers.so
  498.  
  499. <Files *.js>
  500. Header unset Etag
  501. </Files>
  502.  
  503. <Files *.css>
  504. Header unset Etag
  505. </Files>
  506.  
  507. Include /usr/syno/etc/sites-enabled-user/*.conf
  508.  
  509. <VirtualHost *:80>
  510. Include /usr/syno/etc/sites-enabled-user/*.conf
  511. </VirtualHost>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement