Modern Software Experience

2010-05-31

WAMP bundle

A fast way to get Windows, Apache, MySQL, PHP (WAMP) solution stack up and running on Windows is to install a WAMP bundle. There are quite a few such bundles, and they contain various extras. Wikipedia has an entire page comparing WAMP bundles features.

This article is about WampServer, a WAMP bundle with just one extra.

WampServer

WampServer Home Page

The WampServer software bundle consist of Apache, MySQL and PHP for Windows, and just one extra: phpMyAdmin, a popular administration tool for MySQL.
All that comes in a single installation package. You do not get the very latest versions of the various products, but you do get versions that go together. You also get a handy taskbar interface for performing basic tasks.

download and install

Download of WampServer does not require any registration. The WampServer 2.0i. download is a installer of about 16 MB. Once it has downloaded, you double-click it to start the installation.

firewall

Installing a web server and database server is serious stuff that impact your system, so you are likely to receive quite a few pop-ups from your firewall or other system protection software, for example warnings that http.exe (that is the Apache web server) wants to start automatically when Windows starts up, or that mysql.exe is wants to act as a server and is trying to connect to the Internet.

Wizard

WampServer 2 Setup Wizard

This installer has a typical installation Wizard interface. The installer defaults to installing WampServer in C:\wamp, instead of the Program Files directory, but you can choose any directory you like. The Wizard offers to create Desktop and Quick Launch icons.

Once you've made your choices, the entire bundle of software in installed in the WampServer directory. Apache, MySQL and PHP do not end up in their usual directories, but are all installed in subdirectories of the WampServer directory.

web browser

WampServer 2 Please choose default browser

The Wizards ends with a clumsy dialog. It asks you to Please choose your default browser, and defaults to explorer.exe, the Windows Explorer. This may lead you think that you are being asked to specify a file browser like Windows Explorer, but you should specify a web browser. I browsed to the Google Chrome directory to choose chrome.exe.

Oddly, this choice is not configurable through any WampServer menu, if you want to change the browser WampServer uses, you need to change the wampmanager.ini file in many places.

PHP mail

Once I allowed the Apache HTTP server, WampServer popped the next question: my PHP mail parameters. Some default values are filled in.

WampServer 2 PHP mail parameters

WampServer does not come with an email server. You can replace the default values with those for any already existing email server on any system, such as your regular email account. The name of the SMTP server should not be hard to find, and is usually smtp.servername. For example, the SMTP server for Google Mail is smtp.gmail.com.

Unless you really want to receive emails from WampServer, it is not necessary to set this up. You can ignore this dialog and simply continue to the next one. If you do want to change these setting later, you can modify the PHP.INI file. You don't need to search for that file, there is a PHP.INI menu item on WampServer's menu.

starting up

The final dialog of the WampServer installation wizard offers to Launch WampServer 2 now. It is checked by default, and you should leave it checked, because the installation is not really over yet.

WampServer 2 Setup completing

As you start WampServer for the first time, you'll probably have to deal with one or two pop-ups from from your firewall. Getting that over with is one reason to start WampServer. The other reasons is a blank password.

user interface

WampServer does not automatically start on Windows start-up. You start WampServer by choosing the WampServer icon. WampServer does not show a splash screen or a dialog box to confirm that it is starting up, it merely creates a tray icon. That tray icon provides a user interface to manage the server and its settings.
When you have just started WampServer, WampServer is running, but the services it manages are not running yet. To really get things going, you have to choose the Start all Services menu item.

WampServer menu

WampServer 2 left-click menu WampServer 2 right-click menu

A left-click on tray icon brings up WampServer's main menu. A right-click on the tray icon, brings upanother, small menu. There is an About menu, but it only provides some information about WampServer. It does not tell which version of Apache, MySQL and PHP have been installed and whether the servers are running or not. The most interesting option on this menu is the ability to choose another language.

The help menu item is of dubious value. There is no Windows help file. It leads to HTML pages instead, but not to local HTML pages. It leads to the WampServer web site, and manages to annoy by defaulting to a French pages while I have the English user interface selected, and that page isn't a help at all, but the product overview page. There are no help pages.

