Skip to content →

Month: April 2013

How to change the port numbers on WAMP and stop conflicts with a portable server

To install WAMP on your PC

What is WAMP?

WAMP stands for Windows Apache MySQL Php. 

·        Windows is your operating system.

·        Apache is a server that manages communications between computers on a network including the internet.  All websites reside on a server somewhere.

·         MySQL is a database to hold the contents of a website. A website is made up of two parts: its database and its programmes such as PHP

·        PHP is a programming language.  The language resides on the server and the website is written in PHP.

When do we use WAMP?

Anyone who develops websites, including their own blog, is likely to want to install WAMP on their computer.  If they don’t use Windows, then they will be looking for LAMP or MAMP.

WAMP is installed in folder on your C:/Wamp.

How do I use WAMP?

 To start WAMP up, you go to Start/All Programs/Start WAMP.  You may have to give it permission to bypass your firewall.

WAMP has a drop-down (or pop up menu).

You pick “local host” to see a list of websites residing on your WAMP.  Pick any of these and the website should appear in your browser (i.e., Firefox, Chrome, Internet Explorer, etc.)

Alternatively, you can go to your browser bar and type “localhost/mywebsite” [without the “”].  If you are a noobe, note that is an alternative to http://www.mywebsite.com.

If WAMP is running, and “mywebsite” exists, then mywebsite will open in your browser.

In short, you are running a private little internet on your computer and you can see your website in your own browser.

How do I install WAMP?

1.       Download the latest WAMP (first recall whether you have a 64 bit or an older 32 bit machine)

2.       Follow the instructions

3.       Have a look at the menu bar and see localhost, phpAdmin, Apache and MySQL.

Build a website

To build your first website, use WindowsExplorer to make a new folder in c:/wamp/www/mynewwebsite.

Check that you can see the folder when you use WAMP’s menu and choose localhost.  This folder is still empty and in two steps, you will download into it WordPress or Drupal, or whatever you are using.

First, make a new database for your website by going to phpAdmin.  Make a new database and then add yourself again with a new name and password (and name that is not root).  Give yourself all privileges.

Now you can download and install something like WordPress into your folder and when it asks for your database, give it your database name, your new user name and your password.

When you return to localhost and select mynewwebsite, you should see your website in your browser.

WAMP won’t run – port in conflict?

You very likely have Skype running on your computer as well.  Skype “listens” to the same port as WAMP but listens to another as well.

To resolve the conflict, open Skype and look for the technical settings. Uncheck “listen to port 80” and WAMP will work.

WAMP conflicts with another server on your computer?

You may be running ScholarWriter, for example, on Uniform Server and you will find you have to switch off UniformServer before you run WAMP, and vice versa.

You might also be running Maven with Eclipse to run UseCaseTool (uctool).  Maven is also a server. 

You might also have a GeoServer running!

You want WAMP to listen to its own distinct port and you also want MySQL to have its own port.  We will change the port in WAMP from 80 to 81 and in MySQL from 3306 to 3307.

We will accomplish these changes in this order.

1.       Edit Apache’s httpd.conf file

a.       Go to WAMP’s menu and select httpd.conf

b.      Use find to find localhost and change it to localhost:81

c.       Save

2.       Edit c:/wamp/wampmanager.tpl file so the WAMP menu points to localhost:81

a.       Find http://localhost and change it to http://htttp:localhost:81

b.      Three instances

c.       Save

3.       Edit MySQL my.ini file

a.       Go back to the menu and follow MySQL to my.ini

b.      Find 3306 and change it to 3307

c.       Save

4.       Edit the phpAdmin config.inc.php file to recognise the 3307 port

a.        Find the config.php file at c:/wamp/apps/phpadmin…/config.inc.php

b.      Edit out the first reference to localhost against verbose to leave ‘’ with nothing between them – I don’t know why but until I changed this I couldn’t go from the WAMP menu to phpAdmin

c.       Change the next reference to localhost to 127.0.0.1 – apparently if that remains as localhost, then the port defaults to 3306

d.      Change the port from ‘’ to ‘3307’

e.      Save

5.       Restart the WAMP server

a.       Shut down all services

b.      Exit

c.       Restart

d.      And test all the links in the menu

If all is well, you are now directed to both localhost:81 and localhost:81/phpAdmin where you can set up new databases.

Change the port settings on any existing websites

Note that if you already have made a database before you changed the port AND installed a website, then you must change the settings on the website. 

