Installation

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.

Preparation

Complete these preliminary steps before running the ChatNet installer.

Step 1: Extract the ZIP File

  1. Download the ChatNet package from CodeCanyon
  2. Extract the contents to a folder on your computer
  3. Locate the main source files in the extracted folder

Step 2: Upload Files to Server

Upload all files to your web server using FTP or your hosting control panel. You can place files in:

Step 3: Create a Database

  1. Log in to your hosting control panel (cPanel, Plesk, etc.)
  2. Navigate to MySQL Databases
  3. Create a new database (e.g., chatnet_db)
  4. Create a new database user with a strong password
  5. Add the user to the database with ALL PRIVILEGES
  6. Note down the database name, username, and password

Running the Installer

The installation wizard guides you through database configuration, site settings, and admin account creation.

Accessing the Installer

Open your browser and navigate to:

https://yourdomain.com/install

The installer will guide you through the setup process.

Step 1: Server Requirements Check

The installer verifies that your server meets all requirements:

If any requirements fail, address them before proceeding.

Step 2: Database Configuration

Enter your database credentials:

FieldDescription
Database HostUsually localhost
Database NameThe database you created
Database UserThe database user
Database PasswordThe user's password
Database PortUsually 3306
Table PrefixDefault is cn_

Click Test Connection to verify the settings.

Step 3: Site Settings

Configure your site:

FieldDescription
Site NameYour chat site name
Site URLFull URL (e.g., https://yourdomain.com)
Admin EmailAdministrator email address

Step 4: Admin Account Creation

Create your administrator account:

FieldDescription
UsernameAdmin username
EmailAdmin email address
PasswordStrong password (8+ characters)

Click Install to complete the installation.

Web Server Configuration

Configure your Apache or Nginx web server to properly serve ChatNet with URL rewriting enabled.

Apache (.htaccess)

ChatNet includes a pre-configured .htaccess file. Ensure mod_rewrite is enabled:

sudo a2enmod rewrite sudo systemctl restart apache2

The .htaccess file handles URL rewriting automatically.

Nginx Configuration

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"; } }

File Permissions

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
DirectoryPermissionPurpose
/media755User uploads (images, files, audio)
/plugins755Plugin installations
/config755Configuration files

Post-Installation Checklist

Essential tasks to complete after installation for a secure and fully functional setup.

After installation, complete these steps: