Production Setup
1. What You Need
-
Python 3.8 or newer
-
PHP 8.1 or newer (for client applications)
-
OpenSSL (for security)
-
Basic system packages (the install script will handle most dependencies)
-
Root/sudo access for service installation
-
A version of PCR-360 compatible with Lighthouse
-
A license for Lighthouse
2. Installation Steps
-
Get the code and navigate to project folder
# Clone or download the project
cd /path/to/python360
-
Generate the service configuration file Create the systemd service file with your SSL certificates:
# Option 1: Use specific security certificates
./generate_service.sh --cert /path/to/cert.crt --key /path/to/key.key
# Option 2: Let the script help you find existing certificates
./generate_service.sh
# The script will search for certificates and show you options
# Then run with the chosen paths:
./generate_service.sh --cert /path/to/cert.crt --key /path/to/key.key
# Option 3: Set custom number of workers (optional)
./generate_service.sh --cert /path/to/cert.crt --key /path/to/key.key --workers 4
-
Install the service Run the installation script (this does everything automatically):
sudo ./install_service.sh
What the install script does automatically:
-
Installs Python 3.8, venv, and pip if not present
-
Creates the installation directory at
/opt/python360/ -
Copies all source files to the installation directory
-
Creates a fresh virtual environment at
/opt/python360/venv/ -
Installs all Python dependencies from
pyproject.tomlinto the virtual environment -
Downloads required AI models (sentiment analysis)
-
Sets up all necessary directories (input, output, cache, etc.)
-
Configures proper permissions for the
www-datauser -
Installs and enables the systemd service
-
Starts the service automatically
-
Verify the installation Check if the service is running properly:
# Check service status
sudo systemctl status python360
# View real-time logs
sudo journalctl -u python360 -f
# Check if the service is listening on the correct port
sudo netstat -tlnp | grep :8000