How to Install PmWiki on FreeBSD

PmWiki is a popular wiki application used to create and maintain wikis on a website. In this tutorial, we will guide you through the process of installing PmWiki on FreeBSD.

Prerequisites

Before you start the installation, you need to ensure that you have the following prerequisites:

Step 1: Download PmWiki

To download PmWiki, follow these steps:

  1. Open your browser and go to the PmWiki download page.
  2. Click on the "pmwiki-latest.tgz" link to download the latest version of PmWiki.

Step 2: Extract PmWiki

After downloading PmWiki, you need to extract the package. Follow these steps:

  1. Open your terminal and navigate to the directory where the file was downloaded.

  2. Run the following command to extract the package:

    tar -xvzf pmwiki-latest.tgz
    
  3. This will extract the PmWiki package in a directory called "pmwiki".

Step 3: Move PmWiki to your web server's directory

After extracting PmWiki, you need to move it to your web server's directory. Follow these steps:

  1. Navigate to the pmwiki directory that was just created:

    cd pmwiki
    
  2. Copy the contents of the pmwiki directory to the web server directory:

    cp -R . /usr/local/www/apache24/data/pmwiki/
    

Step 4: Set permissions

After moving PmWiki to the web server's directory, you need to set the appropriate permissions. Follow these steps:

  1. Navigate to the pmwiki directory:

    cd /usr/local/www/apache24/data/pmwiki/
    
  2. Run the following commands to set the permissions:

    chown -R www:www .
    chmod -R 755 .
    chmod -R 777 wiki.d
    

Step 5: Create the PmWiki database

Before you can use PmWiki, you need to create a database for it. Follow these steps:

  1. Log in to your MySQL or MariaDB server:

    mysql -u root -p
    
  2. Create a new database for PmWiki:

    CREATE DATABASE pmwiki_db;
    
  3. Create a new user and grant it access to the PmWiki database:

    CREATE USER 'pmwiki_user'@'localhost' IDENTIFIED BY 'password';
    GRANT ALL PRIVILEGES ON pmwiki_db.* TO 'pmwiki_user'@'localhost';
    FLUSH PRIVILEGES;
    
  4. Exit the MySQL shell:

    exit
    

Step 6: Configure PmWiki

After setting up the database, you need to configure PmWiki. Follow these steps:

  1. Rename the "local/config.php" file to "local/config.php.backup":

    mv local/config.php local/config.php.backup
    
  2. Create a new "local/config.php" file:

    cp local/farmconfig.php local/config.php
    
  3. Open the "local/config.php" file in your favorite text editor:

    nano local/config.php
    
  4. Modify the following lines to reflect your MySQL or MariaDB database settings:

    $FarmD = '/usr/local/www/apache24/data/pmwiki';
    $FarmPubDirUrl = 'http://yourdomain.com/pmwiki/pub';
    $FarmPubDirPath = $FarmD.'/pub';
    $ScriptUrl = 'http://yourdomain.com/pmwiki/index.php';
    $ScriptPath = '/pmwiki';
    $WikiTitle = 'Your Wiki Title';
    $WikiName = 'YourWikiName';
    $WikiTag = 'yourwikitag';
    $WikiAdminName = 'WikiAdmin';
    $WikiAdminPass = crypt('yourpasswordhere');
    $EnableLockFile = 0;
    $EnablePostAuthorRequired = 0;
    $EnablePageIndex = 0;
    $EnableDirectDownload = 1;
    $EnableIMSCaching = 1;
    $EnableUploadVersions = 1;
    $EnableXLPage = 0;
    $XLPageTemplate['group'] = '$SiteGroup.GroupHeader';
    $XLPageTemplate['stdinclude'] = '@stdhead';  
    $EnablePathInfo = 0;
    $EnablePageListProtect = 1;
    $DBAuth['driver'] = 'mysql';
    $DBAuth['server'] = 'localhost';
    $DBAuth['user'] = 'pmwiki_user';
    $DBAuth['password'] = 'password';
    $DBAuth['database'] = 'pmwiki_db';
    
  5. Save the changes to the "local/config.php" file.

Step 7: Test PmWiki

After configuring PmWiki, you can now test it. Follow these steps:

  1. Open your browser and go to http://yourdomain.com/pmwiki/.
  2. If everything is configured correctly, you should see the PmWiki homepage.

Congratulations! You have successfully installed PmWiki on FreeBSD.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!