Rebol Talk Forum  |  Getting Started  |  Code Examples, Tips & Advice  |  Topic: How to Install Vanilla on Mac OSX using MAMP
Pages: [1] Print
Author Topic: How to Install Vanilla on Mac OSX using MAMP  (Read 623 times)
old_mac
Newbie
*
Offline Offline

Posts: 12


View Profile
How to Install Vanilla on Mac OSX using MAMP
« on: July 12, 2007, 12:01:11 PM »

I thought I would post this here and please distribute it freely.

Many Mac users prefer the MAMP install of Apache/MySQL/PHP to the much older Apple version that comes pre-installed with the OSX operating system. MAMP co-exists with the Apple version but this presents problems if you try to use REBOL SDK with a MAMP installation. This has been tested with OSX 10.4.10 on an iMac Duo Core 2 as of July 12, 2007.

When you install MAMP it basically makes a 'self contained' server in your Applications folder. These instructions presume you have a MAMP server running well on your Mac and that you have some familiarity with the Terminal application. That you have the most recent version of REBOL download and the most recent version of Vanilla downloaded and all uncompressed.

Go to your Applications folder and find the MAMP folder. Open it. Inside there are a number of folders etc. and we are interested in 3 of them. They are 'bin', 'htdocs' and cgi-bin.

1. Get rebol in the tools folder of the rebol download (not rebol.r). Copy it and put it into the 'bin' folder. Rename it 'rebol'.

2. Take the entire vanilla folder and copy it. Move it to the 'htdocs' folder. Rename it 'vanilla'

Now get your favorite text editor like bbedit, textmate, textedit etc. We are now going to make an alternate chmod.sh file for the MAMP install.

Copy the text below and paste it into your text editor and save it as chmodMAMP.sh in your vanilla folder. (just the blue text)



#!/bin/sh

# Mac specific - for MAMP install
cd /Applications/MAMP/bin # change directory to point to 'bin folder'
chmod +x rebol # make rebol file executable

cd /Applications/MAMP/htdocs/vanilla # change to vanilla folder

# vanilla root
chmod 705 apps/
chmod 701 db/
chmod 701 lib/
chmod 707 space/

chmod 705 vanilla.r
chmod 604 vanilla.r.conf

# apps/
find apps/ -type d -exec chmod 705 \{} \;
find apps/ -type f -exec chmod 604 \{} \;

# db/
chmod 707 db/session/
chmod 707 db/user/
find db/ -type f -user $USER -exec chmod 606 \{} \;

# lib/
find lib/ -type d -exec chmod 701 \{} \;
find lib/ -type f -exec chmod 604 \{} \;

# space/
chmod 705 space/initial/
find space/ -type f -user $USER -exec chmod 606 \{} \;
find space/initial/ -type f -user $USER -exec chmod 604 \{} \;

# Insert here Mac specific
chmod +x vanilla.r  # make vanilla.r file executable
chmod +x wrapper.cgi # make wrapper folder executable

mv -f wrapper.cgi /Applications/MAMP/cgi-bin/vanilla.r # move wrapper to cgi-bin folder and changes the wrapper name to vanilla.r
mv -f vanilla.r.conf /Applications/MAMP/cgi-bin/ # move vanilla.r.conf (wrapper configuration file) to cgi-bin folder

echo "******Vanilla MAC OSX - MAMP file operations are completed*************"
exit



3. Double click on the file chmodMAMP.sh you just made. This will start the Terminal application and run the script. What this does is to set the file permissions for rebol and vanilla and move two files from the vanilla folder into the cgi-bin folder and rename one.

4. Be certain there were no errors in the script or files that can not be found. If there were, you have dome something wrong and should start over again.

IMPORTANT:

Before we can try our new Vanilla install, there is a bit of file editing to be done.

1. Open the cgi-bin folder inside the MAMP folder.
2. Open the file vanilla.r  in your text editor. Put this (below) on the first line of the file and save it.

                           #!/Applications/MAMP/bin/rebol - cs

This tells vanilla where to find the rebol file to run.

3. Open the other file, vanilla.r.conf in your text editor. About line 14 we need to change
the string "@@vanilla-space-id@@" to whatever you want. Perhaps "I like REBOL"

4. On line 21 we need to change the "@@vanilla-root-path@@". This MUST BE

                          "/Applications/MAMP/htdocs/vanilla/"

OK, save the file. We are almost there.

4. There is an adjustment required in the /htdocs/vanilla/vanilla.r file . So open the htdocs file inside your MAMP folder, then open the vanilla folder.

5. Open vanilla.r in your text editor. Find lines 232 and 233.

Change line 232 to read:  "resource-dir"                   join vanilla-root "res/"
Change line 233 to read:  "resource-url"              "../vanilla/res/"

Save the file. Quit the text editor we are done!

Open your browser and type:  http://127.0.0.1/cgi-bin/vanilla.r 

                  or                       http://localhost/cgi-bin/vanilla.r

You should see a blue and grey form requesting you to register as a master user.

Success! REBOL and Vanilla are running. After this you are on your own! Good Luck.

Chris Dwyer
http://cllcanada.ca
Logged
Pages: [1] Print 
Rebol Talk Forum  |  Getting Started  |  Code Examples, Tips & Advice  |  Topic: How to Install Vanilla on Mac OSX using MAMP
Jump to:  

  
Quick Search...

Advanced search
  
Welcome, Guest. Please login or register.
Did you miss your activation email?
October 08, 2008, 02:43:03 AM
Username: Password: Session Length:
  

News: 01-09-08

Alpha version of REBOL 3 has been released!


  
2245 Posts in 589 Topics by 2259 Members
Latest Member: edibritrava

  Rebol Talk Forum | Powered by SMF 1.0.9.
© 2001-2005, Lewis Media. All Rights Reserved.

RT design by Defiant Pc