Setting up a web server for testing in Mac OSX 10.4 "Tiger"
Setting up your own web server on Mac to test various open source CMS is a doodle, thanks to MAMP.
MAMP provides you with:
- Apache 2
- PHP 4 / 5
- mySQL 5
- eAccelerator
- phpmyadmin
That is all you really need as a testing ground for web developement.
All you need to do is download MAMP (current version is 1.7.1). Once downloaded to your desktop, unpack and drag the icon to your applications folder and run it from your applications folder.
A control panel should appear that looks like this:

and then a webpage will popup in your default browser (screenshot below):

Now you can start to test your sites. Your web root folder is /Apllications/MAMP/htdocs
This is the folder where MAMP will be looking for any of your sites. This can be changed in your MAMP control panel by clicking on 'Preferences' though i would just leave as it. The thing you want to change in the 'preferences is the 'Ports' settings, click on 'Set to default Apache and MySQL ports so it should fill in as:
Apache Port: 80
MySQL Post: 3306
To save you all the hassle having to browse to your htdocs all the time, create an alias link to the folder. Do this by going to /Applications/MAMP/ find the folder /htdocs and right click on it then select 'Make Alias'. This should create a linked folder, drag this to your desktop.
If you need to make some changes to php.ini or the httpd.conf file you'll find them in Applications/MAMP/config folder.
MAMP allows you to switch between PHP 4 or 5, you find these settings in your preferences in the MAMP control panel. I would try and run PHP 5 at all times since PHP 4 support will be dropped by end of next month.
Each site you create should be placed in a folder in the web root. To access your sites use: http:localhost/{folder of site}/
By default, your mysql password is
user: root
password: root
If you are only using it on your Mac without public access then this is fine. But if you decide to open it up for public access then i highly recommend you change the mySQL password.
To do this, open up a terminal and enter:
/Applications/MAMP/Library/bin/mysqladmin -u root -p password < NEWPASSWORD >
Instead of < NEWPASSWORD > use the new password you want.
Once the password has changed, remember to also set the new password for phpmyadmin. To change this, navigate to
/Applications/MAMP/bin/phpMyAdmin-X.X.X/config.inc.php
and open up the file config.inc.php with a text editor of your choice. Find the line:
$cfg['Servers'][$i]['password'] = 'root';
and change 'root' to your new password.
That is all, let the fun begin...
Trackback URL for this post:
Bookmarked your post over at Blog Bookmarker.com!

Delicious
Digg
StumbleUpon
Reddit
Newsvine
Google
Technorati


Missing one step in changing passwords on MAMP
in /Applications/MAMP/bin/mamp/index.php
you need to change this line of code
$link = @mysql_connect(':/Applications/MAMP/tmp/mysql/mysql.sock', 'root', 'root');
to this
$link = @mysql_connect(':/Applications/MAMP/tmp/mysql/mysql.sock', 'root', 'NEWPASSWORD');