Sobes.tech
Intern

Have you worked with Apache HTTP Server?

sobes.tech AI

Answer from AI

Yes, I have worked with it. I have experience configuring, optimizing, and supporting Apache HTTP Server in various infrastructures.

Main areas of work:

  • Installation and basic configuration:
    • Compiling from source and installing from packages (apt, yum).
    • Editing the main configuration file httpd.conf (or apache2.conf).
    • Configuring listening ports (Listen).
  • Virtual Hosts:
    • Creating and configuring virtual hosts for hosting multiple sites on one server.
    • Configuring based on name (Name-based Virtual Hosts) and IP address (IP-based Virtual Hosts).
    • Using directives ServerName, ServerAlias, DocumentRoot.
  • Apache Modules:
    • Enabling and disabling modules (e.g., mod_rewrite, mod_ssl, mod_proxy).
    • Configuring specific modules, such as URL rewriting rules (mod_rewrite).
    • Working with MPM (Multi-Processing Modules) — prefork, worker, event.
  • Security:
    • Configuring SSL/TLS using mod_ssl and Let's Encrypt or other certificates.
    • Restricting access by IP (Order, Deny, Allow).
    • Setting up authentication (Basic, Digest) using .htaccess or configuration files.
    • Protecting against common attacks (e.g., DDoS, SQL Injection - in conjunction with WAF).
  • Performance and scaling:
    • Optimizing MPM settings (MaxRequestWorkers, StartServers, MinSpareServers, MaxSpareServers).
    • Using caching (mod_cache, mod_disk_cache).
    • Integrating with FastCGI (PHP-FPM) and proxying requests (mod_proxy, mod_proxy_http, mod_proxy_fcgi).
    • Configuring compression (mod_deflate).
  • Logging and monitoring:
    • Setting up access log formats (LogFormat, CustomLog).
    • Analyzing error logs (ErrorLog).
    • Integrating with monitoring systems (e.g., Prometheus Exporter, Nagios plugins).
    • Using mod_status for server and request status monitoring.
  • Automation and deployment:
    • Writing Ansible playbooks for installing and configuring Apache.
    • Using Docker containers with Apache.

Example of virtual host configuration:

# Virtual host configuration example
<VirtualHost *:80>
    ServerName example.com
    ServerAlias www.example.com
    DocumentRoot /var/www/example.com/public_html
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

    <Directory /var/www/example.com/public_html>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>

    # Redirect to HTTPS
    RewriteEngine On
    RewriteCond %{HTTPS} off
    RewriteRule ^(.*)$ https://%{HTTP_HOST}$1 [R=301,L]
</VirtualHost>

<VirtualHost *:443>
    ServerName example.com
    ServerAlias www.example.com
    DocumentRoot /var/www/example.com/public_html
    ErrorLog ${APACHE_LOG_DIR}/ssl_error.log
    CustomLog ${APACHE_LOG_DIR}/ssl_access.log combined

    <Directory /var/www/example.com/public_html>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>

    SSLEngine on
    SSLCertificateFile /etc/ssl/certs/example.com.crt
    SSLCertificateKeyFile /etc/ssl/private/example.com.key
    SSLCertificateChainFile /etc/ssl/certs/example.com.ca-bundle # If available

    # Recommended SSL security settings
    SSLProtocol all -SSLv2 -SSLv3
    SSLCipherSuite ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:DHE-RSA-AES128-SHA256:DHE-RSA-AES256-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES128-SHA:ECDHE-ECDA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA
    SSLHonorCipherOrder on
    SSLSessionTickets off
    SSLCompression off

</VirtualHost>

I also have comparative experience with Nginx, which allows choosing the optimal solution for a specific task or integrating them (for example, Apache as a backend behind Nginx).