Wednesday, December 24, 2008

How to Create VirtualHost on Xampp

Create virtualhost on Xampp that installed on windows computer is very eazy. You just need what the name of virtualhost and where folder you want use as document root. You need to do two part to create virtualhost on xampp

The first part is editing httpd-vhosts.conf on xampp server. This is to redirect server on the right configuration when browser call virtualhost. Second part is editing hosts file on windows. Configuration on this file contains the mappings of IP addresses to host names. It will allow you to call virtualhost from web browser

Editing httpd-vhosts.conf

1. Open %xampp folder%\apache\conf\extra\httpd-vhosts.conf with your favorites text editor. Usually the location is C:\xampp\apache\conf\extra\httpd-vhosts.conf
2. Uncomment #NameVirtualHost *:80 so it will be look
NameVirtualHost *:80

3. Uncomment all configuration script that located between . Or copy paste to create more than one virtualhost. Remember the first configuration is used for all requests that do not match a ServerName or ServerAlias in any block.

This is the example of virtualhost. First configuration is used for all requests that do not match a ServerName or ServerAlias in any block.

<VirtualHost *:80>
ServerAdmin test@test.com
DocumentRoot C:/xampp/htdocs
ServerName xampp
ErrorLog C:/xampp/htdocs/access_error.log
</VirtualHost>

<VirtualHost *:80>
ServerAdmin test@test.com
DocumentRoot C:/xampp/htdocs/example
ServerName example.com
ServerAlias www.example.com
ErrorLog C:/xampp/htdocs/example/access_error.log
</VirtualHost>

Below explanation of each configuration

<VirtualHost *:80>: virtualhost configuration according to NameVirtualHost
ServerAdmin: email administration
DocumentRoot: Docoment root folder for the virtualhost
ServerName: virtualhost or domain name
ServerAlias: virtualhost or domain name alias.
ErrorLog: File to create error for this virtualhost

4. Restart your xampp server

Second thing you need to add your virtualhost name into hosts file windows. You should do this in order your windows computer can call the virtualhost name from browser

Edit hosts.conf on Windows

1. Open %windows folder%\system32\drivers\etc\hosts with your favorites text editor. Usually the location is C:\WINDOWS\system32\drivers\etc\hosts. Remember hosts is name of nfile not directory.
2. Add all your virtualhost with ip 127.0.0.1. The IP is local IP address. Below the example:

127.0.0.1 localhost
127.0.0.1 example.ex
127.0.0.1 www.example.ex
127.0.0.1 thisisfor.example.ex


Now you can test from your favorite browser. Congratulation if it work!

Have a nice try!

Tuesday, December 23, 2008

Admin Menu Module to Administrate Drupal

Admin Menu is one of drupal's modules that I like. This module is not usefull for guest or some user but very usefull for administrator or every member that give access to maintain drupal site.

This module enders all administrative menu items below 'administer' in a clean, attractive and purely CSS-based menu at the top of your website. It contains not only regular menu items - local tasks are also included, giving you extremely fast access to any administrative resource and function your Drupal installation provides.

So it's save your time to work with your drupal. You don't need back to admin home page when you want to access administration menu. Just click the menu from the drop down menu at the top of the site.

For instalation
1. Download file that suitable with your drupal version.
2. Extract the file and upload to your modules directory.
3. Go to list of modules. Site Building > Modules or visit yourdomainname.com/admin/build/modules
4. Enable module Administration Menu then click Save Configuration.
5. Now you can see there is drop down menu at the top and you can access menu on administration direcly from the drop down menu.
6. To administer admin_menu go to yourdomainname.com/admin/settings/admin_menu

Have a nice try!

Sunday, December 21, 2008

Check No Follow Attribute on Comment System Blog

Give comment on blog that doesn't have nofollow attribute can give backlink that will be indexed by Google. A lot of backlink is one factor to increase page rank. Are there any way to know that comment system on the blog have nofollow or not?

The easiest way is by seeing the source code and find if there is rel="nofollow" or rel="external nofollow the code. But this is not practical way because you must view source code on each site and find nofollow attribute.

The other way by visiting dofollow directory. Allmost all blogs on the directory have erased nofollow attribute. But some blog will active again the attribute.

There is another practical way. This way using with firefox browsing with SearchStatus extention.

After install, restart your browser and you will see @ icon on the status bar. Right click on the icon and click "Highlight Nofollow Links" like on the picture below.



After that you can see that all link with nofollow attribute will be highlighted.

This way is simple, just type blog address, wait for loading and you can see link with nofollow attribute. Except that you can also check page rank or alexa rank of the blog or site that you access.

Have a nice try!

Update Drupal from 5.xx to 6.xx

Now drupal develops 3 version: 5.xx, 6.xx, and 7-beta. Drupal 7-beta still new and doesn't stable yet. So there aren't many modules or themes that compatible with drupal 7-beta. One thing that I like from Drupal 6.xx is update status module that automatically check for available updates and warn sites if they are missing security updates or newer versions. So I don't need to visit drupal.org regularry just to check if there are new updates. Drupal 5.xx also has more modules and themes then drupal 6.xx.

But if you use Drupal 5.xx and want to upgrade to Drupal 6.xx this is the tutorial:
1. Backup your database and Drupal directory. So if you get fail when upgrade, you just need restore the backup folder and database
2. Log on as the user with user ID 1
3. Place the site in "Off-line" mode, to let the database updates run without interruption and avoid displaying errors to end users of the site. You can do that from http://www.example.com/?q=admin/settings/site-maintenance (replace www.example.com with your installation's domain name and path).
4. If using a custom or contributed theme, switch to a core theme, such as Garland or Bluemarine.
5. Disable all custom and contributed modules. Remember modules and theme for drupal 5.xx are not compatible with drupal 6.xx
6. Remove all old files and directories from the Drupal 5.xx installation directory.
7. Unpack the new files and directories into the Drupal 6.xx installation directory.
8. Copy your backed up "files" and "sites" directories to the Drupal installation directory. If other system files such as .htaccess or robots.txt were customized, re-create the modifications in the new versions of the files using the backups taken in step.
9. Make sure that your new configuration file is correct.
10. Run http://www.example.com/update.php (replace www.example.com with your Drupal installation's domain name and path) from your favorite browser.
Note: if you are unable to access update.php (for example can't login with user ID 1)do the following:

- Open your settings.php with a text editor.
- Change $update_free_access = FALSE; to $update_free_access = TRUE;
- Once update.php is done, you must change the settings.php file back to its original form with $update_free_access = FALSE;

11. If you can run update.php then follow the instruction. If success you will get information about drupal database update.



12. Ensure that the versions of all custom and contributed modules and themes match the Drupal 6.xx.
13. Re-enable custom and contributed modules and themes then re-run update.php to update custom and contributed database tables.
14. Finally, return your site to "Online" mode so your visitors may resume browsing. You can do that from http://www.example.com/?q=admin/settings/site-maintenance (replace www.example.com with your installation's domain name and path).

Have a nice try!

Change Homepage on Xampp

When you installed xampp on your computer your localhost homepage will be redirect to xammp configuration page. If you want to change that you just need open %xampp folder%\htdocs\index.php with your favorite text editor and change the script with your script.


Another way, just replace index.php with your index.php

It's so simple, isn't it