Lets move off the topic for now.
Since we have installed our cake files on our server and configured our pc to be able to run cake bake, why dont we make it more look good by directly having our apps name as the address on our server
i.e: http://myapp
hows that sound?
I will share here how to config xampp to have a multiple virtual host.
Why would i want to setup a multiple vhost?
This is because i would like to organize my files where in i need not to bother my self of sub directories. It would also seem like you are working online.
1. proceed to our httpd-vhosts.conf
path-to-apache/conf/extra/httpd-vhosts.conf
open the httpd-vhosts.conf on your text-editor.
2. uncomment the line which says NameVirtualHost *:80
3. We can now start adding our Virtual Host Entry check the lines below
<virtualhost *80>
ServerAdmin webmaster@localhost
DocumentRoot G:/xampp/htdocs/pancake
ServerName pancake
<directory "G:/xampp/htdocs/pancake">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</directory>
</virtualhost>
The DocumentRoot value will be the directory for your new virtual host
i.e:
G:/xampp/pancakes
G:/xampp/public_html
The ServerName value will be your desired name for your new virtual host
i.e:
pancakes - accessed as http://pancakes
myapp - accessed as http://myapp
The Directory value must be equal to the value of your DocementRoot.
*please use forward slash for the DocumentRoot and Directory
4. Next we will do is to tell our machine what to do with the url to our new Virtual Host
if we use it on our browser.
first we open the file hosts on our text editor from C:\WINDOWS\system32\drivers\etc
5. Lets us now add this line
127.0.0.1 pancakes
This is to map your host to your IP
6. Last thing to do is to remove the index.php from your htdocs this is to avoid seeing the xampp's page on your new virtual host.
*After doing this you might not be able to access the http://localhot on your browser therefore you should add another entry on your Vhost. see code below
<virtualhost>
ServerAdmin webmaster@localhost
DocumentRoot G:/xampp/htdocs/
ServerName localhost
<directory "G:/xampp/htdocs/">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</directory>
</virtualhost>