For each website, go to c:/wamp/www/websitename/sites/default/settings.php and edit these lines to match the port settings as follows

     ‘host’ => ‘localhost:81’

      ‘port’ => ‘3307’

Final test

Fire up another server, say a portable website and see if you are able to run two servers on the same PC.

And not least change your password

Your server resides behind your firewall and is not accessible from the internt.

But, just in case, change the password for the user ‘root’

1.       In PhpAdmin, change the password for user root under Privileges

2.       Go immediately back to the config.inc.php file and insert the same password in password.

3.       Reboot your WAMP and just in case you are exposed to the internet, no one should be able to connect to your MySQL without knowing your password.

At last, you should have WAMP running smoothly on port 81 and 3307 while other servers (and Skype) run on other ports.  I have deliberately left port 80 and 3306 clear for a portable server that so the defaults are used for users who are likely to have the greatest disinterest in tweaking their system!

16 Comments

How to remove hundreds of spam comments from a Drupal site

Suffered a spam attack on your Drupal site?  You are in good company. Even with Mollom installed, your site can be overrun faster than a dog with fleas.

To get rid of the thousands and thousands of spam comments, you have two choices.

Either, delete the comments from your MySQL database

To delete spam directly at your MySQL database, you will have to log in to your hosting service.  Then use phpAdmin to find the right table.  And truncate the table to clear out all the comments.

I haven’t tried this but proceed logically and it should work.

Or, delete comments from your front end using a View

  1. Install two modules: Entity API and Views Bulk Operations
  2. Clear your cache
  3. Make a new View at Structure/Views/ and use Comments as your content
  4. Leave the format as Unformatted and set the number of comments as 500 — check the pager
  5. Continue & Edit
  6. Change Content to Fields
  7. Add a Field for Bulk Operations: Comment and set the value as Delete
  8. Remove the filters unless you want them
  9. Save
  10. Go to the View (e.g., http:/yourwebsite.name/spam-control or whatever you called your view)
  11. Start deleting

You need two clicks at the top and you must confirm the list.  It takes a little time and it is probably quicker to delete the table but this was more satisfying and can remain in the background to clean up smaller spam attacks in future.

One Comment

Set up two instances of Uniform Server, each with several websites

What is Uniform Server?

Uniform Server, or UniServer, is server that you  load onto to your laptop, or desktop, so that you can develop websites off line.

Moreover, unlike WAMP and XAMPP and similar local servers, UniServer does not install itself on your machine (provided you run it as a program and not as a service – it comes with both choices).  You unpack UniServer into a conventional folder on a USB, e.g. E:/UniServer/all its files, or onto your hard drive C:/UniServer/all its files.

In practical terms, if you want to move your server and its websites to another computer, you just copy the folder to a USB and then copy the folder on the USB to the next computer.  You can also zip up the folder, copy it and unzip it into a new folder on the next computer.

The importance of Uniserver is that it is a local server, private from the internet, and completely portable. You can zip it up and move it from computer to computer without worrying about installing and rebuilding your websites all over again.

What is a multiple instance of Uniserver?

The instructions for running a multiple instance of Uniserver are a little confusing.

We have two things that we might like to achieve —

First, we might want to run two websites on one copy of Uniserver.  This is very easy and I will outline the steps below. Even if you only intend to run one website, it is worth setting up two websites just to explore and understand the file structures of Uniserver.

The second thing we might want to achieve is to run two servers. We might want to run two instances of Uniserver. Or, we might want to run Uniserver and Wamp, for examples.

The reasons why running two instances of a server is an issue is that when two servers run on our laptop or desktop, they compete for the use of ports. The default port for an Apache server is 80 and the default port for our MySQL server is 3306.  When we have two servers running on our computer, they both try to access the same port.  Indeed, when we first install a server, the server often clashes with Skype and we have to adjust Skype settings so it does not try to access port 80.

Multiple instances of Uniserver, in the way its documentation describes multi-instances, means being able to run two instances of Uniserver at the same time.  To do this, we will set one Uniserver to port 8s and 3306, and the second server to ports 81 and 3307.

[Note, on my computer, I set WAMP server to ports other than 80 and 3306 and leave the Uniserver on 80 and 3306 because I expect more experienced people to use WAMP and less experienced people to be using Uniserver.]

How do I run two websites on one instance of UniServer?

1 Unpack Uniserver and Run as a Program

Once you have unpacked UniServer into a folder, e.g. C:/Uniserver (make sure there are no spaces in the name), then go to the folder and run as a program.

