IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Apache Discussion :

2 CGI-BIN différents pour 1 serveur Apache en SSL


Sujet :

Apache

  1. #1
    Nouveau Candidat au Club
    Profil pro
    Inscrit en
    Avril 2010
    Messages
    7
    Détails du profil
    Informations personnelles :
    Localisation : Suisse

    Informations forums :
    Inscription : Avril 2010
    Messages : 7
    Points : 1
    Points
    1
    Par défaut 2 CGI-BIN différents pour 1 serveur Apache en SSL
    Bonjour à tous,

    Voilà, je suis confronté à un problème qui me dépasse. Un de mes petit bébé (un serveur GNU/Linux CentOS 5.4 avec Apache 2.2.3) à pour tâche de faire tourner une grosse applications développez spécialement pour nous.

    L'application est écrite en Python et fonctionne au travers du web. Jusque là tout va bien.

    Sur mon serveur, je dois donc faire tourner 2 versions différentes de l'application. La première est la version "normal" la seconde est la version "custom" (que je nommerais NORMAL et CUSTOM par la suite). Chacune de ses versions possède un nom DNS. Et toute les 2 utilises du SSL.

    Jusque là tout va presque bien. En effet j'arrive sans soucis à mettre en place mes vhost et le SSL. Mais là ou je m'en sort pas c'est pour les CGI-BIN.

    Chacun des sites possède sont propre dossier CGI-BIN, et j'arrive pas à les faire tourner tout les 2.

    Dans apache j'avais commenté la ligne indiquant :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    #ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
    et je l'ai remplacé par le ScriptAlias nécessaire pour l'application
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    ScriptAlias /cgi-bin/ /data/www/sites/NORMAL/cgi-bin/
    Vous l'aurez compris, mon souci est que ça marche que pour la version NORMAL. Ma question est donc la suivante, comment dois-je faire pour intégrer mon ScriptAlias à l'intérieur d'une VHOST ?

  2. #2
    Rédacteur
    Avatar de _Mac_
    Profil pro
    Inscrit en
    Août 2005
    Messages
    9 601
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Août 2005
    Messages : 9 601
    Points : 12 977
    Points
    12 977
    Par défaut
    Ben tu écris ta ligne ScriptAlias à l'intérieur du bloc <VirtualHost> qui va bien, non ?

  3. #3
    Nouveau Candidat au Club
    Profil pro
    Inscrit en
    Avril 2010
    Messages
    7
    Détails du profil
    Informations personnelles :
    Localisation : Suisse

    Informations forums :
    Inscription : Avril 2010
    Messages : 7
    Points : 1
    Points
    1
    Par défaut
    héhé, j'y ais pensé mais ça marche pas. Apache est pas d'accord avec cette façon de faire.

    Merci beaucoup pour la réponse tout de même.

  4. #4
    Rédacteur
    Avatar de _Mac_
    Profil pro
    Inscrit en
    Août 2005
    Messages
    9 601
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Août 2005
    Messages : 9 601
    Points : 12 977
    Points
    12 977
    Par défaut
    Citation Envoyé par Brume Voir le message
    héhé, j'y ais pensé mais ça marche pas. Apache est pas d'accord avec cette façon de faire.
    C'est-à-dire ? Comment manifeste-t-il son désaccord ?

    Pour être sûr qu'il n'y a pas de conflit, retire le ScriptAlias de la conf globale d'Apache et mets cette directive uniquement dans les <VirtualHost>.

    Tu parles de configuration SSL : es-tu sûr que cette configuration est correcte et que les virtual hosts sont bien retrouvés après connexion en HTTPS ? Je pose la question car avec le module SSL par défaut d'Apache, il n'est pas possible de faire des VH SSL sur le même couple (adresse IP, port).

  5. #5
    Nouveau Candidat au Club
    Profil pro
    Inscrit en
    Avril 2010
    Messages
    7
    Détails du profil
    Informations personnelles :
    Localisation : Suisse

    Informations forums :
    Inscription : Avril 2010
    Messages : 7
    Points : 1
    Points
    1
    Par défaut
    Alors, je me souvenais mal (depuis un moment que je tourne avec ça ).
    Apache a effectivement aucun souci avec ça. Le souci c'est que les pages reste en not found. Sûrement parce que mon scriptAlias ne fonctionne pas à cause de la redirection SSL comme tu le suggère.

    Ma combine SSL tourne bien, mais maintenant que tu me le dis, il semblerait en effet que le souci ce trouve autour de cette redirection SSL... mmh...

    Pour mon ssl en réalité je fais ceci, je rajoute au fichier ssl.conf ceci :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    RewriteEngine On
    RewriteMap lowercase int:tolower
    RewriteMap vhost txt:/etc/httpd/conf.d/ssl.map
     
    RewriteCond   %{REQUEST_URI}  !^/cgi-bin/.*
    RewriteCond   %{REQUEST_URI}  !^/icons/.*
     
    #   2. make sure we have a Host header
    RewriteCond   %{HTTP_HOST}  !^$
     
    #   3. lowercase the hostname
    RewriteCond   ${lowercase:%{HTTP_HOST}|NONE}  ^(.+)$
    #
    #   4. lookup this hostname in vhost.map and
    #      remember it only when it is a path
    #      (and not "NONE" from above)
    RewriteCond   ${vhost:%1}  ^(/.*)$
     
    #   5. finally we can map the URL to its docroot location
    #      and remember the virtual host for logging puposes
    RewriteRule   ^/(.*)$   %1/$1  [E=VHOST:${lowercase:%{HTTP_HOST}}]
    Et je fais ensuite mes ajouts dans mon fichier ssl.map appeler par le ssl.conf

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    HOSTNAME1.ch        /data/www/sites/NORMAL/html
    HOSTNAME2.ch    /data/www/sites/CUSTOM/html
    Je vais me pencher la dessus, mais je sais pas encore comment je vais faire

  6. #6
    Rédacteur
    Avatar de _Mac_
    Profil pro
    Inscrit en
    Août 2005
    Messages
    9 601
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Août 2005
    Messages : 9 601
    Points : 12 977
    Points
    12 977
    Par défaut
    Je ne vois d'où peut venir le problème.

    Tu as un exemple d'URL qui part en not found à nous donner ? Regarde dans le fichier error_log d'Apache quel chemin réel déclenche ce not found.

  7. #7
    Nouveau Candidat au Club
    Profil pro
    Inscrit en
    Avril 2010
    Messages
    7
    Détails du profil
    Informations personnelles :
    Localisation : Suisse

    Informations forums :
    Inscription : Avril 2010
    Messages : 7
    Points : 1
    Points
    1
    Par défaut
    ça serait avec plaisir que je donnerais l'URL, mais c'est pas accessible de l'extérieur.

    Mais je peux mieux expliquer et montrer le souci je pense.

    Quand ça marche, on appel l'URL http://NORMAL.HOSTNAME.ch qui redirige en SSL sur https://NORMAL.HOSTNAME.CH au travers d'une rewrite rules placé dans la vhost

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     RewriteEngine on
     RewriteRule  ^/(.*) https://NORMAL.HOSTNAME.ch/$1 [R]
    Lorsque que le scriptAlias est placé hors de la vhost ça fonctionne sans autre pour la version NORMAL, mais la version CUSTOM ne marche pas pour les raisons logique évoquer plus haut.

    Lorsque je place le ScriptAlias dans la vhost, et que j'appelle la page, la re-direction s'applique normalement mais j'ai droit au message d'erreur suivant :
    Not Found
    The requested URL /cgi-bin/login.py was not found on this server.
    Apache/2.2.3 (CentOS) Server at NORMAL.HOSTNAME.ch Port 443
    Je pense donc que le souci viens du faite qu'en 443 il n'applique pas mon scriptAlias... mais je sais pas comment résoudre ce souci.

    Est-ce plus clair ?

    En tout cas merci pour l'aide.

  8. #8
    Nouveau Candidat au Club
    Profil pro
    Inscrit en
    Avril 2010
    Messages
    7
    Détails du profil
    Informations personnelles :
    Localisation : Suisse

    Informations forums :
    Inscription : Avril 2010
    Messages : 7
    Points : 1
    Points
    1
    Par défaut
    Pour le log d'apache ça donne ça :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    [Tue Apr 20 11:13:40 2010] [error] [client 128.178.194.xxx] File does not exist: /data/www/cgi-bin
    [Tue Apr 20 11:13:41 2010] [error] [client 128.178.xxx.xxx] File does not exist: /data/www/cgi-bin, referer: https://NORMAL.HOSTNAME.ch/cgi-bin/micelist.py?newpreftag=&newsuftag=&animalid=29255&colour=pinkrow&newlabid=MO85-2R&sessionid=501156392390
    [Tue Apr 20 11:13:42 2010] [error] [client 128.178.xxx.xxx] File does not exist: /data/www/cgi-bin, referer: https://NORMAL.HOSTNAME.ch/cgi-bin/choose_alias.py?sessionid=126561788486
    [Tue Apr 20 11:13:43 2010] [error] [client 128.178.xxx.xxx] File does not exist: /data/www/cgi-bin, referer: https://NORMAL.HOSTNAME.ch/cgi-bin/micelist.py?newpreftag=&newsuftag=&animalid=29255&colour=pinkrow&newlabid=MO85-2R&sessionid=501156392390
    [Tue Apr 20 11:13:43 2010] [error] [client 128.178.xxx.xxx] File does not exist: /data/www/cgi-bin, referer: https://NORMAL.HOSTNAME.ch/cgi-bin/micelist.py?newpreftag=&newsuftag=&animalid=29255&colour=pinkrow&newlabid=MO85-2R&sessionid=501156392390
    [Tue Apr 20 11:13:44 2010] [error] [client 128.178.xxx.xxx] File does not exist: /data/www/cgi-bin, referer: https://NORMAL.HOSTNAME.ch/cgi-bin/micelist.py?newpreftag=&newsuftag=&animalid=29255&colour=pinkrow&newlabid=MO85-2R&sessionid=501156392390
    [Tue Apr 20 11:13:45 2010] [error] [client 128.178.xxx.xxx] File does not exist: /data/www/cgi-bin, referer: https://NORMAL.HOSTNAME.ch/cgi-bin/micelist.py?newpreftag=&newsuftag=&animalid=29255&colour=pinkrow&newlabid=MO85-2R&sessionid=501156392390
    [Tue Apr 20 11:13:47 2010] [error] [client 128.178.xxx.xxx] File does not exist: /data/www/cgi-bin, referer: https://NORMAL.HOSTNAME.ch/cgi-bin/micelist.py?newpreftag=&newsuftag=&animalid=29255&colour=pinkrow&newlabid=MO85-2R&sessionid=501156392390
    p.s. J'ai corrigé le log pour que l'url continue de correspondre avec mes exemple de nomenclature si jamais

    Mais je vois une erreur grâce a ce log, il cherche le dossier CGI-BIN au mauvais endroit. c'est pas /data/www/cgi-bin mais /data/www/sites/NORMAL (ou CUSTOM) /cgi-bin

  9. #9
    Rédacteur
    Avatar de _Mac_
    Profil pro
    Inscrit en
    Août 2005
    Messages
    9 601
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Août 2005
    Messages : 9 601
    Points : 12 977
    Points
    12 977
    Par défaut
    Tu peux donner la conf complète d'Apache ? J'ai un peu de mal à savoir d'où peut sortir ce /var/www/cgi-bin car tu ne donnes pas la ou les valeurs de DocumentRoot. Ce que je comprends c'est que tout le bloc de Rewrite que tu donnes avec la map sert à palier le défaut du SSL et que j'ai déjà évoqué : un seul VH possible en SSL par couple (IP (ou *), port). Idéalement, tu voudrai avoir un truc du genre :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    NameVirtualHost *:443
     
    <VirtualHost *:443>
        ServerName NORMAL.HOSTNAME.ch
        DocumentRoot /data/www/sites/NORMAL/html
        ...
    </VirtualHost>
     
    <VirtualHost *:443>
        ServerName CUSTOM.HOSTNAME.ch
        DocumentRoot /data/www/sites/CUSTOM/html
        ...
    </VirtualHost>
    Cette conf est appliquable en HTTP mais pas en HTTPS : en SSL tu tombes toujours sur le premier VH (pour les explications, voir les FAQ du site Apache). D'où que tu n'as sûrement qu'un seul bloc <VirtualHost> (ou pas, d'ailleurs), DocumentRoot est positionné sur /data/www et le truc avec la map et mod_rewrite : avec mod_rewrite tu reconstruis le chemin complet des vrais fichiers. Tu dis en gros que https://NORMAL.HOSTNAME.ch/toto/titi c'est en fait le fichier /data/www/sites/NORMAL/html/toto/titi. C'est astucieux, je ne connaissais pas Sauf que tes règles de rewriting excluent de la réécriture les URL qui commencent par /cgi-bin :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    RewriteCond   %{REQUEST_URI}  !^/cgi-bin/.*
    En l'absence du bon ScriptAlias ou de la conf qui lui va bien, Apache va donc aller chercher toutes les qui commencent par /cgi-bin dans le document root (/data/www), à savoir /data/www/cgi-bin.

    A mon avis, la solution, vu que tu veux deux répertoires différents de CGI c'est de définir 2 ScriptAlias différents (1 par répertoire) et d'utiliser mod_rewrite pour rediriger sur le bon répertoire en fonction du hostname. Ca donnerait un truc du genre :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    ScriptAlias /NORMAL-cgi-bin "/data/www/sites/NORMAL/cgi-bin"
    ScriptAlias /CUSTOM-cgi-bin "/data/www/sites/CUSTOM/cgi-bin"
    (le fait de "préfixer" cgi-bin par le sous-nom de domaine permet de faire un RewriteRule générique, voir ci-dessous)
    et dans ton ssl.conf :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    RewriteCond %{HTTP_HOST} ^(.+)\.HOSTNAME\.ch
    RewriteRule ^/cgi-bin(.*) /%1-cgi-bin$1 [PT]

    Citation Envoyé par Brume Voir le message
    Lorsque que le scriptAlias est placé hors de la vhost ça fonctionne sans autre pour la version NORMAL, mais la version CUSTOM ne marche pas pour les raisons logique évoquer plus haut.
    Quelle explication logique ? J'avoue ne pas l'avoir trouvée

  10. #10
    Nouveau Candidat au Club
    Profil pro
    Inscrit en
    Avril 2010
    Messages
    7
    Détails du profil
    Informations personnelles :
    Localisation : Suisse

    Informations forums :
    Inscription : Avril 2010
    Messages : 7
    Points : 1
    Points
    1
    Par défaut
    Ok, Je comprend bien que c'est un peu le bazar cette histoire, j'en deviens fou moi même. Je vais tenter de te montrer les entrailles de mon souci alors.

    Pour le HTTPS je sais que tu ne peux pas faire plusieurs vhost 443, c'est pour ça que j'utilise ma combine de rewrite qui marche très bien sur mes serveurs. C'est ma façon de faire du multipleSSL

    Pour la partie logique dont je parlais avant, je voulais dire qu'il étais logique qu'il arrive pas à fonctionner vu qu'il ne prend pas le bon cgi-bin enfaîte.
    .

    Bien, je vais tenter de te montrer tout ça. Donc, mes VHOST pour commencer :

    VHOST NORMAL.HOSTNAME.CH
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    <VirtualHost *:80>
         ServerName NORMAL.HOSTNAME.ch
         ServerAlias NORMAL
     
         DocumentRoot "/data/www/sites/NORMAL/html"
         CustomLog /var/log/httpd/NORMAL.HOSTNAME.ch_80.log combined
     
     RewriteEngine on
     RewriteRule  ^/(.*) https://NORMAL.HOSTNAME.ch/$1 [R]
     
    ScriptAlias /cgi-bin/ /data/www/sites/NORMAL/cgi-bin/
     
     
    </VirtualHost>
     
    Alias /scionics "/data/www/sites/scionics"
    SetEnv MALLOC_CHECK_ 0
    VHOST CUSTOM.HOSTNAME.ch

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    <VirtualHost *:80>
         ServerName CUSTOM.HOSTNAME.ch
         ServerAlias CUSTOM
     
     
         DocumentRoot "/data/www/sites/CUSTOM/html"
         CustomLog /var/log/httpd/CUSTOM.HOSTNAME.ch_80.log combined
     
     RewriteEngine on
     RewriteRule  ^/(.*) https://CUSTOM.HOSTNAME.ch/$1 [R]
     
      ScriptAlias /cgi-bin/ /data/www/sites/CUSTOM/cgi-bin/
     
    </VirtualHost>
    Pour le SSL (ssl.conf)

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    #
    # This is the Apache server configuration file providing SSL support.
    # It contains the configuration directives to instruct the server how to
    # serve pages over an https connection. For detailing information about these 
    # directives see <URL:http://httpd.apache.org/docs/2.2/mod/mod_ssl.html>
    # 
    # Do NOT simply read the instructions in here without understanding
    # what they do.  They're here only as hints or reminders.  If you are unsure
    # consult the online docs. You have been warned.  
    #
     
    LoadModule ssl_module modules/mod_ssl.so
     
    #
    # When we also provide SSL we have to listen to the 
    # the HTTPS port in addition.
    #
    Listen 443
     
    ##
    ##  SSL Global Context
    ##
    ##  All SSL configuration in this context applies both to
    ##  the main server and all SSL-enabled virtual hosts.
    ##
     
    #
    #   Some MIME-types for downloading Certificates and CRLs
    #
    AddType application/x-x509-ca-cert .crt
    AddType application/x-pkcs7-crl    .crl
     
    #   Pass Phrase Dialog:
    #   Configure the pass phrase gathering process.
    #   The filtering dialog program (`builtin' is a internal
    #   terminal dialog) has to provide the pass phrase on stdout.
    SSLPassPhraseDialog  builtin
     
    #   Inter-Process Session Cache:
    #   Configure the SSL Session Cache: First the mechanism 
    #   to use and second the expiring timeout (in seconds).
    #SSLSessionCache        dc:UNIX:/var/cache/mod_ssl/distcache
    SSLSessionCache         shmcb:/var/cache/mod_ssl/scache(512000)
    SSLSessionCacheTimeout  300
     
    #   Semaphore:
    #   Configure the path to the mutual exclusion semaphore the
    #   SSL engine uses internally for inter-process synchronization. 
    SSLMutex default
     
    #   Pseudo Random Number Generator (PRNG):
    #   Configure one or more sources to seed the PRNG of the 
    #   SSL library. The seed data should be of good random quality.
    #   WARNING! On some platforms /dev/random blocks if not enough entropy
    #   is available. This means you then cannot use the /dev/random device
    #   because it would lead to very long connection times (as long as
    #   it requires to make more entropy available). But usually those
    #   platforms additionally provide a /dev/urandom device which doesn't
    #   block. So, if available, use this one instead. Read the mod_ssl User
    #   Manual for more details.
    SSLRandomSeed startup file:/dev/urandom  256
    SSLRandomSeed connect builtin
    #SSLRandomSeed startup file:/dev/random  512
    #SSLRandomSeed connect file:/dev/random  512
    #SSLRandomSeed connect file:/dev/urandom 512
     
    #
    # Use "SSLCryptoDevice" to enable any supported hardware
    # accelerators. Use "openssl engine -v" to list supported
    # engine names.  NOTE: If you enable an accelerator and the
    # server does not start, consult the error logs and ensure
    # your accelerator is functioning properly. 
    #
    SSLCryptoDevice builtin
    #SSLCryptoDevice ubsec
     
    ##
    ## SSL Virtual Host Context
    ##
     
    <VirtualHost _default_:443>
     
    # General setup for the virtual host, inherited from global configuration
    #DocumentRoot "/var/www/html"
    #ServerName www.example.com:443
     
    # Use separate log files for the SSL virtual host; note that LogLevel
    # is not inherited from httpd.conf.
    ErrorLog logs/ssl_error_log
    TransferLog logs/ssl_access_log
    LogLevel warn
     
    #   SSL Engine Switch:
    #   Enable/Disable SSL for this virtual host.
    SSLEngine on
     
    #   SSL Protocol support:
    # List the enable protocol levels with which clients will be able to
    # connect.  Disable SSLv2 access by default:
    SSLProtocol all -SSLv2
     
    #   SSL Cipher Suite:
    # List the ciphers that the client is permitted to negotiate.
    # See the mod_ssl documentation for a complete list.
    SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM:+LOW
     
    #   Server Certificate:
    # Point SSLCertificateFile at a PEM encoded certificate.  If
    # the certificate is encrypted, then you will be prompted for a
    # pass phrase.  Note that a kill -HUP will prompt again.  A new
    # certificate can be generated using the genkey(1) command.
    SSLCertificateFile /etc/httpd/conf.d/SSL/XXXXXXX.crt.pem
     
    #   Server Private Key:
    #   If the key is not combined with the certificate, use this
    #   directive to point at the key file.  Keep in mind that if
    #   you've both a RSA and a DSA private key you can configure
    #   both in parallel (to also allow the use of DSA ciphers, etc.)
    SSLCertificateKeyFile /etc/httpd/conf.d/SSL/XXXXXXX.key
     
    #   Server Certificate Chain:
    #   Point SSLCertificateChainFile at a file containing the
    #   concatenation of PEM encoded CA certificates which form the
    #   certificate chain for the server certificate. Alternatively
    #   the referenced file can be the same as SSLCertificateFile
    #   when the CA certificates are directly appended to the server
    #   certificate for convinience.
    #SSLCertificateChainFile /etc/pki/tls/certs/server-chain.crt
     
    #   Certificate Authority (CA):
    #   Set the CA certificate verification path where to find CA
    #   certificates for client authentication or alternatively one
    #   huge file containing all of them (file must be PEM encoded)
    #SSLCACertificateFile /etc/pki/tls/certs/ca-bundle.crt
     
    #   Client Authentication (Type):
    #   Client certificate verification type and depth.  Types are
    #   none, optional, require and optional_no_ca.  Depth is a
    #   number which specifies how deeply to verify the certificate
    #   issuer chain before deciding the certificate is not valid.
    #SSLVerifyClient require
    #SSLVerifyDepth  10
     
    #   Access Control:
    #   With SSLRequire you can do per-directory access control based
    #   on arbitrary complex boolean expressions containing server
    #   variable checks and other lookup directives.  The syntax is a
    #   mixture between C and Perl.  See the mod_ssl documentation
    #   for more details.
    #<Location />
    #SSLRequire (    %{SSL_CIPHER} !~ m/^(EXP|NULL)/ \
    #            and %{SSL_CLIENT_S_DN_O} eq "Snake Oil, Ltd." \
    #            and %{SSL_CLIENT_S_DN_OU} in {"Staff", "CA", "Dev"} \
    #            and %{TIME_WDAY} >= 1 and %{TIME_WDAY} <= 5 \
    #            and %{TIME_HOUR} >= 8 and %{TIME_HOUR} <= 20       ) \
    #           or %{REMOTE_ADDR} =~ m/^192\.76\.162\.[0-9]+$/
    #</Location>
     
    #   SSL Engine Options:
    #   Set various options for the SSL engine.
    #   o FakeBasicAuth:
    #     Translate the client X.509 into a Basic Authorisation.  This means that
    #     the standard Auth/DBMAuth methods can be used for access control.  The
    #     user name is the `one line' version of the client's X.509 certificate.
    #     Note that no password is obtained from the user. Every entry in the user
    #     file needs this password: `xxj31ZMTZzkVA'.
    #   o ExportCertData:
    #     This exports two additional environment variables: SSL_CLIENT_CERT and
    #     SSL_SERVER_CERT. These contain the PEM-encoded certificates of the
    #     server (always existing) and the client (only existing when client
    #     authentication is used). This can be used to import the certificates
    #     into CGI scripts.
    #   o StdEnvVars:
    #     This exports the standard SSL/TLS related `SSL_*' environment variables.
    #     Per default this exportation is switched off for performance reasons,
    #     because the extraction step is an expensive operation and is usually
    #     useless for serving static content. So one usually enables the
    #     exportation for CGI and SSI requests only.
    #   o StrictRequire:
    #     This denies access when "SSLRequireSSL" or "SSLRequire" applied even
    #     under a "Satisfy any" situation, i.e. when it applies access is denied
    #     and no other module can change it.
    #   o OptRenegotiate:
    #     This enables optimized SSL connection renegotiation handling when SSL
    #     directives are used in per-directory context. 
    #SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire
    <Files ~ "\.(cgi|shtml|phtml|php3?)$">
        SSLOptions +StdEnvVars
    </Files>
    #<Directory "/var/www/cgi-bin">
    #    SSLOptions +StdEnvVars
    #</Directory>
     
    <Directory "/data/www/sites/*/cgi-bin">
        SSLOptions +StdEnvVars
    </Directory>
     
     
    #   SSL Protocol Adjustments:
    #   The safe and default but still SSL/TLS standard compliant shutdown
    #   approach is that mod_ssl sends the close notify alert but doesn't wait for
    #   the close notify alert from client. When you need a different shutdown
    #   approach you can use one of the following variables:
    #   o ssl-unclean-shutdown:
    #     This forces an unclean shutdown when the connection is closed, i.e. no
    #     SSL close notify alert is send or allowed to received.  This violates
    #     the SSL/TLS standard but is needed for some brain-dead browsers. Use
    #     this when you receive I/O errors because of the standard approach where
    #     mod_ssl sends the close notify alert.
    #   o ssl-accurate-shutdown:
    #     This forces an accurate shutdown when the connection is closed, i.e. a
    #     SSL close notify alert is send and mod_ssl waits for the close notify
    #     alert of the client. This is 100% SSL/TLS standard compliant, but in
    #     practice often causes hanging connections with brain-dead browsers. Use
    #     this only for browsers where you know that their SSL implementation
    #     works correctly. 
    #   Notice: Most problems of broken clients are also related to the HTTP
    #   keep-alive facility, so you usually additionally want to disable
    #   keep-alive for those clients, too. Use variable "nokeepalive" for this.
    #   Similarly, one has to force some clients to use HTTP/1.0 to workaround
    #   their broken HTTP/1.1 implementation. Use variables "downgrade-1.0" and
    #   "force-response-1.0" for this.
    SetEnvIf User-Agent ".*MSIE.*" \
             nokeepalive ssl-unclean-shutdown \
             downgrade-1.0 force-response-1.0
     
    #   Per-Server Logging:
    #   The home of a custom SSL log file. Use this when you want a
    #   compact non-error SSL logfile on a virtual host basis.
    CustomLog logs/ssl_request_log \
              "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
     
     
    RewriteEngine On
    RewriteMap lowercase int:tolower
    RewriteMap vhost txt:/etc/httpd/conf.d/ssl.map
     
    RewriteCond   %{REQUEST_URI}  !^/cgi-bin/.*
    RewriteCond   %{REQUEST_URI}  !^/icons/.*
     
    #   2. make sure we have a Host header
    RewriteCond   %{HTTP_HOST}  !^$
     
    #   3. lowercase the hostname
    RewriteCond   ${lowercase:%{HTTP_HOST}|NONE}  ^(.+)$
    #
    #   4. lookup this hostname in vhost.map and
    #      remember it only when it is a path
    #      (and not "NONE" from above)
    RewriteCond   ${vhost:%1}  ^(/.*)$
     
    #   5. finally we can map the URL to its docroot location
    #      and remember the virtual host for logging puposes
    RewriteRule   ^/(.*)$   %1/$1  [E=VHOST:${lowercase:%{HTTP_HOST}}]
     
    </VirtualHost>
    Le fameux ssl.map qui me permet de faire mon multiple ssl grâce a ssl.conf

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    NORMAL.HOSTNAME.ch        /data/www/sites/NORMAL/html
    CUSTOM.HOSTNAME.ch    /data/www/sites/CUSTOM/html
    Te faut-il d'autre fichier de config ? dans mon httpd.conf, j'ai déjà désactiver la ligne qui signale

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    #ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
    Mais je conserve : (Car je sais pas si c'est bien de commenter tout ça).

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    <Directory "/var/www/cgi-bin">
        AllowOverride None
        Options None
        Order allow,deny
        Allow from all
    </Directory>
    Encore merci pour cette aide, car je suis vraiment perdu là

    P.S. Petite correction de mes logs d'erreur avant qui étais pas juste, vu que j'ai fait une modif entre 2

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
     
    [error] [client 128.178.xxx.xxx] File does not exist: /data/www/cgi-bin, referer: https://NORMAL.HOSTNAME.ch/cgi-bin/mainpage.py?sessionid=567299320152&mainpage=choose_alias.py&button=6
    [error] [client 128.178.xxx.xxx] File does not exist: /data/www/cgi-bin, referer: https://NORMAL.HOSTNAME.ch/cgi-bin/mainpage.py?sessionid=567299320152&mainpage=choose_alias.py&button=6
    [error] [client 128.178.xxx.xxx] File does not exist: /data/www/cgi-bin
    [error] [client 128.178.xxx.xxx] File does not exist: /data/www/cgi-bin, referer: https://NORMAL.HOSTNAME.ch/cgi-bin/mainpage.py?sessionid=567299320152&mainpage=choose_alias.py&button=6
    [error] [client 128.178.xxx.xxx] File does not exist: /data/www/cgi-bin, referer: https://NORMAL.HOSTNAME.ch/cgi-bin/mainpage.py?sessionid=567299320152&mainpage=choose_alias.py&button=6
    [error] [client 128.178.xxx.xxx] File does not exist: /data/www/cgi-bin, referer: https://NORMAL.HOSTNAME.ch/cgi-bin/mainpage.py?sessionid=567299320152&mainpage=choose_alias.py&button=6
    [error] [client 128.178.xxx.xxx] File does not exist: /data/www/cgi-bin
    [error] [client 128.178.xxx.xxx] File does not exist: /data/www/cgi-bin
    [error] [client 128.178.xxx.xxx] File does not exist: /data/www/cgi-bin
    [error] [client 128.178.xxx.xxx] File does not exist: /data/www/cgi-bin
    [error] [client 128.178.xxx.xxx] File does not exist: /data/www/cgi-bin
    [error] [client 128.178.xxx.xxx] File does not exist: /data/www/cgi-bin
    [error] [client 128.178.xxx.xxx] File does not exist: /data/www/cgi-bin
    [error] [client 128.178.xxx.xxx] File does not exist: /data/www/cgi-bin
    [error] [client 128.178.xxx.xxx] File does not exist: /data/www/cgi-bin
    [error] [client 128.178.xxx.xxx] File does not exist: /data/www/cgi-bin, referer: https://NORMAL.HOSTNAME.ch/cgi-bin/mainpage.py?sessionid=985578960892&mainpage=choose_alias.py&button=6
    [error] [client 128.178.xxx.xxx] File does not exist: /data/www/cgi-bin, referer: https://NORMAL.HOSTNAME.ch/cgi-bin/mainpage.py?sessionid=985578960892&mainpage=choose_alias.py&button=6
    [error] [client 128.178.xxx.xxx] File does not exist: /data/www/cgi-bin, referer: https://NORMAL.HOSTNAME.ch/cgi-bin/mainpage.py?sessionid=985578960892&mainpage=choose_alias.py&button=6
    [error] [client 128.178.xxx.xxx] File does not exist: /data/www/cgi-bin, referer: https://NORMAL.HOSTNAME.ch/cgi-bin/mainpage.py?sessionid=985578960892&mainpage=choose_alias.py&button=6
    [error] [client 128.178.xxx.xxx] File does not exist: /data/www/cgi-bin, referer: https://NORMAL.HOSTNAME.ch/cgi-bin/mainpage.py?sessionid=985578960892&mainpage=choose_alias.py&button=6

  11. #11
    Rédacteur
    Avatar de _Mac_
    Profil pro
    Inscrit en
    Août 2005
    Messages
    9 601
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Août 2005
    Messages : 9 601
    Points : 12 977
    Points
    12 977
    Par défaut
    As-tu essayé ma suggestion ? C'est un début de piste, elle n'est pas parfaite notamment parce qu'elle ne gère pas la casse. Il faut que tu déclares les 2 ScriptAlias dans le bloc <VirtualHost _default_:443> (peu importe où), que tu ajoutes dans ton bloc <Directory "/data/www/sites/*/cgi-bin"> les trucs qui sont dans le bloc <Directory /var/www/cgi-bin>. Enfin, tu ajoutes les RewriteCond et RewriteRule que je donne en bas du bloc <VirtualHost>, juste après ceux que tu as déjà.

    En gros, en gérant la casse, ça donne ça :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    <VirtualHost _default_:443>
        ...
     
        ScriptAlias /normal-cgi-bin "/data/www/sites/NORMAL/cgi-bin"
        ScriptAlias /custom-cgi-bin "/data/www/sites/CUSTOM/cgi-bin"
     
        <Directory "/data/www/sites/*/cgi-bin">
            SSLOptions +StdEnvVars
            AllowOverride None
            Options None
            Order allow,deny
            Allow from all
        </Directory>
     
        ...
     
        RewriteCond   ${lowercase:%{HTTP_HOST}|NONE}  ^(.+)\.hostname\.ch$
        RewriteRule   ^/cgi-bin(.*)  /%1-cgi-bin$1 [PT]
    </VirtualHost>

  12. #12
    Nouveau Candidat au Club
    Profil pro
    Inscrit en
    Avril 2010
    Messages
    7
    Détails du profil
    Informations personnelles :
    Localisation : Suisse

    Informations forums :
    Inscription : Avril 2010
    Messages : 7
    Points : 1
    Points
    1
    Par défaut
    L'idée me plaît, mais pas encore pu l'appliquer, je dois attendre l'aval du developpeur pour pouvoir vite faire la manip.
    Je te tiens au courant si ça marche dès que j'aurais pu l'appliquer.

    Encore et tjrs merci

Discussions similaires

  1. Adresse IP dynamique pour un serveur APACHE.
    Par dimitri13 dans le forum Apache
    Réponses: 1
    Dernier message: 05/12/2011, 21h50
  2. Réponses: 1
    Dernier message: 23/08/2010, 13h58
  3. Réponses: 3
    Dernier message: 30/06/2008, 22h18
  4. Windows ou Linux pour un serveur Apache/PHP
    Par Cju29 dans le forum Serveurs (Apache, IIS,...)
    Réponses: 4
    Dernier message: 10/04/2008, 09h51
  5. 2 répertoires pour un serveur apache
    Par d.w.d dans le forum Apache
    Réponses: 6
    Dernier message: 30/10/2007, 11h04

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo