Installing using CVS repository

Last modified: September 4, 2009 - 10:00

Development of the Drupal codebase is fairly quick, with a new release every six months or so. To help keep up with the pace of Drupal, using the CVS repository can be beneficial. This allows you to use the CVS command "cvs update" to download the current bug fixes and improvements.

To have the cvs functionality available to you, you will need to install the developer tools that were included on the OS X DVD. If you don't have them installed, or don't want to install them, you could always download Drupal directly and place the resulting directory inside the default OS X web server directory:

/Library/WebServer/Documents

To get started and to be consistent with the default Mac OS X setup, navigate to /Library/WebServer/Documents (from the Terminal command line):

cd /Library/WebServer/Documents

Download the version of Drupal that you want from CVS:

cvs -z9 -d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal checkout -r REVISION_NUMBER -d LOCAL_DIRECTORY drupal

Notes: The REVISION_NUMBER must match a specific Drupal CVS tag for the checkout to work. If you are wanting to download the Drupal 6.13 release, then the REVISION_NUMBER would be DRUPAL-6-13. A full list of the Drupal core CVS tags available to you can be found at http://cvs.drupal.org/viewvc.py/drupal/drupal/ in the Sticky Tag drop down menu.

The LOCAL_DIRECTORY is the name of the folder you would like to place the Drupal files into. This directory will be created if it does not exist already.

If, next week, a bugfix has been issued for this release, all that you would have to do is (again, from the Terminal command line):

cd /Library/WebServer/Documents
cvs update -dP

By default, Apache on the Mac runs as user 'www' with group 'www', so you may need to do change the ownership of the drupal directory to allow Drupal to create new subdirectories and files:

chown -R www drupal
chgrp -R www drupal

If you are installing a Drupal 5 site or earlier, it is time to tell Drupal how to find that database. In the Finder, navigate to /Library/WebServer/Documents/Drupal/sites and duplicate the folder called default, and rename it localhost. Then inside the new localhost directory edit the settings.php file, changing line 93 to read:

$db_url = 'mysql://<database_username>:<database_name>@localhost/<name_of_database>;

and changing line 115 to read:

$base_url = 'http://localhost/drupal';

The reason to duplicate the "default" settings folder was to avoid conflicts when updating CVS in the future, since CVS would have seen the changed settings.php file and tried to merge it with the original one. By keeping a separate settings file, you can avoid this. As long as you access the Drupal installation through the URL http://localhost/drupal it will use the settings in the localhost folder.

PHP is not enabled by default on OS X, so it needs to be enabled in Apache's configuration file. Using a text editor, such as BBEdit, you could choose Go To Folder from the Finder's Go menu and type in /etc/httpd, then double-click on httpd.conf and OS X will prompt you for an application to edit the file with. From the Terminal command line you can edit the file by doing:

sudo bbedit /etc/httpd/httpd.conf

Once the file is opened, remove the # from in front of line 240:

#LoadModule php4_module        libexec/httpd/libphp4.so

and line 284:

#AddModule mod_php4.c

and line 406:

    AllowOverride All

After changing the configuration file, stop, then restart the Personal Web Sharing service in the Sharing pane of System Preferences. This forces Apache to reread the configuration file and apply the changes to enable PHP.

Navigate to http://localhost/drupal/install.php into your web browser. The message "Drupal installation complete" should appear and you shouldn't be flagged to provide the database's username and password, as it was done manually in a previous step.

Click on the link to continue to the "new site."

Now create the administrator account by following the link under item #1 of the new installation message. The first account you create in a new Drupal installation will always have access to all privileges, so provide a username like admin and enter in an email address. (Warning: naming your administrative account "admin" is bad security! Don't do this!). Then click on the "Create new account" button. Drupal responds by logging you in and displaying a randomly generated password and an opportunity to update the password to one of your own choosing.

If you are installing a Drupal 6 site or later, in the Finder, navigate to /Library/WebServer/Documents/sites/default, make a copy of the default.settings.php file, and rename it settings.php. In your web browser, visit http://localhost/drupal and follow the onscreen instructions to perform the initial Drupal install.

For Mac OS X Server 10.4

ptb - June 2, 2005 - 13:22

For Mac OS X Server 10.4 (a.k.a. Tiger Server), rather than modifying the /etc/httpd/httpd.conf file directly, consider putting the drupal-specific modifications in /etc/httpd/sites/drupal.conf. The last line of the stock httpd.conf file does a Include "/etc/httpd/sites/*.conf" so that way, if Apple pushes a configuration change onto the default httpd.conf, all the changes that drupal needs will continue to work.

What I meant to say is, do not make changes to /etc/httpd/httpd.conf since Apple could overwrite it (also it won't work -- it's not the right file). The correct file to add the AllowOverride All directive is in the directory /etc/httpd/sites/. In that directory are the virtual host configuration files. Each virtual server has a configuration file in that directory (since Mac OS X Server is designed to host multiple web sites) so it is in those files that you must enable AllowOverride All. If you only have one web server on your server configured, then the file you want to modify is /etc/httpd/sites/0000_any_80_.conf.

