Monday, April 5, 2010

New version of WAMP server 2.0i has been launched

This is great news that new version of WAMP server has been launched that is WAMP 2.0i which included following features.
  • Apache 2.2.11
  • MySQL 5.1.36
  • PHP 5.3.0
Change Log for 2.0-i - 11/07/2009
  1. Passage PHP 5.3.0
  2. PECL packages are no longer provided (not available on the PHP website)
  3. MySQL 5.1.36 transition
  4. phpMyAdmin 3.2.0.1 passage
  5. SQLiteManager removed no longer compatible with PHP 5.3.0
  6. Fixed a minor bug in php.ini
  7. The log file does disable PHP because he created a bug with phpinfo ()
Download Link

Monday, January 19, 2009

Setting Up a WAMP Server

This tutorial will walk you through setting up a WAMP Server using software that can be found on sourceforge for use. First, a little description is an order. A WAMP Server is a Windows Machine that has Apache, MySQL, and PHP on it (WAMP – Windows, Apache, MySQL, PHP) To install these before you would have to get the installs and binaries and configure them yourself and set everything up which can be a tedious task as well as very time consuming. Now, thanks to sourceforge, you can get this functionality by simply installing an application. Once you are finished with this tutorial you will be able to follow our web-based tutorials without having a domain name and/or server. Let’s get started. First we need to download our software from wampserver.com.

configuring_a_wamp_server_01

Once on that site look for the above box to appear and click on Download WAMP Server 2.0

configuring_a_wamp_server_02

Save the file somewhere that you will be able to get to once it is finished completing. It is approximately 20 Megabytes, so depending on your connection, it may take a few minutes.

configuring_a_wamp_server_03

You should now see this icon wherever you chose to save the file. Double-click on it to start the installation.

configuring_a_wamp_server_04

Select to run the file if you are prompted to do so.

configuring_a_wamp_server_05

You will be prompted to not install this version over WAMP5 1.x. Click yes to continue with the installation.

configuring_a_wamp_server_06

This first install window simply welcomes you to the installer for this application. Click next to continue.

configuring_a_wamp_server_07

This window contains the GNU GENERAL PUBLIC LICENSE that will allow you to use this software. Once you review this click the I Accepts radial button and click next to continue.

configuring_a_wamp_server_08

This box let’s you pick where you would like to install all of the files. You can change this if you like but if you do, bear in mind that you should put it in a folder that does not contain any spaces as some browsers/servers have issues handling spaces in file names. This is also where your web files will be stored under a directory called ‘www’. If you are unsure, leave this default.

configuring_a_wamp_server_09

This window will allow you to create the desktop icon and the quick launch icon to start the server by the click of a button.

configuring_a_wamp_server_10

This window just reviews all installation options. Verify the settings are correct and click next to start installing the application.

configuring_a_wamp_server_11

This is installing the software.

configuring_a_wamp_server_12

You will get the above prompt to configure FireFox as your default browser for the WAMP Server if you would like, otherwise it will use Internet Explorer.

configuring_a_wamp_server_13

This window will allow you to configure your server to forward any e-mail that your php creates to a proper server and e-mail account so that they will go to the right person once you are using it. If you don’t know these values or have the ability to use them, just leave them default.

configuring_a_wamp_server_14

This is the completion window. You have the ability to launch the server automatically after closing this window if you would like. Click Finish to start the application.

configuring_a_wamp_server_15

Once the server is running, you will see the above icon and the taskbar for the WAMP Server.

configuring_a_wamp_server_16

The above menu is what you will get if you simply left-click once on the tray icon.

Localhost – This option simply open the webpage that is stored in the home directory (which is “C:\wamp\www\index.php” by default). You can also get to this page by typing “localhost” in your web browser, or by typing 127.0.0.1 in your web browser.

