Apache httpd: Difference between revisions

from HTYP, the free directory anyone can edit if they can prove to me that they're not a spambot
Created page with '==About== category:softwareThis page is about the Apache web server. (Maybe it should be renamed "Apache web server" or "Apache HTTP Server" at some point, with "Apache" …'
 
m Official: old URL was for all Apache projects
 
(16 intermediate revisions by the same user not shown)
Line 1: Line 1:
<hide>
[[page type::article]]
[[thing type::software]]
[[architecture::server]]
[[purpose::web server]]
[[license::open source]]
[[category:software]]
</hide>
==About==
==About==
[[category:software]]This page is about the [[Apache]] web server. (Maybe it should be renamed "Apache web server" or "Apache HTTP Server" at some point, with "Apache" being a disambiguation page.){{seed}}
This page is about the [[Apache web server]] software.
==Notes==
===Subpages===
To get SSL working with virtual hosting (or at all, really), I had to do the following:
* [[/.htaccess]]
* in [[apache2.conf]]:
* [[/mod_rewrite]]
# added above the "Include /etc/apache2/sites-enabled/" line:
* [[/SSL]]: configuring Apache to serve [[https]] ([[secure sockets layer|SSL]])
NameVirtualHost *:443
* [[/variables]]: the <code>${varname}</code> syntax in Apache's config files
# added below it:
 
SSLProtocol -all +TLSv1 +SSLv3
===Related Pages===
SSLCertificateFile /etc/apache2/certs/server.crt
* [[Apache and PHP]]
SSLCertificateKeyFile /etc/apache2/certs/server.key
===useful commands===
* in [[ports.conf]]:
* <code>[[apachectl]]</code>
<IfModule mod_ssl.c>
** <code>apachectl configtest</code> tests the current configuration without trying to load it (which could result in Apache not running), and gives diagnostic information
    # SSL name based virtual hosts are not yet supported, therefore no
* <code>[[a2enmod]] {{arg|module_name}}</code> enables a module
    # NameVirtualHost statement here
* <code>[[a2dismod]] {{arg|module_name}}</code> disables a module
    Listen 443 https
* <code>[[apache2_invoke]]: just noticed this in an update, not sure what it does (something like a2enmod?)</code>
</IfModule>
 
* Pick which domain to serve for [[https]] requests, and add to that site's config file:
Enabling a module is ''usually'' just a matter of making links from the module's configuration files (sometimes there is more than one file) in <code>/mods-available</code> and putting them in <code>/mods-enabled</code>, but this is a safe and quick way to make sure that all the necessary files are linked.
<VirtualHost *:443>
 
        SSLEngine on
To see all accesses to your Apache server in more-or-less real-time, run the following from your Apache logfile directory:
        (copy of essential stuff from <VirtualHost:*>)
<syntaxhighlight lang=bash>find . -name "*.log" | xargs tail -f</syntaxhighlight>
</VirtualHost>
Note that if you are using [[Virtualmin]] to configure Apache, logfiles for the domains will probably be in <code>/var/log/virtualmin</code>.
* (and finally...) Remember to forward port 443 on the router.
 
==Links==
==Links==
===Official===
===Official===
* [http://httpd.apache.org Apache HTTP Server homepage]
* [http://httpd.apache.org home page]
** [https://cwiki.apache.org/confluence/display/HTTPD/ wiki]

Latest revision as of 15:18, 1 April 2022

<hide> page type::article thing type::software architecture::server purpose::web server license::open source </hide>

About

This page is about the Apache web server software.

Subpages

useful commands

  • apachectl
    • apachectl configtest tests the current configuration without trying to load it (which could result in Apache not running), and gives diagnostic information
  • a2enmod <module_name> enables a module
  • a2dismod <module_name> disables a module
  • apache2_invoke: just noticed this in an update, not sure what it does (something like a2enmod?)

Enabling a module is usually just a matter of making links from the module's configuration files (sometimes there is more than one file) in /mods-available and putting them in /mods-enabled, but this is a safe and quick way to make sure that all the necessary files are linked.

To see all accesses to your Apache server in more-or-less real-time, run the following from your Apache logfile directory:

find . -name "*.log" | xargs tail -f

Note that if you are using Virtualmin to configure Apache, logfiles for the domains will probably be in /var/log/virtualmin.

Official