TEXT   28
Apache on Windows
Guest on 19th March 2023 11:19:00 AM


  1. Apache on Windows
  2. *****************
  3.  
  4. Bugzilla supports all versions of Apache 2.2.x and 2.4.x.
  5.  
  6.  
  7. Installing
  8. ==========
  9.  
  10. Download the Apache HTTP Server as a ".zip" archive either from the
  11. Apache Lounge website or from the Apache Haus website.
  12.  
  13. Unzip the archive into "C:\Apache24". If you move it elsewhere, then
  14. you must edit several variables in "httpd.conf", including
  15. "ServerRoot" and "DocumentRoot".
  16.  
  17. You must now edit the Apache configuration file
  18. "C:\Apache24\conf\httpd.conf" and do the following steps:
  19.  
  20. 1. Uncomment "LoadModule cgi_module modules/mod_cgi.so" at the
  21.    beginning of the file to enable CGI support.
  22.  
  23. 2. Uncomment "AddHandler cgi-script .cgi" to register ".cgi" files
  24.    as CGI scripts. For this handler to work, you must create a key in
  25.    the Windows registry named
  26.    "HKEY_CLASSES_ROOT\.cgi\Shell\ExecCGI\Command" with the default
  27.    value pointing to the full path of "perl.exe" with a "-T"
  28.    parameter. For example "C:\Perl\bin\perl.exe -T" if you use
  29.    ActivePerl, or "C:\Strawberry\perl\bin\perl.exe -T" if you use
  30.    Strawberry Perl.
  31.  
  32. 3. Add an Alias and a Directory for Bugzilla:
  33.  
  34.    Alias "/bugzilla/" "C:/bugzilla/"
  35.    <Directory "C:/bugzilla">
  36.        ScriptInterpreterSource Registry-Strict
  37.        Options +ExecCGI +FollowSymLinks
  38.        DirectoryIndex index.cgi index.html
  39.        AllowOverride All
  40.        Require all granted
  41.    </Directory>
  42.  
  43. Warning: The above block takes a simple approach to access control
  44.   and is correct for Apache 2.4. For Apache 2.2, replace "Require all
  45.   granted" with "Allow from all". If you have other access control
  46.   requirements, you may need to make further modifications.
  47.  
  48. You now save your changes and start Apache as a service. From the
  49. Windows command line ("cmd.exe"):
  50.  
  51. **C:\Apache24\bin>httpd.exe -k install**
  52.  
  53. That's it! Bugzilla is now accessible from http://localhost/bugzilla.
  54.  
  55.  
  56. Apache Account Permissions
  57. ==========================
  58.  
  59. By default Apache installs itself to run as the SYSTEM account. For
  60. security reasons it's better the reconfigure the service to run as an
  61. Apache user. Create a new Windows user that is a member of **no**
  62. groups, and reconfigure the Apache2 service to run as that account.
  63.  
  64. Whichever account you are running Apache as, SYSTEM or otherwise,
  65. needs write and modify access to the following directories and all
  66. their subdirectories. Depending on your version of Windows, this
  67. access may already be granted.
  68.  
  69. * "C:\Bugzilla\data"
  70.  
  71. * "C:\Apache24\logs"
  72.  
  73. * "C:\Windows\Temp"
  74.  
  75. Note that "C:\Bugzilla\data" is created the first time you run
  76. "checksetup.pl".
  77.  
  78.  
  79. Logging
  80. =======
  81.  
  82. Unless you want to keep statistics on how many hits your Bugzilla
  83. install is getting, it's a good idea to disable logging by commenting
  84. out the "CustomLog" directive in the Apache config file.
  85.  
  86. If you don't disable logging, you should at least disable logging of
  87. "query strings". When external systems interact with Bugzilla via
  88. webservices (REST/XMLRPC/JSONRPC) they include the user's credentials
  89. as part of the URL (in the query string). Therefore, to avoid storing
  90. passwords in clear text on the server we recommend configuring Apache
  91. to not include the query string in its log files.
  92.  
  93. 1. Find the following line in the Apache config file, which defines
  94.    the logging format for "vhost_combined":
  95.  
  96.       LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
  97.  
  98. 2. Replace "%r" with "%m %U".
  99.  
  100. (If you have configured Apache differently, a different log line might
  101. apply. Adjust these instructions accordingly.)
  102.  
  103.  
  104. Using Apache with SSL
  105. =====================
  106.  
  107. If you want to enable SSL with Apache, i.e. access Bugzilla from
  108. https://localhost/bugzilla, you need to do some extra steps:
  109.  
  110. 1. Edit "C:\Apache24\conf\httpd.conf" and uncomment these lines:
  111.  
  112.    * "LoadModule ssl_module modules/mod_ssl.so"
  113.  
  114.    * "LoadModule socache_shmcb_module modules/mod_socache_shmcb.so"
  115.  
  116.    * "Include conf/extra/httpd-ssl.conf"
  117.  
  118. 2. Create your ".key" and ".crt" files using "openssl.exe" provided
  119.    with Apache:
  120.  
  121.    **C:\Apache24\bin>openssl.exe req -x509 -nodes -days 730 -newkey
  122.    rsa:2048 -keyout server.key -out server.crt**
  123.  
  124.    "openssl.exe" will ask you a few questions about your location and
  125.    your company name to populate fields of the certificate.
  126.  
  127. 3. Once the key and the certificate for your server are generated,
  128.    move them into "C:\Apache24\conf" so that their location matches
  129.    the "SSLCertificateFile" and "SSLCertificateKeyFile" variables
  130.    defined in "C:\Apache24\conf\extra\httpd-ssl.conf" (which you don't
  131.    need to edit).
  132.  
  133. Note: This process leads to a self-signed certificate which will
  134.   generate browser warnings on first visit. If your Bugzilla has a
  135.   public DNS name, you can get a cert from a CA which will not have
  136.   this problem.
  137.  
  138.  
  139. Restart Apache
  140. ==============
  141.  
  142. Finally, restart Apache to pick up the changes, either from the
  143. Services console or from the command line:
  144.  
  145. **C:\Apache24\bin>httpd.exe -k restart**
  146.  
  147. ======================================================================
  148.  
  149. This documentation undoubtedly has bugs; if you find some, please file
  150. them here.

Raw Paste

Login or Register to edit or fork this paste. It's free.