ik vroeg me af hoe hyves ervoor zorgt dat subdomeinen uitgelezen worden.
hoe dat in de dns geregeld is. (graag directadmin vriendelijk)
uitgelezen ?
ja je weet wel, dat een subdomein doorgestuurd word naar het hoofdomein, de gegevens worden opgehaald, het bezochte domein word weergeven terwijl er niks in de map van het subdomein staat.
Door in plaats van een naam, een ster mee te geven ([google]wildcard DNS[/google])
oke dus * A ip ? oké zo ver was ik al, en dan?
Stefan Renne op 20/07/2010 22:50:00

oke dus * A ip ? oké zo ver was ik al, en dan?


Je hebt een wildcard. Dus ieder subdomein verwijst door naar een bepaald ip adres. Op dat ip adres heb je dan een apache geconfigureerd etc, met een bepaalde doc root voor je files. Ook PHP ofc.
(In de apache conf staat dan ook een wildcard)

En in PHP vraag je dan in de $_SERVER array op welke URL er is gebruikt, daar kan je dan makkelijk het subdomein uitfilteren ;-)
alleen het gedeelte van "apache geconfigureerd" en "doc root voor je files" snap ik niet dus als je dat zou willen uitleggen, graag.
waarschijnlijk heb je daar httpd.conf voor nodig? wat moet je dan veranderen/toevoegen?
In de DNS zet je dit:
* IN A 123.123.123.123 (maar dan jouw www-server-ip)

In de .conf van Apache zet je zoiets:
<VirtualHost *>
ServerName www.example.com
ServerAlias *.example.com
DocumentRoot /home/www/www.example.com/htdocs

....
</VirtualHost>
Mocht SanThe's oplossing niet voldoende zijn, verwijs ik je bij deze door naar Google.
zo ziet mijn httpd.conf van directadmin eruit, wat moet ik dan precies aanpassen?


#
# This is the main Apache HTTP server configuration file.  It contains the
# configuration directives that give the server its instructions.
# See <URL:http://httpd.apache.org/docs/2.2> for detailed information.
# In particular, see 
# <URL:http://httpd.apache.org/docs/2.2/mod/directives.html>
# for a discussion of each configuration directive.
#
# 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.  

ServerRoot "/etc/httpd"
Listen 80

Timeout 300
KeepAlive Off
MaxKeepAliveRequests 500
KeepAliveTimeout 5
MinSpareServers 5
MaxSpareServers 20
StartServers 8
MaxClients 256
MaxRequestsPerChild 1000


#LoadModule php4_module /usr/lib/apache/libphp4.so 
LoadModule php5_module /usr/lib/apache/libphp5.so 
#LoadModule suphp_module /usr/lib/apache/mod_suphp.so
LoadModule security_module    /usr/lib/apache/mod_security.so

User apache
Group apache

ServerAdmin admin@localhost
DocumentRoot "/var/www/html"

<Directory /home/*>
    AllowOverride All
    Options -MultiViews -Indexes +FollowSymlinks +IncludesNoExec +Includes
<Limit GET POST OPTIONS PROPFIND>
    Order allow,deny
    Allow from all
</Limit>
<LimitExcept GET POST OPTIONS PROPFIND>
    Order deny,allow
    Deny from all
</LimitExcept>
</Directory>

<Directory />
    Options All
    AllowOverride All
</Directory>

<IfModule dir_module>
    DirectoryIndex index.html index.htm index.shtml index.php index.php5 index.php4 index.php3 index.phtml index.cgi
</IfModule>

<FilesMatch "^\.ht">
    Order allow,deny
    Deny from all
    Satisfy All
</FilesMatch>

ErrorLog /var/log/httpd/error_log
LogLevel warn

<IfModule log_config_module>
    #replace %b with %O for more accurate logging
    <IfModule mod_logio.c>
      LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
      LogFormat "%h %l %u %t \"%r\" %>s %O" common
      LogFormat "%O" bytes

      LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
    </IfModule>

    CustomLog /var/log/httpd/access_log common
</IfModule>

<IfModule alias_module>
    # Include some DirectAdmin alias
    Include conf/extra/httpd-alias.conf
</IfModule>

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

DefaultType text/plain

<IfModule mime_module>
    TypesConfig conf/mime.types
    AddType application/x-gzip .tgz
    AddEncoding x-compress .Z
    AddEncoding x-gzip .gz .tgz
    AddType application/x-compress .Z
    AddType application/x-gzip .gz .tgz
    AddHandler cgi-script .cgi
    AddHandler type-map var
    AddType text/html .shtml
    AddOutputFilter INCLUDES .shtml
	AddType video/x-ms-asf .avi
	AddType video/mpeg .mpg
	AddType video/mpeg .mpeg
	AddType video/quicktime .mov
	AddType video/x-ms-wmv .wmv
</IfModule>


#EnableMMAP off
#EnableSendfile off

#######################################################################################
# Do not change anything in included files, because they are rewritten by DirectAdmin #
#######################################################################################

# This is needed for PHP
Include conf/extra/httpd-php-handlers.conf

# Server-pool management (MPM specific)
Include conf/extra/httpd-mpm.conf

# Multi-language error messages
Include conf/extra/httpd-multilang-errordoc.conf

# Fancy directory listings
Include conf/extra/httpd-autoindex.conf

# Language settings
Include conf/extra/httpd-languages.conf

# User home directories
#Include conf/extra/httpd-userdir.conf

# Real-time info on requests and configuration
Include conf/extra/httpd-info.conf

# Virtual hosts
Include conf/extra/httpd-vhosts.conf

# All suPHP domains
Include conf/extra/sudomains.conf

# Local access to the Apache HTTP Server Manual
#Include conf/extra/httpd-manual.conf

# Distributed authoring and versioning (WebDAV)
Include conf/extra/httpd-dav.conf

# Various default settings
Include conf/extra/httpd-default.conf

# Secure (SSL/TLS) connections
Include conf/extra/httpd-ssl.conf

# Deflate module settings
Include conf/extra/httpd-deflate.conf

# All the DirectAdmin vhosts
Include conf/extra/directadmin-vhosts.conf

# All suPHP directives
Include conf/extra/httpd-suphp.conf

# All the other includes needed by the custombuild script
Include conf/extra/httpd-includes.conf

#######################################################################################
# End of included files that are rewritten by DirectAdmin                             #
#######################################################################################

<IfModule ssl_module>
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</IfModule>
Include conf.d/mod_security/*.conf

# Alias for RoundCube webmail
Alias /roundcube /var/www/html/roundcube/


edit: en antwoorden als die van Niels heb ik niet zo veel aan dus zeg aub wat zinnigs of hou gewoon je mond
Ik denk dat je in één van deze twee moet zoeken:

Include conf/extra/httpd-vhosts.conf
Include conf/extra/sudomains.conf

Reageren