# InitialSetupTasks

administrators (basic)

Once you have PmWiki running on your site (see [Installation](/content/pmwiki/pmwiki.php?n=PmWiki.Installation)), you can customize it for your particular needs.

Most PmWiki configuration is performed in files called _local/config.php_ and _pub/css/local.css_.
Some configuration is done on special pages in the [Site](/content/pmwiki/pmwiki.php?n=Site.Site) and [SiteAdmin](/content/pmwiki/pmwiki.php?n=SiteAdmin.SiteAdmin) groups, such as the [Site.SideBar](/content/pmwiki/pmwiki.php?n=Site.SideBar) menu.

## The local configuration file ( _local/config.php_)

When you first install PmWiki, the _local/config.php_ file does not exist. Copy the _sample-config.php_ file (in the _docs/_ directory) to _local/config.php_ and use it as a starting point. You could create _local/config.php_ from scratch, but _sample-config.php_ is already populated with many of the options you might want to adjust.

Here is a simple _config.php_ file:

```php
<?php if (!defined('PmWiki')) exit();
$WikiTitle = "My New Wiki";
$PageLogoUrl = "http://example.com/mylogo.gif";

# Uncomment and correct these if PmWiki fails to detect the browser-reachable URLs
#$ScriptUrl = 'http://example.com/pmwiki/pmwiki.php';
#$PubDirUrl = 'http://example.com/pmwiki/pub';

$DefaultPasswords['admin'] = pmcrypt('onesecret');

$EnableUpload = 1;
$DefaultPasswords['upload'] = pmcrypt('secrettwo');

# Uncomment and change these if your server is not in your timezone
# date_default_timezone_set('America/New_York'); # if you run PHP 5.1 or newer
# putenv("TZ=EST5EDT"); # if you run PHP 5.0 or older

$TimeFmt = '%B %d, %Y, at %I:%M %p %Z';
```

Note that _config.php_ begins with `<?php` . The PHP end tag `?>` is optional, and can be left off to improve compatibility with some operating systems. Be sure there aren't any blank lines or spaces before the `<?php` or after any closing `?>`, or else you may get strange PHP error messages at the beginning of your wiki pages.

The _config.php_ file above sets the value of PHP variables used by PmWiki:

