Add Virtual Host In Apache In Windows

Currently I am using XAMPP application to test my websites.

Why Virtual Host?
It will gives you freedom to use your domain-name instead sub directory of 'localhost'  in URL.
Ex.
http://project-name/  instead of http://localhost/project-name

To setup Virtual Host (multisite) using xampp in windows,
Step 1:
Locate 'httpd-vhosts.conf' file in xampp-apache installation. Mostly in "C:\xampp\apache\conf\extra"
Edit above file (using notepad) by appending,

<VirtualHost *:80>
    DocumentRoot "C:/xampp/htdocs"
    ServerName localhost
</VirtualHost>
#Above code will make sure your access 
#to default 'htdocs' directory for 'localhost'.

<VirtualHost *:80>
    DocumentRoot "C:/xampp/htdocs/project-name"
    ServerName project-name.local
    ServerAlias project-name.local
    ErrorLog "logs/project-name.local-error.log"
    CustomLog "logs/project-name.local-access.log" common
    <Directory "C:/xampp/htdocs/project-name">
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>
#Change 'project-name' with your domain-name

Step 2:
Locate 'host' file in "C:\Windows\System32\drivers\etc"
Append below lines,

127.0.0.1      localhost
127.0.0.1      project-name.local

Step 3:
Restart Apache Server.

Note:
>It's not mandatory to use '.local' extension. But do not use TLD's in local domain-name.
>Sometimes you may need to restart Windows to host take effect.



How To Set Environment Variable in Windows

Environment Variable helps us to use many commands without specifying full path for its executable file.
Example,
>javac MyClass.java
instead of
C:\Program Files\Java\jdkx.x.x_xx\bin>javac MyClass.java

Why to Set Environment Variable?
Sometimes it becomes very uneasy to use application with absolute path, like in above example each time you will need to copy "MyClass.java" file in bin directory or specify full path for same file.

Alternate Solution
set path="C:\Program Files\Java\jdkx.x.x_xx\bin" 

But this is temporary solution.

Permanently set Environment Variable

Step 1
Right click on My Computer , go for
> Properties > Advance system settings > Environment Variable

Step 2
In System Variables search for "PATH"Select and click "Edit"

Step 3
Put full path of .exe directory at the current value. Include ; (semi-colon) before your new full path each time.





Note: Same for,
"ruby.exe"' is not recognized as an internal or external command,TA: operable program or batch file.
"php.exe"' is not recognized as an internal or external command

How to Generate Documentation in NetBeans (PHP Application)

To Generate Documentation in NetBeans you require few things,
1)  API documentation generator for PHPApiGen )
2) PHP Interpreter ( WAMP, XAMP )

Step 1
Extract ApiGen-x.x.x-standalone.zip file at secure location. (or inside Netbeans installation directory).

Step 2
Start NetBeans (7.4 or later) and click on Tools=>Options. Then click on "ApiGen" tab.

Step 3
Inside "ApiGen Script" input box locate your ApiGen directory extracted previously and select "apigen.php" file.

Step 4
Now go to "General" tab's Command Line Section.
Inside PHP Interpreter input box browse for WAMP or XAMP directory (hope you have installed it!) and Select "php.exe" inside "bin\php\phpx.x.x".
Click "Apply".

Step 5
Done!
Now right-click any PHP Project you are working on and click "Generate Documentation" (It may ask for "Target Directory").

Note:
If you decided to use "apigen.bat" instead of "apigen.php" you may fall in error
"php.exe"' is not recognized as an internal or external command,TA:
operable program or batch file.
You need to set Environment Variable for 'php.exe'
Check How To Set Environment Variable

How to use SASS with Netbeans in Windows

Its really easy to install SASS in Netbeans

Things you required,
1) Ruby Installer
2) SASS Editor Plugin

Step 1
Download and Install Ruby Installer, check for "gem.bat" file in "c:\Ruby200\bin\" directory

Step 2
Star Command Prompt and go for 'bin' directoy
Install SASS gem using gem install sass command






After install you can see "scss.bat" and "scss" files in same "c:\Ruby200\bin\" directory.

Step 3
Go to Tools > Options > Miscellaneous > Sass path  and add "scss.bat" path in CSS Preprocessors input box

Step 4 Optional if you already have sass editor in Netbeans
Goto Netbeans "Plugin" option and install downloaded SASS Editor Plugin


"ruby.exe is not recognized as an internal or external command"????
Check How To Set Environment Variable

'Revert Deleted' saved my a**


Today, While working on website project in NetBeans I accidentally deleted one of my important package containing more than 15 files in .....damn ...single...click!!!

I was totally shocked to hell !


But then after few unsuccessful tries I got History > Revert Deleted option and I recovered my work back. YIPPEE!!!!

Thanks To NeatBeans and Whoever added 'Revert' option in it.

You think this is not a big deal? Then ask any programmer who lost his code in HDD crash. 

To Recover Files,
Just right click on folder > History >> Revert Deleted 

To Recover Complete Folder,
Create new folder with same name >  Right click on folder > History >> Revert Deleted