Linux,Apache,NetBeans,PHP == Windows,IIS/Cassini,Visual Studio,ASP.Net
Posted
by Neil Smith
on Geeks with Blogs
See other posts from Geeks with Blogs
or by Neil Smith
Published on Sat, 09 Jun 2012 19:49:50 GMT
Indexed on
2012/06/09
22:41 UTC
Read the original article
Hit count: 277
I've worked out how to get my linux based Netbeans PHP development machine to behave much like what happens when you create a new ASP.Net project in Visual Studio.
Firstly create multiple PHP project in Netbeans,say for example mysite1 and mysite2. Next edit the apache2/sites-enabled/000-default file and add two virtualhost sections as below
<VirtualHost 127.0.1.1>
ServerName mysite1.localhost
DocumentRoot /var/www/mysite1/
</VirtualHost>
<VirtualHost 127.0.2.1>
ServerName mysite2.localhost
DocumentRoot /var/www/mysite2/
</VirtualHost>
For each site you add, pick a different ip address similar to the above where I use the third octet to increment, next edit the etc/hosts file and add the following two lines
127.0.1.1 mysite1.localhost
127.0.2.1 mysite2.localhost
Then in Netbeans, go to File->Project Properties click on 'Run Configuration' and set 'Project Url' to http://mysite1.localhost for the first project and http://mysite2.localhost for the second project.
That will give you a PHP development box which develops multiple PHP projects similar to how a Visual Studio Windows based box handles multiple ASP.Net sites.
Hope this helps someone :)
© Geeks with Blogs or respective owner