a2enmod module است؛ برای غیرفعالسازی یک افزونه، دستور a2dismod module استفاده میشود. این برنامهها در حقیقت اقدام به ایجاد (یا حذف) پیوندهای نمادین از /etc/apache2/mods-enabled/ به فایلهای واقعی موجود در /etc/apache2/mods-available/ میکنند.
/etc/apache2/ports.conf) و صفحات موجود در دایرکتوری /var/www/html/ را فراهم میکند (پیکربندی شده در /etc/apache2/sites-enabled/000-default.conf).
mod_ssl) required for secure HTTP (HTTPS) out of the box. It just needs to be enabled with a2enmod ssl, then the required directives have to be added to the configuration files. A configuration example is provided in /etc/apache2/sites-available/default-ssl.conf.
SSLCertificateFile /etc/letsencrypt/live/DOMAIN/fullchain.pem SSLCertificateKeyFile /etc/letsencrypt/live/DOMAIN/privkey.pem SSLCertificateChainFile /etc/letsencrypt/live/DOMAIN/chain.pem SSLCACertificateFile /etc/ssl/certs/ca-certificates.crt
mod_gnutls, which is shipped with the libapache2-mod-gnutls package and enabled with the a2enmod gnutls command. Unfortunately the version packaged for Debian had serious issues and even security implications and is therefor not part of the Debian Bullseye release.
/etc/apache2/sites-enabled/000-default.conf قرار دارد: از این گروه مجازی در صورتی که هیچ گروه دیگری متناسب با درخواست پیدا نشود استفاده میگردد.
/etc/apache2/sites-available/ قرار میگیرد. برپایی یک وبسایت برای دامنه falcot.org به سادگی ایجاد فایل پیکربندی آن و فعالسازی گروه مجازی با استفاده از a2ensite www.falcot.org است.
مثال 11.13. فایل /etc/apache2/sites-available/www.falcot.org.conf
<VirtualHost *:80> ServerName www.falcot.org ServerAlias falcot.org DocumentRoot /srv/www/www.falcot.org </VirtualHost>
CustomLog در تعریف هر گروه مجازی تغییر کند). پس منطقی به نظر میرسد به منظور درج نام گروه مجازی در گزارشها، اقدام به سفارشیسازی قالب آن کرد. اینکار با استفاده از ایجاد یک فایل /etc/apache2/conf-available/customlog.conf انجام میشود که قالب جدیدی برای تمام فایلهای گزارش تعریف میکند (با عبارت LogFormat) و فعالسازی آن با استفاده از a2enconf customlog خط CustomLog باید از فایل /etc/apache2/sites-available/000-default.conf حذف (یا مخفی) شود.
Directory است؛ آنها اجازه تعریف عملکردهای متفاوت برای سرور نسبت به محل قرارگیری فایلهای ارائه شده را میدهند. چنین بلاکی معمولا شامل عبارتهای Options و AllowOverride است.
مثال 11.15. بلاک Directory
<Directory /srv/www> Options Includes FollowSymlinks AllowOverride All DirectoryIndex index.php index.html index.htm </Directory>
DirectoryIndex شامل فهرستی از فایلها است که هنگام درخواست برنامه به سرور بررسی میشوند. اولین فایل موجود در فهرست استفاده شده و به عنوان پاسخ فرستاده میشود.
Options به همراه فهرستی از گزینههای قابل فعالسازی میآید. مقدار None تمام گزینهها را غیرفعال میکند؛ به همین شکل All همه را فعالسازی میکند بجز MultiViews. گزینههای موجود عبارتند از:
ExecCGI indicates that CGI scripts can be executed.
FollowSymlinks tells the server that symbolic links can be followed, and that the response should contain the contents of the target of such links.
SymlinksIfOwnerMatch also tells the server to follow symbolic links, but only when the link and its target have the same owner.
Includes enables Server Side Includes (SSI for short). These are directives embedded in HTML pages and executed on the fly for each request.
IncludesNOEXEC allows Server Side Includes (SSI) but disables the exec command and limits the include directive to text/markup files.
Indexes tells the server to list the contents of a directory if the HTTP request sent by the client points at a directory without an index file (i.e., when no files mentioned by the DirectoryIndex directive exists in this directory).
MultiViews enables content negotiation; this can be used by the server to return a web page matching the preferred language as configured in the browser.
AllowOverride تمام گزینههایی که میتوانند توسط فایل .htaccess فعال یا غیرفعال شوند را فهرست میکند. یک کاربرد متداول این عبارت محدودکردن دسترسی به ExecCGI است، به طوری که مدیرسیستم تصمیم میگیرد کدام کاربران مجاز به اجرای برنامه با هویت سرور وب هستند (کاربر www-data).
mod_auth* modules.
/etc/apache2/authfiles/htpasswd-private file contains a list of users and passwords; it is commonly manipulated with the htpasswd command. For example, the following command is used to add a user or change their password:
#htpasswd /etc/apache2/authfiles/htpasswd-private userNew password: Re-type new password: Adding password for user user
Require directive controls access restrictions for a directory (and its subdirectories, recursively).
Require درون یک بلاک RequireAll قرار میگیرند.
/etc/awstats/awstats.conf است. مدیرسیستمهای فالکوت بجز پارامترهای زیر، تغییری در آن ایجاد نکردهاند:
LogFile="/var/log/apache2/access.log" LogFormat = "%virtualname %host %other %logname %time1 %methodurl %code %bytesd %refererquot %uaquot" SiteDomain="www.falcot.com" HostAliases="falcot.com REGEX[^.*\.falcot\.com$]" DNSLookup=1 LoadPlugin="tooltips"
LogFile و LogFormat مکان و قالب فایل گزارش و اطلاعات موجود در آن را مشخص میکنند؛ SiteDomain و HostAliases فهرستی از تمام نامهای شناخته شده که وبسایت با آنها کار میکند را فهرست میکنند.
DNSLookup معمولا نباید به 1 تنظیم شود؛ برای سایتهای کوچکتر، از جمله فالکوت که در بالا مطرح شد، این تنظیم امکان گزارشهای خواناتری را فراهم میکند که شامل نام کامل رایانه بجای نشانی IP آن است.
/etc/awstats/awstats.www.falcot.org.conf.
مثال 11.18. فایل پیکربندی AWStats برای یک گروه مجازی
Include "/etc/awstats/awstats.conf" SiteDomain="www.falcot.org" HostAliases="falcot.org"
/usr/share/awstats/icon/ directory. In order for these icons to be available on the web site, the Apache configuration needs to be adapted to include the following directive (check out /usr/share/doc/awstats/examples/apache.conf for a more detailed example):
Alias /awstats-icon/ /usr/share/awstats/icon/