OK you had better have a .Net 4 IIS server and a SQL server already, or this is not going to work. And if sharing the web server with other sites, you should have a host name configured and pointing at the web server. But if you do, then it really is this easy…
Creating the site
- Download the latest release from http://mojoportal.codeplex.com/
- Unpack the zip and find the wwwroot folder. Copy the contents to wherever you want your web site files.
- On your SQL Server create an empty database, and give a login dbowner access to it.
- In the web site folder, rename user.config.sample to user.config and alter the MSSQLConnectionString to point at your new database. Better still copy in a user.config from another working site and adjust.
- In IIS Manager, we like to create a dedicated application pool per site:
- Then create a web site:
- On a PC, browse to your web site… you should see lots of messages appear like this:
Welcome to mojoPortal Setup
Probing system...
File system permissions ok.
MSSQL database connection ok.
database permissions are sufficient to alter schema.
database initial schema needs to be created.
Running script mojoportal-core - 2.3.4.8 - 00:00:00.0700000
Running script mojoportal-core - 2.3.4.9 - 00:00:03.2250000
Running script mojoportal-core - 2.3.5.0 - 00:00:03.2820000
Running script mojoportal-core - 2.3.5.1 - 00:00:03.3130000
etc etc
- Your site should now be up and running. Assuming it is, there are a couple more things to do to secure the site.
Securing the site
- Sign in as admin@admin.com / admin
- Got to Administration > Security Advisor – it will be warning you about the machine key. Click “Generate a new key”, copy the result, and paste it into your web.config on the web server (replacing the existing machine key – search the file for “machineKey”). This will make your site restart so you will have to log in again.
- Next visit the “Member List” page (using the link at the top of the page), and click “Add new user”. Create a new account for yourself, and after clicking “Create User” go to “Role Membership” and add the new account to the Administrators role. Sign out, and sign in again with your new account.
- Go to the Member List, “Manage” the “Admin” account, and delete it.
- Go to Administration > Site Settings > Security, and change the password format from “Clear Text in DB” to “Hashed in DB…”
- Screw down the permission on the web site folders as instructed here. We like to make the application pool run under a specific user account, then give this account the permissions described.
That’s it – you have a secure mojoPortal web site.
Useful settings
We like to add the following settings to user.config (remembering to touch web.config to make these take effect):
<!-- to allow extensionless URLs -->
<add key="AllowChangingFriendlyUrlPattern" value="true" />
<!-- Set these to false during design work -->
<add key="CacheCssOnServer" value="false"/>
<add key="CacheCssInBrowser" value="false"/>
<!-- To prevent startup scripts running. Change to false when upgrading mojo -->
<add key="DisableSetup" value="true" />
<!-- make sure admins put content files in same place as non-admins -->
<add key="ForceAdminsToUseMediaFolder" value="true" />
<add key="AllowForcingPreferredHostName" value="true" />
<!-- EMAIL -->
<add key="DisableDotNetOpenMail" value="true" />
<add key="SMTPServer" value="myserver" />
<add key="SMTPRequiresAuthentication" value="true" />
<add key="SMTPUseSsl" value="false" />
<add key="SMTPPort" value="25" />
<add key="SMTPUser" value="mymailserver" />
<add key="SMTPPassword" value="mypassword" />
<add key="SMTPTimeoutInMilliseconds" value="30000" />
<!-- Leave this blank for ASCII encoding. Allowed values are utf-8, utf-32, and unicode -->
<add key="SmtpPreferredEncoding" value=""/>
<!-- END EMAIL -->
Skinning the site
Big topic, with plenty of guidance on www.mojoportal.com, and we are now going over the 10 minutes! The easiest way to get started is to choose the shipped skin that is closest to your layout/behaviour requirements, clone this skin, then work on the CSS, layout.master and graphics. We usually review the extra skins that are available for each mojoPortal release (as well as the ones in the release folders). These are also found on the Codeplex download page (see above) as “extra-skins.zip”. If you drop the unzipped skin folders into \Data\skins in your web site folder they will be available for all child sites. If you have already create a site, you can drop them into \Data\Sites\N\skins (where N is the number of your site).