Creating Subdomains with the Apache Server

Subdomains
To do this, we need to go back to our copy of httpd.conf.

First: Find the line:

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for requests without a known
# server name.
#
#<VirtualHost *>
# ServerAdmin webmaster@dummy-host.example.com
# DocumentRoot /www/docs/dummy-host.example.com
# ServerName dummy-host.example.com
# ErrorLog logs/dummy-host.example.com-error_log
# CustomLog logs/dummy-host.example.com-access_log common
#</VirtualHost>

Add this below Ok, you will have to change these directorys to what you want. You MUST have a .tk do do this. (or some extension). For the DocumentRoot, the directory would turn out to be c:\apache2\sub\ but you don't add the C:\ and also, be sure you add the correct /'s. For the Errorlog and the transferlog, besure to create thoes files before running your server.

<VirtualHost sub.whatever.tk>
ServerAdmin Any@email.here
DocumentRoot /apache2/sub/
ServerName sub.iponu.tk
ErrorLog /apache2/sub/logs/error.log
TransferLog /apache2/sub/logs/transfer.log
</VirtualHost>

That is how you can create subdomains with apache. Any questions, Please PM me.