- The [`$WikiTitle`](/content/pmwiki/pmwiki.php?n=PmWiki.LayoutVariables#WikiTitle/index.html) variable gives the name of your site as it will appear in a user's browser title bar.
- The `$ScriptUrl` and `$PubDirUrl` variables tell your wiki where it is located. Often pmwiki can guess, but if you have difficulty with links not working or skins not being found then try uncommenting these lines.
- The [`$PageLogoUrl`](/content/pmwiki/pmwiki.php?n=PmWiki.LayoutVariables#PageLogoUrl/index.html) variable specifies the URL of the icon image that will appear in the upper-left corner of each wiki page.
- The `$DefaultPasswords['admin']` sets an administrative password.
- Setting [`$EnableUpload`](/content/pmwiki/pmwiki.php?n=PmWiki.UploadVariables#EnableUpload/index.html) to "1" enables Uploads ("Attached files"). `$DefaultPasswords['upload']` sets an upload password.
- The date_default_timezone_set tells PHP what the default time zone is (for the time stamps in RecentChanges, in the page histories and on user signatures). For a list of identifiers, see [the online PHP manual](https://www.php.net/manual/en/timezones.php).

- On PHP older than 5.1, use the TZ environment variable (see [Cookbook:ChangeTimeFormat](https://www.pmwiki.org/wiki/Cookbook/ChangeTimeFormat)).
- The [`$TimeFmt`](/content/pmwiki/pmwiki.php?n=PmWiki.BasicVariables#TimeFmt/index.html) variable defines the appearance of time strings (see [Cookbook:ChangeTimeFormat](https://www.pmwiki.org/wiki/Cookbook/ChangeTimeFormat)).

By setting these (and other) variables in _local/config.php_, you can change the look and feel of PmWiki from its default, sometimes substantially so. See [PmWiki.Variables](/content/pmwiki/pmwiki.php?n=PmWiki.Variables) for a list of variables that PmWiki uses, and see [PmWiki:PmWikiUsers](https://www.pmwiki.org/wiki/PmWiki/PmWikiUsers) for examples of sites that use PmWiki in customized ways.

### Other common setup tasks

The following [variables](/content/pmwiki/pmwiki.php?n=PmWiki.Variables) are often requested when preparing a new wiki

- Author required when editing a page `$EnablePostAuthorRequired = 1;`
- Set [`$DefaultGroup`](/content/pmwiki/pmwiki.php?n=PmWiki.BasicVariables#DefaultGroup/index.html) and the [`$DefaultPage`](/content/pmwiki/pmwiki.php?n=PmWiki.BasicVariables#DefaultPage/index.html).

These common [Cookbook](https://www.pmwiki.org/wiki/Cookbook/Cookbook) recipes are also often installed immediately

- [Clean Urls](https://www.pmwiki.org/wiki/Cookbook/Clean%20Urls) \- Remove the `?n=Group.Page` arguments from the end of URLs

If you prepare an international wiki, potentially with characters in different alphabets (Cyrillic, Greek, Chinese) or many diacritical symbols (Czech + French), please look at [PmWiki.UTF-8](/content/pmwiki/pmwiki.php?n=PmWiki.UTF-8/index.html) and [Cookbook:UTF-8](https://www.pmwiki.org/wiki/Cookbook/UTF-8).

## Security

Review and set up any [security](/content/pmwiki/pmwiki.php?n=PmWiki.Security) required.

### Setting an administrative password

The pages in the [Site](/content/pmwiki/pmwiki.php?n=Site.Site) group (except the `Site.SideBar`) are locked by default. In order to edit pages in this group you need to create a site-wide admin password in _local/config.php_. To set the site-wide admin password to "mysecret", change the line to the following:

`$DefaultPasswords['admin'] = pmcrypt('mysecret');`

You must use the `pmcrypt()` function, but set the password to a value with meaning for you. See [PasswordsAdmin](/content/pmwiki/pmwiki.php?n=PmWiki.PasswordsAdmin) for details about making the password more secure.

## Don't modify or rename _pmwiki.php_

PmWiki has been designed so that all customizations can be made without changing the distribution files -- one of its design goals is to provide seamless upgrades. PmWiki never writes to files in the _local/_ or _cookbook/_ directories, so placing your customizations here makes it easier to track the changes and [upgrade PmWiki](/content/pmwiki/pmwiki.php?n=PmWiki.Upgrades) without losing the changes.

When changing the configuration of your site, always change the _local/config.php_ file or add files to the _cookbook/_ or _pub_ directories. Do not change _pmwiki.php_ or the files in the _scripts/_ directory because the files are supposed to be overwritten upon upgrading.

You shouldn't rename _pmwiki.php_ either. If you rename the file it will not be overwritten during an upgrade of the software and there will be a version mismatch. Many administrators add an _index.php_ "wrapper script" in the pmwiki directory that contains the following single line:

`<?php include('pmwiki.php');`

Just make a text-file. Paste `<?php include('pmwiki.php');` into it.
Save the file as `index.php`.
Send it via FTP to the same directory where `pmwiki.php` is located.

## Other organisation

### Upload directories

By default Pmwiki uses an upload directory for each group (see [Uploads administration](/content/pmwiki/pmwiki.php?n=PmWiki.UploadsAdmin#uploaddirectoryconfiguration/index.html).
Deciding on accepting the default, or choosing an alternative (eg one directory for the entire wiki, or one directory per page) is best done when setting up your wiki.

### Page store directories

By default Pmwiki uses a single page store directory (wiki.d).
Deciding on accepting the default (recommended), or choosing the alternative (one directory per group) is best done when setting up your wiki. [\[1\]](https://www.pmwiki.org/wiki/Cookbook/PerGroupSubDirectories)

### Category GroupFooter

For a new wiki the page [Category.GroupFooter](/content/pmwiki/pmwiki.php?n=Category.GroupFooter) can be updated to

`(:pagelist category={*$Name} list=normal:)`

so that only categorised or tagged pages, i.e. those with `[[!tag]]` markup are displayed,
and pages that link to categories i.e. those with `[[Category.tag]]` markup are hidden.

## Other customization

After setting up _local/config.php_ file, you may wish to make other [local customizations](/content/pmwiki/pmwiki.php?n=PmWiki.LocalCustomizations). See the [PmWiki Cookbook](https://www.pmwiki.org/wiki/Cookbook/CookbookBasics) for a large number of customizations that have been contributed. And don't fear Cookbook recipes - they're well prepared, so that most of them require only to download a single file, add a one-line include command to `config.php`, and _voilà!_ \- they're working!

If you (or others sharing your server) want to maintain more than one wiki on the same server, see [Wiki Farms](/content/pmwiki/pmwiki.php?n=PmWiki.WikiFarms).

## Now what?

Don't forget to join a [PmWiki mailing list](/content/pmwiki/pmwiki.php?n=PmWiki.MailingLists), where you can email other [wiki administrators](/content/pmwiki/pmwiki.php?n=PmWiki.WikiAdministrator) for help on customizing PmWiki and participate in discussions about PmWiki improvements. Once you have your site operational, be sure to add it to [PmWiki:PmWikiUsers](https://www.pmwiki.org/wiki/PmWiki/PmWikiUsers) so others will know about it!