The top menu item of the main menu, localhost, opens http://localhost/ in your browser. Browsing to http://localhost/ when you do not have a web server running will result in a typical failed connection screen.

local host not available

When you have started all WampServer services, you'll get to see your server's home page.

WampServer localhost

The WampServer home page provides a quick overview of what has been installed. In this case, Apache HTTP Server version 2.2.11, MySQL 5.1.36, PHP version 5.3.0 and a bunch of PHP extensions. There is nothing special about this list of extensions, these extensions are all built into PHP for Windows.

phpMyAdmin

The phpmyadmin link under Tools leads to the phpMyAdmin page. If you follow that link, you'll see a red-on-yellow warning box at the bottom of the phpMyAdmin page reminding you that have not set a MySQL password for user root yet, and that this leaves your MySQL server open to intrusion.

localhost phpMyAdmin

You are user root, user root@localhost to be precise. On UNIX and UNIX derivates such as Linux, user root is the one with full access to everything, just like Administrator on Windows. Obviously, not setting a password is bad.

This is really something the installation Wizard should have taken care of. You should set a password immediately, and you can do so on the Privileges tab of phpMyAdmin. Just click on the Privileges tab to navigate to phpMyAdmin's privileges page.

localhost phpMyAdmin Privileges

The table on the privileges shows that user root has no password although user root has ALL PRIVILEGES on the local server, both through its IP address 127.0.0.1 and the hostname localhost.
There is no need to change privileges, but you should set a password. Clicking the icon at the end of the row brings up the Edit Privileges screen for that user. That screen is fairly long, but it is divided into section with titles along the top. Scroll down to the section Change Password, type some password twice, and then click the Go button in the bottom right corner of that section.
phpMyAdmin confirms the change with the message The password for 'root'@'localhost' was changed successfully along the top of the screen.

phpMyAdmin Change password

There is no need to do this twice. Changing the password for localhost automatically changes the password for 127.0.0.1, as localhost is just a friendly name for 127.0.0.1.

access denied

Now, if phpMyAdmin were better designed, this would be it. But if you hit the browser back button to surf back to the Privileges screen, you do not get to see the privileges screen again, you merely get to see a box that tells you that access has been denied.

To regain access to phpMyAdmin, you need to change the config.inc.php configuration file. WampServer's tray icon menu has a menu item for the php.ini file, but it does not have a menu item for config.inc.php. You need to browse to the phpMyAdmin directory for WampServer 2.0i with phpMyAdmin 3.1, it is wamp/apps/phpmyadmin3.1) and edit config.inc.php manually.

config.inc.php default

The only thing you need to change to regain phpMyAdmin access is to enter your password within the quotes that are already there. It is also a good idea, now that you have set a root password, to disallow access with a blank password, by setting AllowNoPassword to false.
Having a plain text password in some configuration file is not an admirable security practice. This simple configuration change does take of the biggest security issue, full access to the databases without a password. The phpMyAdmin site provides information on better ways set up security. I personally feel that a WampServer should have included a more polished administration tool.

MySQL character set

MySQL should be configured to use Unicode by default.
The phpMyAdmin page shows that the MySQL charset is UTF-8 and the MySQL connection collation is utf8_general_ci. That is how it should be.
No change is needed.

local

The bottom menu item on WampServer's menu allows you to toggle WampServer's status between online and offline. Do not misunderstand that menu item. It does not turn WampServer on or off, it does not start or stop any services, it really toggles WampServer between being online and being offline, between being on the Internet and off the Internet.

WampServer defaults to providing local services. Anyone who tries to access your web server from anywhere else, even other PCs in your local network, will be denied access. You can enable outside access by choosing the main menu item Put Online. There are a few issue you need to pay attention to, such as your router and firewall settings, and perhaps even your ISP blocking you from running your own web server. However, the bigger issue is whether you really want to provide the outside world access to your PC. Allowing online access is something you should not decide lightly.

updates

2011-04-23 Linux.org

The linux.org domain seems to have disappeared early in February of 2011. The broken link has been removed.

links