phpMyAdmin – This option will launch phpmyadmin (which can also be launched by going to http://localhost/phpmyadmin/ in your web browser. phpMyAdmin is a tool to manage, query, select, and browse your MySQL databases. It is php based and relatively simple to use.

SQLSiteManager – This launches a tool to create and delete entire databases. You use this to create the databases and use phpmyadmin to manipulate the data in them. This can also be access from http://localhost/sqlitemanager/ in your web browser.

www Directory – this will open the folder where your sites files are stored. These are the files that are called when you go to localhost.

Apache – This area has the configuration settings for Apache and will allow you to make configuration that you need to make to this service.

PHP – This area has the configuration settings for PHP and will allow you to make configuration that you need to make to this service.

MySQL - This area has the configuration settings for MySQL and will allow you to make configuration that you need to make to this service.

Then you also have the options to control the services and take the server on and off line.

By default the server is set up with an index.php file that will show you the services that are started for the service. This file will also show you the projects that have started on your server based on the folders that are within the www folder. You do not have to keep this file if you do not wish to. You can delete it and make your own index.php that will be shown whenever you access localhost. There are many configurations that can be made to this server setup. Explore them and have fun. I hope this tutorial was easy to follow and thanks for reading.

Thursday, January 15, 2009

Creating Personal Virtual Private Network with Hamachi

Hamachi isn’t a brand new utility or idea, but I did want to ’spread the word’ of this excellent program.

Hamachi is a service that runs in the background and connects your computer to any other computer you wish in a particular network. This creates an encrypted VPN (Virtual Private Network) between you and other PCs in your own network.

This becomes ultra convenient when you have a number of PCs that you want to connect to, for example if you have a work PC, home PC, school PC and/or servers. Once Hamachi is installed, the computers are available via IP address for their file shares, or any other service. Lots of people also use to play video games in a multi-player mode regardless of their location.

I like a few things about Hamachi that set it apart from the other VPN software available:

  • Ease of use - Installing the program is a snap!
  • Network Compatibility - Works with many types of networks, uses a variety of methods to get around firewalls (NAT, etc.)
  • Cross-Platform Availability - Clients include the typical Windows and Mac, but also Linux, Mobile Devices, Windows Mobile and more.
  • Security Built In - Communication between Hamachi clients is encrypted.

Windows Hamachi Install

Setting up the client is easy on Windows.

Installing Hamacho On Windows

After installing the client, run it for the first time and “power” it on. It will have you create a network, and include a password so that anyone joining it (if it is a personal network, this would just be you) will need a password.

Hamachi GUI You will then join the network. For now, you will be the only one in this network. On subsequent installations, you can cancel out of the “create” network part. You will just join the network - so supply the password you used while creating the network.

Setting Hamachi up on Linux is a bit more difficult because it is via command line, however it is still easy as long as you are comfortable typing in a few commands.

Linux Install

From the readme for the Linux client:

  • Run ‘make install’ and then ‘tuncfg’ from under the root account
  • Run ‘hamachi-init’ to generate crypto identity (any account).
  • Run ‘hamachi start’ to launch Hamachi daemon.
  • Run ‘hamachi login’ to put the daemon online and to create an account.
  • Run ‘hamachi join ‘ to join the network.
  • Run ‘hamachi go-online ‘ to go online in the network.
  • Run ‘hamachi list’ to list network members and their status.

More or less, this is all you will need to do. Depending on which flavor of linux you are installing this on, there may be some tricks you’ll need to use to get it working properly. Also, don’t forget to add it to your init scripts (or rc.local) to load on startup.

There is also a GTK GUI for the Linux client - see this forum post if you are interested in downloading or knowing more about it.

So now what?

So now that you have your machines set up, what can you do with them?

Here is just a random selection of some useful programs or services that you can use between your Hamachi clients:

    VNC, Remote Desktop, NoMachine, etc. - Remotely access any PC on the VPN. The connection is encrypted, so you feel secure using even unencrypted protocols (like default VNC).

    File Shares - Whether you use Windows file sharing, Samba or other protocols, you can access files on any other Hamachi PC. For Windows shares, just use the IP: \\5.x.x.x\. You can also map these shares to a drive, giving you access to your files like a local drive.

    Music or Video Streaming - Use a streaming media server, such as Jinzora, to stream music from one PC to another.

    Gaming - Play multi-player games with friends even if you’re on different networks.

Really anything you can think of that would be handy via a VPN, P2P network would work really well with Hamachi. Most connections are direct, so bandwidth is limited by your direct internet connection. In some cases a ‘relay’ is used to maintain connectivity, but this is only used in rare cases (Hamachi claims that 95% of connections are direct).

Finally, there are two versions of Hamachi. The free version has a few limitations - namely it will not run as a system service, is limited to the number of networked clients and uses ‘low speed’ relays (when necessary). The paid version takes away these limitations - for a full description see the comparison page.

The only two downsides that I can see to Hamachi is that it is closed-source, and that it depends on mediation servers. Being closed source, it is impossible to audit the code to ensure it is 100% secure and encrypted. The mediation servers have always worked well for me, but this adds in a 3rd party which some people may not like.

Hopefully you will find Hamachi as useful as I have! This program was purchased by LogMeIn a few years back but has retained its free and useful nature. If you have any particular issues with it, their forum is a great resource with lots of knowledgeable users.

Wednesday, January 14, 2009

Advanced Settings of wampserver

PHP Customization

Depending on which type of program you want to install onto your server, you may require additional extensions that are not loaded by default. There are a whole variety of PHP extensions you can load that come built in, but disabled. Left-click on the Wamp menu, go to PHP->PHP Extensions and click off the extension you would like to reload.

You can also edit the configuration file, php.ini through the menu. Edit anything you need, and save this file. The most common edit is the memory_size, but there are many options you can tweak to your liking.

After making any changes to php, make sure you reload apache. I’ve learned the hard way that changes aren’t automatically pushed to the server, until it is reloaded.

Apache Customization

For you advanced tinkerers out there, you can tweak the apache configuration files to your heart’s content. Make sure after making any changes, to reload apache.

MySQL Customization

Depending on your project, you may need to create a database in MySQL. This can be done through phpMyAdmin, which is handily included within the WAMPServer install. By default they include no password on the root MySQL user, which is not the best thing for security reasons. I would recommend changing this password. phpMyAdmin can be reached via the Wamp Menu, or via the url http://localhost/phpmyadmin/

In Summary:

Don’t let the fun stop there. Install a blog and start experimenting with PHP and templates. Run your own Wiki. Run your own music server. The howtos on how to install some neat programs are coming in some future articles.

One of the greatest things about running a home apache server, is that you can use it in combination with a VPN to access your server anywhere in the world, securely. You can even change your setup to host pages to the outside world, if you so desire.

There is no limit to what you can do! OK, maybe it won’t cook you breakfast in the morning - not yet anyway!

Please let me know if you have any questions, comments, or need help with the install!

How to configure wampserver on my PC?

WAMP stands for Windows Apache, MySQL and PHP. A great majority of websites are run by a trio of services - Apache, MySQL and PHP. Apache is the web server, which handles browser requests and sends the information across the internet to your browser. PHP is the programming language that many sites are written in - this creates dynamic content which in turn is sent to Apache, which sends the data to your browser. And finally, MySQL is the database which stores the information for programs. PHP is used to access this database.

It is a tried and tested trio which works phenomenally well. Usually to gain access to this trifecta, you need to purchase hosting, and this hosting is usually run in a far away datacenter running on a Linux server. However, not many people know that it is available locally, and for Windows as well. You can use these services for running your own applications, and also for locally testing software you are writing, before uploading code to a production server.

There are several ways to get these services running locally. Each service, by itself, has Windows installers. That being said - once the programs are installed, you need to know how to configure the services. That may not be simple unless you happen to be a system administrator.

Step 1

Download the latest WampServer. As of the writing of this article, it includes Apache 2.2, PHP 5.2 and MySQL 5.0.

Step 2

Run the installer. It will warn you to uninstall WAMP5 1.x if you have installed that already. You can use the defaults and it should install without problem.

Step 3

Start the services. You will see a small icon in your taskbar. Left click on it (right clicking does not display the right menu) and select “go online”. The icon will then make a little animation, and your services will be online. You can view your homepage by going to http://localhost/.

Thats it! Wamp is now running. You are ready to install your application, or start learning some PHP! The public website directory is ‘c:\wamp\www\‘. Any directory you create in this directory, shows up as a ‘project’ on the main index page.

Do you want to know Advanced Settings of wampserver? Follow the link.

Download wampserver 2.0f

 

New version of wampserver 2.0f has been released on December 16, 2008 that includes :
- Apache 2.2.11
- MySQL 5.1.30
- PHP 5.2.8
- PHPMyAdmin 3.1.1

Download wampserver 2.0f File Size: 16MB

WampServer is an open source project, free to use (GPL licence). If you think our work deserves it and you want to help us, you can make a donation with paypal.

 

WARNING : do not try to install WampServer 2 over WAMP5.
If WAMP5 is installed on your computer, save your data, uninstall it and delete the WAMP5 directory before installing WampServer 2.

Thursday, June 5, 2008

String Trim() in Javascript

<script language="javascript">
String.prototype.trim=function()
{
 return this.replace(/^\s*|\s*$/g, '');
}
String.prototype.ltrim=function()
{
 return this.replace(/^\s*/g, '');
}
String.prototype.rtrim=function()
{
 return this.replace(/\s*$/g, '');
}
var sf = " This is TEST message   ";
alert(sf.trim());
</script>