Thanks to David Hull for that tip.

Config to edit w/ Users dir install on OSX Tiger (NOT Server)

lars30 - November 28, 2005 - 17:38

If you are like me and are installing Drupal on a regular version of OSX, not the OSX Server version then you need to look in a different place to change the AllowOverride parameter.

If you are putting your Drupal files in a your "User" directory.. (in my case that directory is: /Users/lars/Sites/drupal) then you need to edit the User config file. For me, that file is here:

/etc/httpd/users/lars.conf

Note that in this case "lars" will be replaced by your user name, whatever it is.

If you place drupal in the "system" webroot, or /Library/WebServer/Documents/drupal for example.. then editing the /etc/httpd/httpd.conf file, as explained above, will work fine.

On Mac OS X Server 10.4 (Tiger)...

ptb - June 8, 2005 - 00:09

If you follow these directions to the letter, when it comes time to actually view your drupal site for the first time, it will not work. The reason is because we edited the sites/localhost/settings.php file. X Server by default uses a "Performance Cache" which appends a port number to http://localhost/drupal thus breaking the "localhost" part of the URL. The fix is to disable the Performance Cache in Server Admin.

Error: GD Image Toolkit?

altisssimo - January 10, 2006 - 07:39

Hi,

I dot everything working great! But...

Error message reads:
The built-in GD image toolkit requires that the GD module for PHP be installed and configured properly. For more information see http://php.net/image.

How do I deal with this? I went to this site and after 5 minutes realised the steps were beyond my skills. The instructions above worked a treat, but this GD Library thing is a concern.

Help?

Cheers,

Altisssimo
===

DarwinPorts

jvandyk - January 12, 2006 - 21:06

I got ImageMagick from DarwinPorts. After installing DarwinPorts, I opened a new Terminal window and typed

sudo port install ImageMagick

which installs the ImageMagick libraries and a host of dependencies (take a coffee break). Then I opened another new Terminal window, typed

which convert

and the computer responded with

/opt/local/bin/convert

which is what you can put in your Drupal settings page when it asks for the location of the convert binary (after installing image.module and placing image/imagemagick.inc into your includes directory).

mysql db connect problems

splatEric - July 1, 2006 - 10:18

so I went through and did a lot of this (although I have actually set up drupal in a user account instead of under the root location), and was having trouble with the db connection. I was able to connect to the db through the mysql console, so I knew it was working, but I just kept on getting connection errors.

I did a bit of searching, and came across the following wordpress forum posting:

http://wordpress.org/support/topic/60343

which led me to doing the following:

1. sudo cp /etc/php.ini.default /etc/php.ini
2. sudo vi /etc/php.ini
3. find "mysql.default_socket" and edit the line to read:
mysql.default_socket = /tmp/mysql.sock
4. save the change
5. restart the web server (through system preferences/sharing

and bingo was his name-o, one functioning drupal site.

now I just need to actually work out how to use it ;-)

won't read php, no file

mpstaton - December 30, 2008 - 03:43

all i can see is the code when i navigate to the file.

i turned on php using this guide http://foundationphp.com/index.php

there is no file here

/etc/httpd/httpd.conf

there is

/etc/httpd/

but nothing's in there.

any suggestions?

Michael Staton

Excellent XAMPP for Mac OSX Walkthrough

remedios - March 25, 2009 - 02:26

If you're using XAMPP as your apache/php/mysql setup, here is an extremely thorough walk-through. Very helpful.

http://courses.karlstolley.com/537/DrupalOnMac

Problems with the install

theblackdoves - May 15, 2009 - 19:04

I have set up mamp and downloaded drupal to my sites folder. I can get to localhost/drupal and it allows me to select English as my lang. The next page asks for Basic options

To set up your Drupal database, enter the following information.
Database type: *
mysqli
pgsql
The type of database your Drupal data will be stored in.
Database name: *

The name of the database your Drupal data will be stored in. It must exist on your server before Drupal can be installed.
Database username: *

Database password:

MAMP tells me that my info is as follows

Host: localhost
[Port: 3306]
User: root
Password: root

and drupal exists phpMyAdmin. However when I enter drupal as the database name and root as the User: I get the following message: ailed to connect to your MySQL database server. MySQL reports the following message: Access denied for user 'root'@'localhost' (using password: NO).

* Are you sure you have the correct username and password?
* Are you sure that you have typed the correct database hostname?
* Are you sure that the database server is running?

For more help, see the Installation and upgrading handbook. If you are unsure what these terms mean you should probably contact your hosting provider.

If i enter the same info

But if I enter drupal as the database name: and and root as the Database password: and and root as the User: I get taken to the data baseconfiguration with all feild blank and no error messages.

Any help with this would be most appreciated !

 
 

Drupal is a registered trademark of Dries Buytaert.