After much headache and very long hours, I finally figured out how to do this.
I had everything right except for my DNS settings. In order to make a subdomain, you should create another site with Apache.
Create the file /etc/apache2/sites-available/yourSiteName
Fill the file with
<VirtualHost *:80> ServerName sub.domain.com ServerAdmin webmaster@domain.com DocumentRoot /your/doc/root/for/subdomain <Directory /> Options FollowSymLinks AllowOverride All </Directory> <Directory /your/doc/root/for/subdomain> Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all </Directory> ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ <Directory "/usr/lib/cgi-bin"> AllowOverride None Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch Order allow,deny Allow from all </Directory> ErrorLog /var/log/apache2/error.log # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. LogLevel warn CustomLog /var/log/apache2/access.log combined </VirtualHost>
Now in your *nix command line run
a2ensite yourSiteName
and restart apache
/etc/inti.d/apache2 restart
Now you still will not be able to see this.
You will need to create a wildcard A record with whatever DNS you use(I have GoDaddy).
Type: * value: IP.ADDR(replace with your server IP) TTL: 1 hour
Now you can replace Type: with your subdomain name if you wish, but It’s easier just to do this if you have large amount of subdomains.
That’s it.
–Tyler Perroux



{ 1 trackback }
{ 1 comment… read it below or add one }
thanks for this trick. Now I finally can implement this quickly, thanks a lot.