spirit posteets tagged apache  [ Profile ]

Sort by: Date / Title /

  1. 1 month ago
    Most vulnerability scanners will complain about TRACE method being enabled on the web server tested. This tip disable it and return a 403 FORBIDDEN error to the client (apache versions newer than 1.3.34 for the legacy branch, and 2.0.55 for apache2).
    This needs to be added in the main server config and the default is enabled (on):
    
    TraceEnable Off
  2. 4 months ago
    # Activer le module
    a2enmod deflate
    
    # On compresse les types mime suivants (hmtl, texte, xml, css, js)
    AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css application/xml application/xhtml+xml application/rss+xml application/javascript application/x-javascript
    
    # Niveau de compression
    DeflateCompressionLevel 9
    
    # Règles particulières pour navigateur non compatibles
    BrowserMatch ^Mozilla/4 gzip-only-text/html
    BrowserMatch ^Mozilla/4\.0[678] no-gzip
    BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
    
    # On log pour voir le taux de compression
    DeflateFilterNote Input input_info
    DeflateFilterNote Output output_info
    DeflateFilterNote Ratio ratio_info
    LogFormat '"%r" %{output_info}n/%{input_info}n (%{ratio_info}n%%)' deflate
    CustomLog /var/log/apache2/deflate_log deflate
  3. 4 months ago and saved by 1 other
    quick & dirty...
    openssl req -new -x509 -days 365 -nodes -out /etc/apache2/ssl/apache.pem -keyout /etc/apache2/ssl/apache.pem
    
    hint: to generate a wildcard certificate for multiple name-based virtualhosts, use *.domain.tld as the common name.
  4. sponsorised links
  5. 5 months ago
    Permet par exemple de laisser des internautes déposer des fichiers dans un répertoire. Si on ne veut pas qu'ils puissent déposer un fichier PHP et l'exécuter, on peut vouloir empêcher l'exécution de PHP dans ce répertoire.
    1. # ajouter la conf suivante dans votre VirtualHost
    2.  
    3. <Location /upload/>
    4.    AddType text/plain .php .php4 .php5 .phtml .py .pl .cgi .rb
    5. </Location>
  6. 9 months ago
    ExtendedStatus will gives you a bit more information: Total Accesses, Total Traffic, CPU Usage and Load, Request/s - Bytes/s - Bytes/request
    # uncomment from /etc/apache2/apache2.conf
    ExtendedStatus On
    <Location /server-status>
        SetHandler server-status
        Order deny,allow
        Deny from all
        Allow from 127.0.0.1 .your_domain.com
    </Location>
  7. 1 year ago and saved by 3 others
    Via un fichier .htaccess, ajoutez automatiquement un fichier en fin de script. Avec cette instruction, le fichier append.php sera automatiquement inclus en fin de traitement de votre script PHP. Peut-être utile pour ajouter un script de stat en fin de tous les scripts php.
    php_value auto_append_file /chemin_vers_ficher_a_inclure/append.php
  8. 1 year ago
    <VirtualHost *:80>
      ServerName www.domain.com
      RewriteEngine On
      RewriteRule ^.*$ https://www.domain.com/ [R,L]
    </VirtualHost>
    
    <VirtualHost *:443>
      ServerName www.domain.com
    . . .

First / Previous / Next / Last / Page 1 of 1 (7 posteets)