This section walks you through the complete installation process from start to finish. You'll learn how to prepare your server, upload files, create a database, run the installer wizard, configure your web server (Apache or Nginx), set file permissions, and complete post-installation tasks. Follow these steps in order for a successful installation.
Complete these preliminary steps before running the ChatNet installer.
Upload all files to your web server using FTP or your hosting control panel. You can place files in:
yourdomain.com)yourdomain.com/chat)chatnet_db)The installation wizard guides you through database configuration, site settings, and admin account creation.
Open your browser and navigate to:
https://yourdomain.com/installThe installer will guide you through the setup process.
The installer verifies that your server meets all requirements:
If any requirements fail, address them before proceeding.
Enter your database credentials:
| Field | Description |
|---|---|
| Database Host | Usually localhost |
| Database Name | The database you created |
| Database User | The database user |
| Database Password | The user's password |
| Database Port | Usually 3306 |
| Table Prefix | Default is cn_ |
Click Test Connection to verify the settings.
Configure your site:
| Field | Description |
|---|---|
| Site Name | Your chat site name |
| Site URL | Full URL (e.g., https://yourdomain.com) |
| Admin Email | Administrator email address |
Create your administrator account:
| Field | Description |
|---|---|
| Username | Admin username |
| Admin email address | |
| Password | Strong password (8+ characters) |
Click Install to complete the installation.
Configure your Apache or Nginx web server to properly serve ChatNet with URL rewriting enabled.
ChatNet includes a pre-configured .htaccess file. Ensure mod_rewrite is enabled:
sudo a2enmod rewrite sudo systemctl restart apache2The .htaccess file handles URL rewriting automatically.
For Nginx servers, use this configuration:
server { listen 80; server_name yourdomain.com; root /var/www/chatnet; index index.php; # Redirect to HTTPS return 301 https://$server_name$request_uri; } server { listen 443 ssl http2; server_name yourdomain.com; root /var/www/chatnet; index index.php; # SSL Configuration ssl_certificate /path/to/certificate.crt; ssl_certificate_key /path/to/private.key; # URL Rewriting location / { try_files $uri $uri/ /index.php?$query_string; } # PHP Processing location ~ \.php$ { fastcgi_pass unix:/var/run/php/php8.2-fpm.sock; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } # Deny access to sensitive files location ~ /\.(ht|git) { deny all; } location ~ /(config|classes|utils)/ { deny all; } # Media files location /media { expires 30d; add_header Cache-Control "public, immutable"; } # Static assets location /static { expires 7d; add_header Cache-Control "public"; } }Ensure the correct directories have write permissions for uploads and configuration.
Set proper permissions for these directories:
# Required writable directories chmod 755 /path/to/chatnet/media chmod 755 /path/to/chatnet/plugins chmod 755 /path/to/chatnet/config # Recursive for media uploads chmod -R 755 /path/to/chatnet/media| Directory | Permission | Purpose |
|---|---|---|
| /media | 755 | User uploads (images, files, audio) |
| /plugins | 755 | Plugin installations |
| /config | 755 | Configuration files |
Essential tasks to complete after installation for a secure and fully functional setup.
After installation, complete these steps:
/install directory for securitySECRET_KEY in config/init.php