Thank you for purchasing e-School Saas. We appreciate your support. In this documentation, you will find instructions on how to set up the admin panel and mobile application for e-School Saas. This document also provides features of e-School Saas. If you have any questions, feel free to reach out. Thank you for choosing e-School Saas!
Before installing e-School Saas, you need to properly configure your VPS server. Follow these detailed steps to set up your server environment:
First, update your system packages to ensure you have the latest security updates and package versions:
sudo apt update
sudo apt upgrade -y
Install required tools and utilities:
sudo apt install -y curl wget unzip git software-properties-common
sudo add-apt-repository ppa:ondrej/php -y
sudo apt update
sudo apt install -y php8.3 php8.3-cli php8.3-common php8.3-fpm
sudo apt install -y php8.3-mysql php8.3-zip php8.3-gd php8.3-mbstring
sudo apt install -y php8.3-curl php8.3-xml php8.3-bcmath php8.3-intl
sudo apt install -y php8.3-imap php8.3-opcache php8.3-soap php8.3-redis
sudo apt install -y php8.3-fileinfo
sudo apt install -y nginx
sudo systemctl enable nginx
sudo systemctl start nginx
sudo apt install -y mysql-server
sudo systemctl enable mysql
sudo systemctl start mysql
Secure your MySQL installation:
sudo mysql_secure_installation
Create a database user with root privileges (required for multi-tenancy):
sudo mysql -u root -p
At the MySQL prompt, run:
CREATE USER 'eschool_admin'@'localhost' IDENTIFIED BY 'strong_password';
GRANT ALL PRIVILEGES ON *.* TO 'eschool_admin'@'localhost' WITH GRANT OPTION;
FLUSH PRIVILEGES;
EXIT;
Edit the PHP configuration file to optimize it for e-School Saas:
sudo nano /etc/php/8.3/fpm/php.ini
Find and modify these settings:
memory_limit = 256M
upload_max_filesize = 50M
post_max_size = 50M
max_execution_time = 5000
max_input_time = 5000
max_file_uploads = 50
Save the file and restart PHP-FPM:
sudo systemctl restart php8.3-fpm
Create a new Nginx server block configuration:
sudo nano /etc/nginx/sites-available/eschool
Add the following configuration (replace yourdomain.com with your domain):
server {
listen 80;
server_name yourdomain.com *.yourdomain.com;
root /var/www/html/public;
add_header X-Frame-Options "SAMEORIGIN";
add_header X-Content-Type-Options "nosniff";
index index.php index.html;
charset utf-8;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
error_page 404 /index.php;
location ~ \.php$ {
fastcgi_pass unix:/var/run/php/php8.3-fpm.sock;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ /\.(?!well-known).* {
deny all;
}
}
Enable the configuration and restart Nginx:
sudo ln -s /etc/nginx/sites-available/eschool /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl restart nginx
Install Certbot for free SSL certificates:
sudo apt install -y certbot python3-certbot-nginx
sudo certbot --nginx -d yourdomain.com -d *.yourdomain.com
Install Supervisor to manage the WebSocket process:
sudo apt install -y supervisor
Create a configuration file for the WebSocket server:
sudo nano /etc/supervisor/conf.d/websocket.conf
Add the following configuration (replace /your_root_folder_path/ with your actual path):
[program:websocket]
process_name=websocket
command=/usr/bin/php /your_root_folder_path/artisan websocket:init
autostart=true
autorestart=true
user=www-data
redirect_stderr=true
stdout_logfile=/your_root_folder_path/storage/logs/websocket.log
stderr_logfile=/your_root_folder_path/storage/logs/websocket.log
Reload and update Supervisor configuration:
sudo supervisorctl reread
sudo supervisorctl update
sudo supervisorctl status
Install and configure UFW (Uncomplicated Firewall):
sudo apt install -y ufw
sudo ufw allow 22/tcp
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw allow 8090/tcp # For WebSocket Server
sudo ufw enable
Create the web directory and set proper permissions:
sudo mkdir -p /var/www/html
sudo chown -R www-data:www-data /var/www/html
sudo chmod -R 755 /var/www/html
aaPanel is a lightweight and powerful server management tool that makes it easier to configure and manage your server for e-School Saas.
First, login to your server terminal using SSH:
ssh root@your-server-ip
Once logged in, run the following command to download and install aaPanel:
URL=https://www.aapanel.com/script/install_7.0_en.sh && if [ -f /usr/bin/curl ];then curl -ksSO "$URL" ;else wget --no-check-certificate -O install_7.0_en.sh "$URL";fi;bash install_7.0_en.sh aapanel
After installation completes, you'll receive the aaPanel credentials including URL, username, and password. Save these details for login.
Log in to aaPanel using the provided URL and credentials, then install:
In aaPanel, navigate to PHP Settings and install these extensions:
Then go to PHP Configuration and set these values:
Go to PHP Disabled Functions and remove "symlink" from the list.
Restart PHP services after making these changes.
Go to the Websites section and click on Add Site:
After adding the main domain, go to the domain configuration and add a wildcard domain with the format: *.your_domain_name
Add DNS A records for your domain:
Add SSL certificates for both your main domain and wildcard domain using Let's Encrypt DNS verification.
Upload your source code to the domain directory and ensure the web path points to the public directory.
To get MySQL root credentials, run this command in the terminal:
sudo cat /root/.my.cnf
Install Supervisor:
sudo apt update
sudo apt install supervisor
Create a configuration file for the WebSocket server:
sudo nano /etc/supervisor/conf.d/websocket.conf
Add the following content (replace /your_root_folder_path/ with your actual path):
[program:websocket]
process_name=websocket
command=/usr/bin/php /your_root_folder_path/artisan websocket:init
autostart=true
autorestart=true
user=www-data
redirect_stderr=true
stdout_logfile=/your_root_folder_path/storage/logs/websocket.log
stderr_logfile=/your_root_folder_path/storage/logs/websocket.log
Update Supervisor:
sudo supervisorctl reread
sudo supervisorctl update
sudo supervisorctl status
Enable port 8090 in your firewall for WebSocket communication. Your WebSocket URL will be:
ws://your_server_ip:8090
Now your server is ready for the e-School Saas installation. Proceed to the next section to install the application.
flutter pub get
cd ios
pod install
cd ..
flutter pub run change_app_package_name:main your_new_package_name
flutter run
Open the Terminal from an SSH Connection.
sudo apt-get update
sudo apt-get install supervisor
sudo nano /etc/supervisor/conf.d/your-laravel-websockets.conf
[program:laravel-websockets]
process_name=%(program_name)s_%(process_num)02d
command=php /path/to/your/laravel/artisan websocket:init
autostart=true
autorestart=true
user=username
numprocs=1
redirect_stderr=true
stdout_logfile=/path/to/your/laravel/storage/logs/laravel-websockets.log
sudo supervisorctl reread
sudo supervisorctl update
sudo supervisorctl start laravel-websockets
sudo supervisorctl status
laravel-websockets RUNNING pid 12345, uptime 0:03:21
When creating a school, the admin has the option to specify the domain type for the school's website and also school can choose the domain type from General Settings Sections. They can choose between two domain types:
Default Domain: This is a predefined domain provided by the system (e.g., schoolname.yoursystemdomain.com). It is automatically set up and requires no additional configuration from the admin.