Prerequisites Installing the Application

The publisher application must be installed. For more please read: Installing the Application

Decide if the Site should be in Version Control

1. Install a new site AND add it to the repository

For a site that will be put into production and kept under version control.

  • svn copy engine-room/prototype-site sites/yoursite

or:

This duplicates the files from the prototype-site directory into your local copy, and schedules them to be added to the repository.

DO NOT simple copy a directory ( eg. unix cp ), make sure you are using "svn copy ..."

2. Install a site on your local installation WITHOUT adding it to the repository

This is for experimenting, extra development versions etc.

  • svn export engine-room/prototype-site sites/yoursite

or:

This will make a local copy with no SVN bindings, no version control. It is possible to later svn import this site folder into the repository.

DO NOT simple copy a directory ( eg. unix cp )


Setup Your Site

1. Update config.php

  • Update the Site Name
  • give your site a site key
  • Change the SITE DEPTH variable config by changing the number "1" to the number of directories down of your installation

2. Update .htaccess (which controls URL rewriting)

  • Copy and add a RewriteEngine config file for your install
 * copy engine-room/DirectoryConfigs/sitekey.RewriteEngine.conf
 * paste engine-room/DirectoryConfigs/yoursitekey.RewriteEngine.cof
  • Update the one line that establishes your base directory in the file above
  • if needed do the same as above for sitekey.passwds.conf (update the template according to the instructions)
  • update the .htaccess file in your local directory with the correct filenames you created in the previous steps

.

3. Create a SYMLINK to master index.php file

  • ln -s ../../engineroom/mainclasses/indexStd.php indexphp

Run the Site Installer


OLD INSTRUCTIONS

For each site in the installation you need to add these files:

Application

In the $DOCUMENT_ROOT for each site copy the Application-example.php file to: Application.php. The need for this depends on whether this is a new domain or a sub-directory of an existing domain.

SiteConfig.php

Fill in a site key and the name of your site.

shared-www directory

You can use the old method - make a symlink from engine-room/shared-www to sites/yoursite/edit

cd sites/massmind ln -s ../../engine-room/shared-www edit

this makes a link, symbolic, from the file called "edit" to the original shared-www directory in engine-room.

it is possible to use a name other than "edit" for that folder (it is seen in the URL as that too), but you will need to check through the code to make sure nobody is referencing 'edit' directly. the constant EDIT_URL should be used always rather than hard coding 'edit'.

Or try my new method that will be standard soon. The new method requires a slightly different .htaccess file and does not create the edit symlink. Currently the dh site in SVN uses this and we will update live shortly. (DRRM - 2/7/2007)

change permissions

The webserver needs to be able to write to the directories in sites/yoursite/uploads

chmod a+w or chmod g+w


Now if you go to yoururl.com or dev.massmind.com/the-network/sites/yoursite you should see "No site record exists in 'sites' for SITE_KEY:" This is because you (probably) don't have an entry in the 'sites' table for your site. Do this by running install :

Go to your Web browser and visit http://yoursite/edit/install.php, this will check the tables (which should already exist since you are just adding a child site), and then it will INSERT a site record with your SITE_KEY (the SITE_KEY is defined in your Application file). [Again, if you are creating a dev site, you will need to go to the dev site URL for "yoursite". Duh.]

This will also automatically create a default layout and frontpage for you.

Then follow the link at the bottom of that page, log in ( or go to yoursite/edit/login/login.php ) You will need to login as "admin" with the requisite password.

The first thing you should make is an Admin Links which will give you some links to standard admin tasks like editing the primary layout, editing the sites record itself. You can do this by going to http://yoursite/edit/allClasses.php. [See "Admin Links in the list and click "New".] Once you have created it, you will then be viewing it. From there click "Default Layout". From there click the "Choose" link next to "Side Menu Blocks." On this page you will see your "Admin Links" and click the link to "add" them. Voila! Now you have Admin Links on the side of your site!

You can then use these Admin Link, the allClasses.php file and all.php to add, edit and build up your site.

See Turning a Design into a Website.



Its still a bit hard to come up with a solution that doesn't make the system become a single too-centralized entity. Right now its a single block of sites.

Its possible to make the configuration vastly easier by putting more things into the sites table and pointing all sites at the same folder. And switching by domain matching. That would be how an automated thing could be set up. It would create the uploads folders, images etc. on demand, but the main URLs would all point at the same spot. Have to find someplace to keep site specific php or html files.

But that would probably mean opening two database connections or at least making it still harder to separate small sites off on their own.


see DH design working notes