spirit posteets tagged virtualhost  [ Profile ]

Sort by: Date / Title /

  1. 9 years ago
    server {
        server_name mysite.tld ~^.+.mysite.tld$;
    
        map $host $files {
            default            common;
            mysite.tld         common;
            www.mysite.tld     common;
            admin.mysite.tld   admin;
            system.mysite.tld  system;
            *.mysite.tld       users;
        }
        root /var/www/mysite/$files;
    }
    Paste this in your website: <script type="text/javascript" src="http://www.posteet.com/embed/2017"></script>
  2. 10 years ago
    quick tutorial
    1. # Enable ssl
    2. a2enmod ssl
    3.  
    4. # Edit /etc/apache2/ports.conf and add "Listen 443"
    5.  
    6. # Generate certs: use your domain as Common Name or *.domain.tld for multiple domains
    7. openssl req -x509 -nodes -days 365 -newkey rsa:1024 -out /etc/apache2/server.crt -keyout /etc/apache2/server.key
    8.  
    9. # In the virtualhost, use the following code:
    10. <VirtualHost 192.168.0.1:443>
    11.         SSLEngine On
    12.         SSLCertificateFile /etc/apache2/server.crt
    13.         SSLCertificateKeyFile /etc/apache2/server.key
    14. </VirtualHost>
    15.  
    16. # Reload apache2
    17. /etc/init.d/apache2 reload
    Paste this in your website: <script type="text/javascript" src="http://www.posteet.com/embed/1037"></script>
  3. 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>
  4. sponsorised links
  5. 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 (4 posteets)