Account ×
Login

Starterlibrary © 2025 All rights reserved

MoDirectory Setup Guide

Follow these steps to install MoDirectory on your server and set up the necessary dependencies.

Introduction

MoDirectory is a powerful, self-hosted business directory software platform designed for creating and managing local business listings across any niche.

This guide will walk you through the initial setup, server requirements, and installation of the project on your web server.

Server Requirements

Ensure your server meets the following requirements before proceeding:

  • PHP 8.4 with FPM
  • PostgreSQL 16+ (recommended: PostgreSQL 17)
  • Nginx v1.22 (or higher) (preferred) or Apache with mod_rewrite
  • Composer (latest version)

1. Download & Upload MoDirectory

After purchasing MoDirectory, download the ZIP file from the Downloads page and upload it to your web server. You can use file transfer client like FileZilla or WinSCP to upload the MoDirectory.zip to your web server. You need to move this folder to the document root directory of your domain, then unzip the MoDirectory.zip file.

cd /var/www/html
unzip MoDirectory.zip -d MoDirectory
          

Note: You can rename the MoDirectory folder to match your domain name or a name of your choice for better branding.

2. Install Dependencies

Navigate to your MoDirectory app folder and install dependencies.

cd MoDirectory
composer install
          

3. Configure Google API

Enable Google OAuth and Maps API from the Google Developer Console.

After creating the credentials, update config.php with your keys:

define('GOOGLE_CLIENT_ID', 'your_google_client_id');
define('GOOGLE_CLIENT_SECRET', 'your_google_client_secret');
define('GOOGLE_MAPS_API_KEY', 'your_google_maps_api_key');
define('GOOGLE_MAPS_SECRET_KEY', 'your_google_maps_secret_key');
          

4. Configure Nginx or Apache

For production, configure your web server to handle requests appropriately.

Nginx Configuration

server {
    listen 80;
    server_name yourdomain.com;
    server_tokens off;
    
    access_log /var/log/nginx/yourdomain.com-access.log;
    error_log  /var/log/nginx/yourdomain.com-error.log;

    location / {
        proxy_pass http://localhost:5500;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_http_version 1.1;
        proxy_set_header Connection "";
        keepalive_timeout 75s;
    }

    location /public/uploads/ {
        alias /var/www/html/MoDirectory/public/uploads/;
        access_log off;

        location ~* \.(jpg|jpeg|png|gif|ico|webp)$ {
            expires 30d;
            add_header Cache-Control "public, no-transform";
        }

        location ~* \.(css|js|svg|woff|woff2)$ {
            expires 7d;
            add_header Cache-Control "public, no-transform";
        }
    }

    location = /robots.txt {
        alias /var/www/html/MoDirectory/public/robots.txt;
        access_log off;
        log_not_found off;
    }

    location = /sitemap.xml {
        alias /var/www/html/MoDirectory/public/sitemap.xml;
        access_log off;
        log_not_found off;
    }

    location = /ads.txt {
        alias /var/www/html/MoDirectory/public/ads.txt;
        access_log off;
        log_not_found off;
    }

    location = /favicon.ico { 
        access_log off; 
        log_not_found off; 
    }

    error_page 404 /index.php;
}
          

Apache Configuration

To have Apache serve your app at http://localhost:5500, ensure Apache is listening on port 5500 by adding Listen 5500 in your ports.conf (or equivalent), then add a VirtualHost:

<VirtualHost *:5500>
    ServerName yourdomain.com
    DocumentRoot /var/www/html/MoDirectory

    
        AllowOverride All
        Require all granted
    

    # Alias for static files
    Alias /public/uploads/ /var/www/html/MoDirectory/public/uploads/
    
        Options Indexes FollowSymLinks
        AllowOverride None
        Require all granted
    

    Alias /robots.txt /var/www/html/MoDirectory/public/robots.txt
    Alias /sitemap.xml /var/www/html/MoDirectory/public/sitemap.xml
    Alias /ads.txt /var/www/html/MoDirectory/public/ads.txt

    ErrorLog ${APACHE_LOG_DIR}/yourdomain.com_error.log
    CustomLog ${APACHE_LOG_DIR}/yourdomain.com_access.log combined
</VirtualHost>
          

5. Restart PHP-FPM & Web Server

Run the following commands to restart your PHP and web server:

sudo systemctl restart php-fpm
sudo systemctl restart nginx
          

6. Start PHP Server

Start the PHP built-in server by running the following command in the project root:

cd MoDirectory
nohup php -S localhost:5500 -t public > appserver_$(date +\%F).log 2>&1 &
          

7. Access the Site

Once the server is running, open your browser and navigate to:

https://yourdomain.com

This will load the live site served via the configured proxy.

8. Setup & Install

Go to https://yourdomain.com/install and provide the following details to begin the installation process.

  • App/Site name
  • Admin Email and Password
  • Database Host, Name, User, Password, and Port (5432 by default)

Click Install to complete the setup and installation process.

9. Activate Your License

Login to your site using the credentials created during installation.

Go to https://yourdomain.com/license and enter your license key found in Downloads to activate the product.