HOMELESS — AWARDSPACE VPS DEPLOYMENT =================================== Recommended target path ----------------------- /var/www/homeless 1. Install runtime packages --------------------------- Debian / Ubuntu example: sudo apt update sudo apt install nginx php-fpm php-mysql php-curl php-mbstring php-xml php-gd mariadb-server unzip 2. Upload and configure the project ----------------------------------- sudo mkdir -p /var/www/homeless sudo unzip Homeless_vps_clean.zip -d /var/www cd /var/www/homeless sudo cp config/local_settings.php.example config/local_settings.php sudo nano config/local_settings.php Use NEW passwords. The old shared-hosting archive contained credentials and must not be reused as a secret source. 3. Create the local MariaDB database ------------------------------------ Example commands: sudo mariadb Then run SQL similar to: CREATE DATABASE homeless CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; CREATE USER 'homeless'@'127.0.0.1' IDENTIFIED BY 'USE_A_NEW_LONG_PASSWORD'; GRANT ALL PRIVILEGES ON homeless.* TO 'homeless'@'127.0.0.1'; FLUSH PRIVILEGES; EXIT; Import the schema and applicable migrations: mariadb -h 127.0.0.1 -u homeless -p homeless < sql/schema_no_db.sql mariadb -h 127.0.0.1 -u homeless -p homeless < sql/future_hierarchy_upgrade.sql mariadb -h 127.0.0.1 -u homeless -p homeless < sql/05_national_admin_map_fields.sql mariadb -h 127.0.0.1 -u homeless -p homeless < sql/06_location_token_scope.sql Before importing into a database that already contains data, take a database dump and review each migration first. 4. Preserve or restore database data ------------------------------------ The website ZIP contains application files and incident uploads. It does not contain a full MariaDB data dump. Export the existing database separately and import it into the VPS database when a data migration is required. 5. Configure the web server --------------------------- Use one of the examples under deploy/. The DocumentRoot / root directory must be: /var/www/homeless/public For Nginx, verify the installed PHP-FPM socket before enabling the site: ls /run/php/ Then adjust fastcgi_pass in the Nginx example when the version differs. 6. Permissions -------------- For a typical Nginx/PHP-FPM setup: sudo chown -R root:root /var/www/homeless sudo chown -R www-data:www-data /var/www/homeless/uploads/incidents sudo find /var/www/homeless -type d -exec chmod 755 {} \; sudo find /var/www/homeless -type f -exec chmod 644 {} \; sudo chmod 640 /var/www/homeless/config/local_settings.php sudo chmod 775 /var/www/homeless/uploads/incidents 7. Validate before DNS cutover ------------------------------ php -l config/config.php find includes public -name '*.php' -print0 | xargs -0 -n1 php -l curl -I http://127.0.0.1/ Confirm login, dashboards, map loading, incident image access, and database writes with a non-demo account. Public demo sessions should remain read-only. 8. Firewall ----------- Expose only SSH, HTTP, and HTTPS publicly. Keep MariaDB bound to localhost unless a separately justified private connection is required. Do not open TCP 3306 to the internet.