This is a tutorial to setup a development environment for a particular project on your localhost. Doing so, you ll be able to access your web application project by a custom url on your local machine. Let us assume your project is firstProject. Now follow the following steps. This is particularly only for Windows Users.
- Login as Administrator on your Windows.
- Open your hosts file at : In C:\WINDOWS\system32\drivers\etc in an editor. and enter the following code at the end of the file :
- Now start your command prompt and flush the DNS by entering the following command
- Open your httpd-vhosts.conffile at:
- FOR WAMP USERS:bin\apache\conf\extra and following code within the file.
- FOR XAMPP USERS:C:\xampp\apache\conf\extra and add the following code within the file.
- This is to tell Apache that when you open http://myProject/ on the browser, it should open the following directory.
ServerAdmin email@example.com DocumentRoot "c:/wamp/www/myProject/" ServerName myProject ErrorLog "logs/dummy-host2.localhost-error.log" CustomLog "logs/dummy-host2.localhost-access.log" common </VirtualHost>
Finally Restart your Apache service and visit your project on the browser.
Additional tasks you might have to do:
- You might have to edit the httpd.conf file located within the Apache Folder and search for the term AllowOverride and change AllowOverride None to AllowOverride all.