Help for initial setup and a bit of tailoring
Posted by: RiggsFolly (---.as13285.net)
Date: February 29, 2012 01:03AM

I setup wamp again on a rebuilt PC and this time i thought I would make some notes on what I did and why.

I hope they will be useful to somebody else.


These notes start from completing an install.



1. apache gives a 403 Forbidden error.
Symptom: Look at Apache Access log ( from Wamp manager link ) if it is showing the IP address as ::1 instead of 127.0.0.1 this is the solution.

Problem is that the [HOSTS] file on Vista and W7 has a reference to IPV6 localhost as follows :-
::1 localhost

FIX: If you remove that entry and restart the DNS Client service it will be solved.

Stop all services from Wamp Manager.
Start -> Control Panel -> Administrative Tools -> Services -> Find [DNS Client] in the list of services and click on [Restart]
( this flushes out the DNS cache that windows keeps to speed up DNS lookups which will contain all entries from HOSTS file)
Start all services from WAMP Manager.
Click on WAMP Manager -> Localhost.

Apache should now be working.

2. Run
http://localhost/testmysql.php
Symptoms: Cannot connect, gives various xdebug orange error messages.

FIX: First check that the wampapache and wampmysql services are running.
The MySQL server out of the box only has userid=root and password=[nothing] i.e. blank password.
So you will need to do a couple of things here.

a. change the testmysql.php script as follows.
FROM : mysql_connect( 'hostname', 'dbuser', 'dbpassword' );
TO: mysql_connect( 'localhost', 'root', '' );
rerun the script, it should now work.

b. THIS IS VERY INSECURE, So you need to setup a new Admin user with a proper password.
Open phpMyAdmin.
Click the Privileges button on the top row menu
Click [Edit Privileges] on one of the root users i.e. [root localhost]
Leave everything set as it is and scroll down to [Change Login Information / Copy User]
Change the User name: to a name you like for your admin userid and enter a secure password twice.
Scroll down to the [Go] button and this will create you a new admin user with all the root permissions.

NOTE: Leave the [.....Keep the old one] checkbox checked, come back later and delete all the other root users when you are happy that your new userid can do all the admin functions.

c. Before we can delete the other root userids from MySQL we now need to change WAMP's config so that it uses your new mysql admin userid.
a. Run Wamp Manager -> Mysql -> MySQL Console. This should load a command window and ask for a password.
The password will be [blank] as its using the original root userid. So just hit enter. You should see a few lines of welcome messages and a mysql> prompt. Type in quit.

b. Change this to use your new MySQL admin userid.

edit [x]:\wamp\wampmanager.tpl and do a find on "root" ( without the double quotes ).
you should be in Type: lineinside a [mysqlMenu] section.
change "-u root -p" TO "-u [Your New Admin Userid] -p"

Now to activate this change:
The tpl file is used as a config file for the wamp manager system, we must now get wamp manager to rebuild its ini file (wampmanager.ini)
To do this right click wamp manager and click the [Refresh] menu item. This reads wampmanager.tpl and re-creates wampmanager.ini
Now Run Wamp Manager -> Mysql -> MySQL Console and user your new admin users password. You should see the Welcome messages again and the mysql> prompt.

Now it should be safe to go back phpMyAdmin and delete ALL the old root users.


3. Having removed all root users from mysql or given tham a password at least, phpMyAdmin will now not work....
Change the following :-

Option 1:
edit [x]:\wamp\apps\phpmyadminX.Y.Z\config.inc.php
Change
$cfg['Servers'][$i]['user'] = 'root' to your new admin Userid
$cfg['Servers'][$i]['password'] = '' add in your new admin users password between the single quotes.

Option 2:
Makes the browser ask for a valid Userid/password set when you run the phpMyAdmin link and does not need the new userid/password set to be stored in the config file.
edit [x]:\wamp\apps\phpmyadminX.Y.Z\config.inc.php
Change
$cfg['Servers'][$i]['user'] = 'root'; TO $cfg['Servers'][$i]['user'] = '';
leave the ['password'] entry as '';
$cfg['Servers'][$i]['AllowNoPassword'] = true; TO $cfg['Servers'][$i]['AllowNoPassword'] = false;
add this line to make exiting phpMyAdmin return to a clean url instead of giving an error message
$cfg['Servers'][$i]['LogoutURL'] = 'http://localhost/';

In my opinion Option 2 is a better option.

4. Change wamp to use the editor of your choice and not notepad.
Edit wampmanager.tpl again change all references to notepad into your favourite editor.
eg. search and replace [notepad] for [xxxxx] the name of your editor.
Check that when you keyin xxx.exe at a command prompt it launches your editor, if that works it should also work when wamp manager does it.



Now if you have any sense, forget about phpMyAdmin and download MySQL Workbench


Other Issues:
APACHE Wont start: Look at the Event Viewer and if Apache is complaining about only one app allowed on each port, its probably Skype that is causing this issue, or something else that has grabbed port 80 or which ever port you are using before you start wampapache.

SKYPE: By default Skype uses port 80 to initially establish connection to its central server, if you are also using port 80 for your Apache server you will have to configure Skype to stop it using port 80. This is done by going to Skype and clicking the Tools menu -> options -> Advanced -> Connection. Uncheck the checkbox that says 'Use 80 and 443 as alternatives for incoming connections'.



Thats it so far. Got anything to add..... be my guest.



Edited 1 time(s). Last edit at 02/29/2012 01:17AM by RiggsFolly.

Options: ReplyQuote


Sorry, you can't reply to this topic. It has been closed.