Document Root Configuration
The public folder is the only directory that should be accessible via the web. This prevents direct access to:- Application code in
/application - Configuration files
.gitrepository- System files and temp directories
Apache Configuration
Step 1: Enable mod_rewrite
mod_rewrite is essential for clean URLs in MINI.- Ubuntu/Debian
- CentOS/RHEL
- XAMPP (Windows)
- MAMP (Mac)
- EasyPHP (Windows)
- AMPPS
Step 2: Configure Virtual Host
Create or edit your virtual host configuration:Configuration explanation
Configuration explanation
ServerName: Your local domain (add to/etc/hostsorC:\Windows\System32\drivers\etc\hosts)DocumentRoot: Points to the/publicfolderAllowOverride All: Allows.htaccessto workOptions -Indexes: Prevents directory listingRequire all granted(2.4) orAllow from all(2.2): Grants access
- Ubuntu/Debian:
/etc/apache2/sites-available/myproject.conf - CentOS/RHEL:
/etc/httpd/conf.d/myproject.conf - XAMPP:
xampp/apache/conf/extra/httpd-vhosts.conf
Step 3: .htaccess Configuration
MINI includes a pre-configured.htaccess file in /public/.htaccess:
public/.htaccess
This file is already included with MINI. You don’t need to create it manually.
Fallback .htaccess
The root.htaccess provides fallback if the document root isn’t set to /public:
.htaccess (root)
nginx Configuration
nginx is fully supported with the following configuration:/etc/nginx/sites-available/myproject
nginx configuration notes
nginx configuration notes
- Adjust
fastcgi_passfor your PHP-FPM socket location:- PHP 5.x:
unix:/var/run/php5-fpm.sock - PHP 7.0:
unix:/var/run/php/php7.0-fpm.sock - PHP 7.4:
unix:/var/run/php/php7.4-fpm.sock - PHP 8.0:
unix:/var/run/php/php8.0-fpm.sock - Or TCP:
127.0.0.1:9000
- PHP 5.x:
rootmust point to the/publicfolder- For detailed discussion, see GitHub issue #55
File Permissions
Set proper permissions for security:Replace
www-data with your web server user:- Ubuntu/Debian:
www-data - CentOS/RHEL:
apache - Mac:
_www
Installation Tutorials
Detailed step-by-step installation guides:Ubuntu 14.04 LTS
Auto-install script for Ubuntu 14.04
Ubuntu 12.04 LTS
LAMP stack setup on Ubuntu 12.04
Ubuntu 14.04 mod_rewrite
Enable mod_rewrite on Ubuntu 14.04
Ubuntu 12.04 mod_rewrite
Enable mod_rewrite on Ubuntu 12.04
XAMPP Windows
Enable mod_rewrite in XAMPP
MAMP Mac
Configure .htaccess on MAMP
EasyPHP
EasyPHP and .htaccess setup
AMPPS
AMPPS rewrite configuration
Vagrant Setup (Automated)
For a fully automated development environment:Prerequisites
- Install Vagrant
- Install VirtualBox
Setup Steps
-
Add Ubuntu box (if not already added):
-
Copy Vagrant files:
-
Start Vagrant:
-
Access the application:
Open
http://192.168.33.44in your browser
What Vagrant installs automatically
What Vagrant installs automatically
- Ubuntu 20.04 LTS
- Apache 2.4
- PHP 7.4
- MySQL
- PHPMyAdmin
- Git
- Enables mod_rewrite
- Clones MINI from GitHub
- Creates database and imports demo data
- Configures everything automatically
- MySQL root password:
12345678 - PHPMyAdmin password:
12345678 - Project location:
/var/www/html/myproject
Subdirectory Installation
MINI works perfectly in subdirectories without additional configuration.
example.com/myapp/):
- Upload files to your subdirectory
- Ensure
.htaccessis present in/public - The application auto-detects the subfolder path
application/config/config.php8 handles this automatically:
Security Best Practices
- Document root →
/publicfolder only - File permissions → Restrictive (644 for files, 755 for directories)
- Config files → Not web-accessible (600 permissions)
- Database credentials → Use strong passwords
- Error reporting → Disable in production (
config.php3) - Directory listing → Disabled (
Options -Indexes) - Git folder → Not in document root
- .htaccess → Properly configured
Testing Your Setup
Test URL routing
Access these URLs:
http://yoursite.com/→ Should show homepagehttp://yoursite.com/home/exampleOne→ Should show example pagehttp://yoursite.com/songs→ Should show songs list
Next Steps
Database Setup
Configure database and import demo data
Troubleshooting
Fix common server issues
