browser lang:en
When i work under linux, i setup virtual host for every new project, so i don't have to have to deal with paths and other stuff you get when you keep your project in /projects/ folder.
I never even tried to setup Virtual Host under windows, I was convinced that it takes some voodoo magic to get it work, but it turns out to be 5 minutes of work.
For web development under windows I personally use wamp. It's good any other all-in-one solutions, but for some reason i stick to it. You may also wanna try xampp.
So, lets get down to action.
Step 1.
First you must create new local directory for your new project, eg: C:\wamp\test-project
Step 2.
Next, you need to edit C:\WINDOWS\system32\drivers\etc\hosts, and add line with ip and your project virtual host name
eg:
127.0.0.1 localhost
127.0.0.1 test-project.example.com
Step 3.
Try to ping your new host. Go to command prompt and type ping test-project.example.com
C:>ping test-project.example.com
Pinging test-project.example.com [127.0.0.1] with 32 bytes of data:
Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
.
.
Step 4. Edit the httpd.conf file at the virtual hosts section (usualy at the end of file).
NameVirtualHost *
# this is the default mapping to http://localhost/
<VirtualHost *>
DocumentRoot C:\wamp\www
ServerName localhost
</VirtualHost>
# the new virtual host mapping to http://project-name/
<VirtualHost *>
DocumentRoot "C:\wamp\test-project"
ServerName test-project.example.com
<Directory "C:\wamp\test-project">
Options Indexes FollowSymLinks Includes
AllowOverride All
Order deny,allow
Deny from all
Allow from 127.0.0.1
DirectoryIndex index.php
</Directory>
</VirtualHost>
5. Restart Apache and point your browser to http://test-project.example.com
Congratulations, now you can enjoy you virtual server and forgot about http://localhost.
PHP is one of the most widely used open-source server-side scripting languages that exist today. With over…
in:Scripts and tutorials (0 comments)In a FBML Facebook App, your quick jump menu will require a little tweak to work in FBJS…
in:Scripts and tutorials (0 comments)Every single day, someone, somewhere is discussing something important to your business; your brand, your executives, your…
in:Scripts and tutorials (0 comments)The Singleton Pattern is one of the GoF (Gang of Four) Patterns. This particular pattern provides a…
in:Scripts and tutorials (0 comments)Because of the near-spherical shape of the Earth, calculating an accurate distance between two points requires the use…
in:Scripts and tutorials (1 comments)With this script we can limit the download speed // local file that should be send to the client $local_file…
in:Scripts and tutorials (0 comments)Some hosts disabled the ini setting allow_url_fopen. This also means that the ability to easily grab images…
in:Scripts and tutorials (0 comments)The act to verify if a file exists, is one of more important tasks related to files operations,…
in:Scripts and tutorials (0 comments)
