Домен 3 уровня

Discussion in 'Linux, Freebsd, *nix' started by Useroff, 9 Nov 2008.

  1. Useroff

    Useroff Elder - Старейшина

    Joined:
    23 Aug 2008
    Messages:
    146
    Likes Received:
    27
    Reputations:
    -3
    Всем ку!
    После 3 дня колупаний решил спросить)

    Есть сайт site.ru
    Хочу сделать домен 3 уровня useroff.site.ru
    На DNS сервере прописал:
    Code:
    useroff.site.ru	A	xxx.xxx.xxx.xxx
    В индейце прописал:
    Code:
    Listen 80
    NameVirtualHost xxx.xxx.xxx.xxx:80
    <VirtualHost useroff.site:80>
    <Directory "/useroff">
        Options None
        AllowOverride all
        Order allow,deny
        Allow from all
    </Directory>
    ServerAlias useroff.site.ru
    ServerAdmin [email protected]
    DocumentRoot /useroff
    ServerName useroff.site.ru
    </VirtualHost>
    Только вот нифега не работает((

    При такой конфигурации, везде высвечивает усе с / а не c /useroff то есть на site.ru и на useroff.site.ru показывается содержимое /

    Где я собстно допустил ошибку?

    Зы: Apache/1.3.29
     
    #1 Useroff, 9 Nov 2008
    Last edited: 9 Nov 2008
  2. zythar

    zythar Elder - Старейшина

    Joined:
    16 Feb 2008
    Messages:
    517
    Likes Received:
    109
    Reputations:
    5
    у мя тож когда-то такая проблемка была.
    так вот что я сделал: просто добавил в конфиг идейца среди вирт. хостов еще и основной. как то через жопу, зато работало.
     
  3. Useroff

    Useroff Elder - Старейшина

    Joined:
    23 Aug 2008
    Messages:
    146
    Likes Received:
    27
    Reputations:
    -3
    Пробывал, не работает(
     
  4. zythar

    zythar Elder - Старейшина

    Joined:
    16 Feb 2008
    Messages:
    517
    Likes Received:
    109
    Reputations:
    5
    мм.. приведи полный конфиг апача, что ли..
     
  5. Useroff

    Useroff Elder - Старейшина

    Joined:
    23 Aug 2008
    Messages:
    146
    Likes Received:
    27
    Reputations:
    -3
    Listen 80
    NameVirtualHost xxx.xxx.xxx.xxx:80
    <VirtualHost forum.site.ru:80>
    <Directory "/forum">

    Options None
    AllowOverride all
    Order allow,deny
    Allow from all
    </Directory>
    DocumentRoot /var/www/forum
    ServerAlias forum.site.ru www.forum.site.ru
    ServerAdmin [email protected]
    DocumentRoot /forum
    ServerName forum.site.ru
    </VirtualHost>

    <VirtualHost xxx.xxx.xxx.xxx:80>
    DocumentRoot /htdocs
    ServerName www.site.ru
    <Directory "/htdocs">
    Options None
    AllowOverride all
    Order allow,deny
    Allow from all
    </Directory>
    </VirtualHost>

    <Directory "/htdocs">
    Options None
    AllowOverride all
    Order allow,deny
    Allow from all
    </Directory>

    DocumentRoot /var/www/htdocs/
    #ServerName site.ru

    ServerType standalone
    ServerTokens Prod
    ServerRoot "/var/www"
    LoadModule php5_module /usr/local/lib/php/libphp5.so
    Addtype application/x-httpd-php .php .php3


    PidFile logs/httpd.pid
    ScoreBoardFile logs/apache_runtime_status
    #ResourceConfig conf/srm.conf
    #AccessConfig conf/access.conf
    Timeout 40
    KeepAlive On
    MaxKeepAliveRequests 100
    KeepAliveTimeout 15
    MinSpareServers 5
    MaxSpareServers 10
    StartServers 5
    MaxClients 50
    MaxRequestsPerChild 0

    MaxCPUPerChild 0
    MaxDATAPerChild 0
    MaxNOFILEPerChild 0
    MaxRSSPerChild 0
    MaxSTACKPerChild 0

    Include /var/www/conf/modules/*.conf

    ExtendedStatus Off
    Port 80

    User www
    Group www

    #ServerAdmin [email protected]
    #ServerName site.ru
    SSLEngine Off
    # DocumentRoot "/var/www/htdocs"
    <Directory />
    Options none
    AllowOverride None
    Order deny,allow
    Deny from all
    </Directory>

    #<Directory "/var/www/htdocs">
    # Options none
    # AllowOverride None
    # Order allow,deny
    # Allow from all
    #</Directory>
    UserDir disabled

    DirectoryIndex index.php index.html

    AccessFileName .htaccess
    <Files .htaccess>
    Order allow,deny
    Deny from all
    </Files>

    UseCanonicalName On
    TypesConfig conf/mime.types

    DefaultType text/plain

    <IfModule mod_mime_magic.c>
    MIMEMagicFile conf/magic
    </IfModule>

    HostnameLookups Off

    #ErrorLog syslog:daemon
    ErrorLog logs/error_http_log
    LogLevel warn

    LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
    LogFormat "%h %l %u %t \"%r\" %>s %b" common
    LogFormat "%{Referer}i -> %U" referer
    LogFormat "%{User-agent}i" agent

    CustomLog logs/access_log common

    CustomLog logs/referer_log referer
    CustomLog logs/agent_log agent

    #CustomLog logs/access_log combined

    ServerSignature Off

    ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"

    <Directory "/var/www/cgi-bin">
    AllowOverride None
    Options None
    Order allow,deny
    Allow from all
    </Directory>

    IndexOptions FancyIndexing

    IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t

    AddEncoding x-compress Z
    AddEncoding x-gzip gz

    AddLanguage en .en
    AddLanguage fr .fr
    AddLanguage de .de
    AddLanguage da .da
    AddLanguage el .el
    AddLanguage it .it

    LanguagePriority en fr de

    BrowserMatch "Mozilla/2" nokeepalive
    BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0
    BrowserMatch "RealPlayer 4\.0" force-response-1.0
    BrowserMatch "Java/1\.0" force-response-1.0
    BrowserMatch "JDK/1\.0" force-response-1.0
    <IfDefine SSL>
    AddType application/x-x509-ca-cert .crt
    AddType application/x-pkcs7-crl .crl
    </IfDefine>

    <IfModule mod_ssl.c>
    SSLPassPhraseDialog builtin
    SSLSessionCache dbm:logs/ssl_scache
    SSLSessionCacheTimeout 300
    SSLMutex sem
    SSLRandomSeed startup builtin
    SSLRandomSeed connect builtin
    #SSLRandomSeed startup file:/dev/random 512
    #SSLRandomSeed startup file:/dev/urandom 512
    #SSLRandomSeed connect file:/dev/random 512
    #SSLRandomSeed connect file:/dev/urandom 512
    SSLRandomSeed startup file:/dev/arandom 512

    SSLLog logs/ssl_engine_log
    SSLLogLevel info

    </IfModule>

    Таке чуство что forum.site.ru тоже самое что site.ru...
     
    #5 Useroff, 9 Nov 2008
    Last edited: 9 Nov 2008
  6. Doom123

    Doom123 Elder - Старейшина

    Joined:
    11 Nov 2006
    Messages:
    749
    Likes Received:
    244
    Reputations:
    22
    Так не пробывал?

    Code:
    Listen 80
    NameVirtualHost xxx.xxx.xxx.xxx:80
    
    <VirtualHost xxx.xxx.xxx.xxx:80>
    <Directory "/useroff">
        Options None
        AllowOverride all
        Order allow,deny
        Allow from all
    </Directory>
    ServerAlias useroff.site.ru
    ServerAdmin [email protected]
    DocumentRoot /useroff
    ServerName useroff.site.ru
    </VirtualHost>
    
    <VirtualHost xxx.xxx.xxx.xxx:80>
    <Directory "/forum">
        Options None
        AllowOverride all
        Order allow,deny
        Allow from all
    </Directory>
    ServerAlias forum.site.ru
    ServerAdmin [email protected]
    DocumentRoot /forum
    ServerName forum.site.ru
    </VirtualHost>
    
     
  7. n4n0bit

    n4n0bit Elder - Старейшина

    Joined:
    11 Sep 2006
    Messages:
    52
    Likes Received:
    14
    Reputations:
    20
    Apache 2.2:
    Code:
    <VirtualHost *:80>
        ServerAdmin [email protected]
        DocumentRoot /usr/local/www/data/host.ru/public_html
        ServerName host.ru
        ServerAlias www.host.ru
        ScriptAlias /cgi-bin/ /usr/local/www/data/host.ru/public_html/cgi-bin/
        ErrorLog /var/log/apache/host.ru/error.log
        CustomLog /var/log/apache/host.ru/access.log common
    </VirtualHost>
    
    <VirtualHost *:80>
        ServerAdmin [email protected]
        DocumentRoot /usr/local/www/data/load.host.ru/public_html
        ServerName load.host.ru
        ServerAlias www.load.host.ru
        ScriptAlias /cgi-bin/ /usr/local/www/data/load.host.ru/public_html/cgi-bin/
        ErrorLog /var/log/apache/load.host.ru/error.log
        CustomLog /var/log/apache/load.host.ru/access.log common
    </VirtualHost>
    
    А вообще на офф сайте в доках все есть!
     
    1 person likes this.