spirit posteets tagged apache  [ Profile ]

Sort by: Date / Title /

  1. 9 years ago
    it's also possibl with a .htaccess file and "deny from all " in that file
    1. if (isset($_SERVER['REMOTE_ADDR'])) die('Permission denied.');
    Paste this in your website: <script type="text/javascript" src="http://www.posteet.com/embed/2039"></script>
  2. 10 years ago
    1. find . -name .svn -prune -o -print | xargs chown www-data:www-data
    2.  
    3. #Exclude another directory (cache)
    4. find . -name .svn -or -name cache -prune -o -print | xargs chown www-data:www-data
    Paste this in your website: <script type="text/javascript" src="http://www.posteet.com/embed/1417"></script>
  3. 10 years ago
    1. /etc/apache2/apache2.conf
    2. > ServerTokens Prod
    3. > ServerSignature Off
    4.  
    5. /etc/php5/apache2/php.ini
    6. > expose_php = Off
    Paste this in your website: <script type="text/javascript" src="http://www.posteet.com/embed/1405"></script>
  4. sponsorised links
  5. 10 years 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
    Paste this in your website: <script type="text/javascript" src="http://www.posteet.com/embed/1337"></script>
  6. 10 years 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
    Paste this in your website: <script type="text/javascript" src="http://www.posteet.com/embed/1048"></script>
  7. 10 years 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.
    Paste this in your website: <script type="text/javascript" src="http://www.posteet.com/embed/1036"></script>
  8. 10 years 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>
    Paste this in your website: <script type="text/javascript" src="http://www.posteet.com/embed/1014"></script>
  9. 11 years 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>
    Paste this in your website: <script type="text/javascript" src="http://www.posteet.com/embed/791"></script>
  10. 11 years 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
    Paste this in your website: <script type="text/javascript" src="http://www.posteet.com/embed/455"></script>
  11. 11 years ago
    <VirtualHost *:80>
      ServerName www.domain.com
      RewriteEngine On
      RewriteRule ^.*$ https://www.domain.com/ [R,L]
    </VirtualHost>
    
    <VirtualHost *:443>
      ServerName www.domain.com
    . . .
    Paste this in your website: <script type="text/javascript" src="http://www.posteet.com/embed/8"></script>

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