Miscellaneous ⇒ User & Newbie Resources :: Archives ⇒ Setting Up Dragonfly on localhost in Mac OSX :: Archived ⇒ Community Forums ⇒ CPG Dragonfly™ CMS
Forum IndexUser & Newbie Resources

Archived ⇒ Setting Up Dragonfly on localhost in Mac OSX


I just finished installing Dragonfly on a local server on my Mac OSX computer. The process is extremely easy if you know what you are doing. If you are a n00b like me though, it could take a long time with lots of trial and error before you get lucky and do the right thing. Now that I have figured it out, I decided to write up a tutorial explaining exactly how to do it so that other people can benefit from my trial and error. Devs, feel free to post this in the Wiki if you want.

Setting up the Server
First you need to set up the server. This is the easy part since Mac OSX comes pre-installed with Apache and PHP. All you have to do is install MySQL and phpMyAdmin for managing the databases. There is a great package called WebServerXKit on the Apple site that installs these two with the click of a button, so I suggest downloading it: www.apple.com/download...rxkit.html

After you have installed WebServerXkit you should have everything ready to go. When it finishes installing, phpMyAdmin should open up automatically in your browser, but if it doesn't you can access it at localhost/phpMyAdmin

Use phpMyAdmin to set up a database and a user. Now comes the tricky part... where to place the dragonfly files so that they will be picked up at localhost/ ? This is what took me the longest time to figure out since I am fairly new to Mac and didn't know how to view hidden files. Well I finally discovered that phpMyAdmin is located in /usr/local/apache2/htdocs/ and since phpMyAdmin appears to be in the localhost directory, this must be the localhost directory where your files need to be.

Now the problem is that you can browse to this directory using the Finder window. You need to do a search. With the Finder on top, go to File > Find (or cmd+f). Enter phpMyAdmin in the search box and make sure that "visibility" is specified as "visible and invisible items" (select "visibility" from the box at the bottom left, and then select "visible and invisible items" from the box next to it.)

This should pull up an instance of the phpMyAdmin folder with "htdocs" as its parent. Click on this folder so that it is highlighted. You will notice that at the bottom of the screen, the path to this folder is now displayed. In that path, double-click on "apache2". This should open a new finder window with "apache2" opened inside. Select the "htdocs" folder inside the window, and drag it to the left column below "Pictures". Now you can always access the "htdocs" folder from your finder window, as it will always be in this left column.

Now move all the dragonfly files to this folder. Make sure that you edit config.php and enter the database information abou the database you created using phpMyAdmin earlier.

Before you can run the installer though, you have to chmod the following directories:

chmod 600
- cpg_error.log

chmod 755
- cache
- modules/coppermine/albums
- modules/coppermine/albums/userpics
- uploads/avatars
- uploads/forums

Doing a chmod in Mac OSX is extremely because we can simply use the finder to set permissions on files. Open a new finder window and go to your "htdocs" folder. Find the file that you need to chmod and right-click on it. Select "Get Info" and a new box appears. Click on the triangle next to "Ownership & Permissions" so that you can view the details there. Now you need to set each box to "Read & Write" for all the files (both the 600 and 755 chmods). Technically, a 755 chmod is supposed to be able to be executed as well, but this option isn't available here, and it seems to work anyway.

Once you have set all those files to "Read & Write" access in each box under "Ownership & Permissions", you are ready to install dragonfly.

Go to localhost/install.php and follow the directions in the installer. That's it! Now you have a dragonfly website on your Mac computer and you can mess around with it as much as you like without having to upload it to a server. This is great because you can develop things like new modules or themes without having to be connected to the internet so that you can upload them to a server for viewing. You can now view them on your own server on your computer! Cool I fall more in love my my Mac every day. Kiss

*Note* This only seems to work when you have "Personal Web Sharing" set to "Off" in the "Sharing" section of your System Preferences. You won't be able to access any files in localhost if "Personal Web Sharing" is on.

Purus Studios | Purus Studios: Dragonfly | The Pensive Penguin

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Shared Host / Linux / Apache 1.3.34 (Unix) / MySQL 4.1.11-standard / PHP 4.3.11 / CPG 9.0.6.1


Well done - have you considered also submitting this to Wiki?
dragonflycms.org/Wiki/id=65.html

DonationsPro for DragonflyCMS & SMF

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):


Doh, I didn't realize members could submit articles. I will definitely submit it then.

Purus Studios | Purus Studios: Dragonfly | The Pensive Penguin

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Shared Host / Linux / Apache 1.3.34 (Unix) / MySQL 4.1.11-standard / PHP 4.3.11 / CPG 9.0.6.1


Just to clarify how OS X organizes it's webserver...the computer's web root is under /Library/WebServer, ie localhost. Since the OS is designed to be multi-user, Personal Web Sharing toggles Apache for the individual user's sites, whose root(s) is at /Users/Username/Sites.

chmod'ing - can also be done via command-line in the Terminal app, if you're into Unix (shudder). I think there's some GUI freeware around too (Get Info works fine, just a bit slow when you're doing a bunch at once).

Invisible files - if you just want to mess about (carefully) and see what're really there, a neat little free utility is Invisibles.

I agree, Mac OS X absolutely rocks. WHY?!? Should be interesting to see what happens now that Mac is switching to Intel chips...faster, cheaper hardware with the best OS in the world...

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Linux :: 1.3.33 :: 4.0.24 :: 4.3.11 :: 9.0.4.0 :: Browsers: Mac: Safari 2.0 PC: Firefox 1.0.4, IE6 All Updates


winglet wrote
Just to clarify how OS X organizes it's webserver...the computer's web root is under /Library/WebServer, ie localhost. Since the OS is designed to be multi-user, Personal Web Sharing toggles Apache for the individual user's sites, whose root(s) is at /Users/Username/Sites.


I know, that is what I read all over online, but I wasn't able to manage to view my files when I placed them in the Sites folder, following the instructions that you find online. I don't know why this is, but I have managed to make it work like this, so I am going to stick to this. If you know how it is supposed to be done, and you think it might be easier for new users to figure out, then by all means edit the Wiki entry. That is the beauty of Wiki.

Purus Studios | Purus Studios: Dragonfly | The Pensive Penguin

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Shared Host / Linux / Apache 1.3.34 (Unix) / MySQL 4.1.11-standard / PHP 4.3.11 / CPG 9.0.6.1


Yes, by all means, please ensure you add to Wiki - for the members, by the members Smile

DonationsPro for DragonflyCMS & SMF

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):


Oh, there was no criticism implied! I had the same issues trying to figure out the file structure so I was just trying to clarify (and sneak in a good word for the Mac-heads! Wink

It took me a bit to wrap my head around the fact that there could be a "master" site running at the computer's IP, as well as individual sites running under each user - pretty cool!

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Linux :: 1.3.33 :: 4.0.24 :: 4.3.11 :: 9.0.4.0 :: Browsers: Mac: Safari 2.0 PC: Firefox 1.0.4, IE6 All Updates


winglet wrote
Oh, there was no criticism implied!


Oh, I know, I just thought that if you know how to do it the way Apple intended, then it might be best to edit the Wiki entry to reflect that. It would probably be less confusing for new people. I wasn't able to figure it out, so I would definitely be interested to see how it works with "Personal Web Sharing" and the Sites folder.

The Wiki entry is here if you want to modify it.

Purus Studios | Purus Studios: Dragonfly | The Pensive Penguin

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Shared Host / Linux / Apache 1.3.34 (Unix) / MySQL 4.1.11-standard / PHP 4.3.11 / CPG 9.0.6.1

All times are UTC