2 Use the menu to Start both Servers

A big blue icon with a “1” opens in your tray and a little menu box opens on your screen.

Start BOTH the Apache server and the MySQL servers.

3 Change your password for the root user for MySQL and all your MySQL databases

As soon as you have started both servers for the first time, Uniserver asks you to change your password for the MySQL server. Do so now. Apparently you can do so later, but that has never worked well for me.

Confusingly, the current password is “root” – and so is the default username “root”.  Change the password form “root” to “mysecret” or whatever.   You now have a database called “mysql” with user “root” and password of “mysecret”.

4 Orient yourself by finding the database that you have just created

To see the database, look in the file structure for “usr” and keep tracking down until you find “mysql”.

5 Make another database, if you need it, or just make one to ensure you understand the file structure

If you will be running more than one website on your Uniserver, go to phpAdmin in the little menu box and make a new database for each website.  Each website will have a user name “root” and a password “mysecret” and they will each have a folder alongside the first database “mysql”.

If you make a database just to know you can and don’t really need it, you can tidy up by going to phpAdmin and deleting the database.  Confirm that its folder has vanished from the file structure.

6 Download Drupal or WordPress or something to run your website

If you are using Drupal, download and unpack the latest version of Drupal into a folder in C:/uniserver/www/your_new_website.  Check the files are in /your_new_website. If they are in one folder below, e.g. /your_new_website/drupal-7-22 then copy the entire file structure up one level to /your_new_website.

7 Download Drupal or WordPress again into another folder

If you are running a second website on a second database, unpack Drupal, or whichever CMS you are using into a second folder /www/the_second_website.  Make sure the file structure is in this folder and not one folder below.

8 Install the websites

Go back to the menu box for Uniform Server and select www.  You will see your two websites (or folders rather).  Select the first one and follow the install instructions.

Insert the name of the database, the username (root) and your database password (mysecret). Then add the details you will use to log in to the website when asked.

Do this for both websites.

You have now installed TWO websites  on ONE instance of Uniserver which is running on the default ports of 80 and 3306

To see your websites, type localhost/your_new_website into the browser bar. Note the name after the / corresponds to the name of the folder in /www.

How do I install two instances of Uniserver?

1 Unpack UniServer software into a second folder

To install a second instance of Uniserver, we unpack it into a SECOND folder such as C:/UniServer2/all its files.

2 Change the port numbers

We start as before with

  • Run as a program
  • Change the password from “root” to “mysecret”

Now, before we continue to do anything else, select “multiple servers” in the menu box.

You will see two columns: old and new. The new settings have incremented all the old settings by one.  Select the button at the bottom right that is partially obscured. This button sets this version of Uniform Server as port 81 for Apache and port 3307 for MySQL.

Also, notice that the icon changes from “1” to “2”.

When you are running Uniform Server “1”, it has standard port settings of 80 and 3306. When you are running Uniform Server “2”, called from C:/UniServer2/, then it has port settings of 81 and 3307.

3 Set up empty databases and download website software

You can make new databases using phpAdmin, as before.

You can also download your website software into folders in /www/website_1 and /www/website_2 as before.

4 Install your website software

But now there is another important change to what you do.

When you install Drupal (and probably other software such as WordPress), state the name of the database that you made in phpAdmin. Give the username (root) and password (mysecret). Then look at Advanced Options. Leave the host name as “localhost” but now add the port number. This is the port number for the database — which in our case is now 3307.

Note well, that we usually leave the database port blank and it reverts to the default of 3306. For the second server “2” (not the first server “1”) we need to fill in the number.

Do this and continue installing as before.

One more change: when you call the websites on the second server from the browser bar: type localhost:81/your_website_name. There was no need to type localhost:80/website_name for the first server because 80 is the default port.

Now you can run server “1” which servers a handful of websites and server “2” which serves another set of websites, at the same time, because they are using different ports.  And you know what to type in the browser bars.

Turn off your UniServers

When you are finished using a Uniserver, choose the correct icon (“1” or “2”), go to the menu box, and turn off both servers.

How to change the settings of Skype

If you have Skype running and your local server will not run, then log into your Skype and go to Tools/Options/Advanced/Connect and uncheck the box ,which says use Port 80 and 443. SAVE,

Skype functions perfectly well without Port 80 and the conflict with your server is immediately resolved.

Congratulations – you are able to install UniServer into two separate folders working on two different pairs of ports. And you are able to install multiple websites on each server and tell the website which MySQL server

One Comment

%d bloggers like this: