{"id":51433394,"url":"https://github.com/vb2007/vb2007.hu-php","last_synced_at":"2026-07-05T05:07:33.987Z","repository":{"id":195248069,"uuid":"684165001","full_name":"vb2007/vb2007.hu-php","owner":"vb2007","description":"Basic site with basic semi-dynamic features and stuffs. Don't take this repo seriously, it's basically my playground. But it grew to a pretty useable site over time tho...","archived":false,"fork":false,"pushed_at":"2024-09-15T21:22:48.000Z","size":75174,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-09-15T23:34:15.935Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://vb2007.hu","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vb2007.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-08-28T15:31:34.000Z","updated_at":"2024-09-15T21:22:51.000Z","dependencies_parsed_at":"2024-09-15T23:34:23.570Z","dependency_job_id":"dbed53c3-2f5c-4da5-93d1-e62dd5aceb44","html_url":"https://github.com/vb2007/vb2007.hu-php","commit_stats":null,"previous_names":["vb2007/nginx-host","vb2007/vb2007.hu-php"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/vb2007/vb2007.hu-php","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vb2007%2Fvb2007.hu-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vb2007%2Fvb2007.hu-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vb2007%2Fvb2007.hu-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vb2007%2Fvb2007.hu-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vb2007","download_url":"https://codeload.github.com/vb2007/vb2007.hu-php/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vb2007%2Fvb2007.hu-php/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35144060,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-05T02:00:06.290Z","response_time":100,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-07-05T05:07:33.179Z","updated_at":"2026-07-05T05:07:33.961Z","avatar_url":"https://github.com/vb2007.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [vb2007.hu](https://vb2007.hu)'s source code\r\n\r\n## General info\r\n\r\nThe site is hosted with nginx, php8.2-fpm and mariadb.\r\nVisitors are under the www-data:www-data user group \u0026 name.\r\n\r\n## Setting up\r\n\r\nThe site is currently running on a Debian Linux server.\r\n\r\n### Installing packages\r\n\r\nInstall the required packages with (php version can change over time. Ffmpeg is optional, because the compressing page currently isn't functional (my current server couldn't even handle compression lol)):\r\n\r\n```shell\r\nsudo apt install nginx php php-fpm php8.2-mysqli mariadb\r\n```\r\n\r\n### Modifying the config files\r\n\r\nCopy the necessary config files from [here](https://github.com/vb2007/raspberry-configurations). The repo is currently private.\r\nBut I've only changed the max upload \u0026 post request size and enabled the mysql extension in the php.ini file. But I can't publicate the nginx.conf file for obvious reasons.\r\n\r\n- **php.ini** is (usually) located at: ```/etc/php/fpm/8.2/php.ini```\r\n- **nginx.conf** is located at: ```/etc/nginx/nginx.conf```\r\n\r\n### Setting relevant permissions\r\n\r\nThe cdn's folder should get cloned automatically from the repo.\r\nIf not:\r\n\r\n```shell\r\nln -s /media/vb2007/2TB-HDD/extended-cdn /var/www/html/extended-cdn\r\n```\r\n\r\nif ***session_start()*** fails with permission issues:\r\n\r\n```shell\r\nsudo chmod -R 777 /var/www\r\nsudo chmod -R 777 /var/lib/php/\r\nsudo chown www-data:www-data -R /var/lib/php/\r\n```\r\n\r\nIf users cannot upload:\r\n\r\n```shell\r\nsudo chown www-data:www-data -R /media/vb2007/2TB-HDD/extended-cdn/uploads\r\n```\r\n\r\n#### !OTDATED! Modifying permissions for the sqlite3 databse\r\n\r\nThis section is not useful anymore. Back in the day, the site used sqlite3 for storing data. These commands gave php-fpm's user \u0026 group read \u0026 write access for the database.\r\n\r\n```shell\r\nsudo chown www-data:www-data /var/www/html/data\r\nsudo chown www-data:www-data /var/www/html/data/data.db\r\nsudo chmod 755 /var/www/html/data/data.db\r\n```\r\n\r\n## Configuring\r\n\r\nThere are a few config files, but only ```html/page/_script/_config.php``` is necessary for proper functionality. Then the **$mysqli** value should be used in queries (after importing the script).\r\nIt should look like this:\r\n\r\n```php\r\n\u003c?php\r\n//Configuration values\r\n$databaseHost = '\u003cHost IP (and port, if it isnt 3306 for MariaDB)\u003e';\r\n$databaseUsername = '\u003cusername\u003e';\r\n$databasePassword = '\u003crelevant password for that username\u003e';\r\n$databaseName = '\u003cdatabase name (\"nginxdata\" for me)\u003e';\r\n\r\n//Connects to the database\r\n$mysqli = mysqli_connect($databaseHost, $databaseUsername, $databasePassword, $databaseName); \r\n\r\n//\"Handle\" errors\r\nif($mysqli-\u003econnect_errno != 0) {\r\n    echo \"An error happened while trying to connect to the database: \" . $mysqli-\u003econnect_error;\r\n    exit();\r\n}\r\n?\u003e\r\n```\r\n\r\nThe ```html/robots.txt``` can be edited if necessary, but I don't use it.\r\n\r\nThe ```html/sitemap.xml``` is only for search engine's indexing bots.\r\n\r\n## Setting up MariaDB\r\n\r\n### Set up the database, tables, and privileges\r\n\r\nRun the installation script with:\r\n\r\n```shell\r\nsudo mysql_secure_installation\r\n```\r\n\r\nUse the following command to open MariaDB as root:\r\n\r\n```shell\r\nsudo mysql -u root -p\r\n```\r\n\r\nCreate the **nginxdata** database with:\r\n\r\n```sql\r\nCREATE DATABASE nginxdata;\r\n```\r\n\r\nThen make a new user with the following command:\r\n\r\n```sql\r\nCREATE USER '\u003cusername\u003e'@'localhost' IDENTIFIED BY '\u003cpassword\u003e';\r\n```\r\n\r\nThen grant access to the user on the **nginxdata** databse (includes remote hosts, more about that later):\r\n\r\n```sql\r\nGRANT ALL ON nginxdata.* to '\u003cusername\u003e'@'%' IDENTIFIED BY '\u003cpassword\u003e' WITH GRANT OPTION;\r\n```\r\n\r\nFlush privileges:\r\n\r\n```sql\r\nFLUSH PRIVILEGES;\r\n```\r\n\r\nThen exit with:\r\n\r\n```sql\r\nquit;\r\n```\r\n\r\n### Set up remote access\r\n\r\nOpen the following config file:\r\n\r\n```shell\r\nsudo nano /etc/mysql/mariadb.conf.d/50-server.cnf\r\n```\r\n\r\nThen enable remote access with modifying the ```bind-address = 127.0.0.1``` value to ```bind-address = 0.0.0.0```.\r\n\r\n---\r\n\r\n### Importing data\r\n\r\nImport data with:\r\n\r\n```shell\r\nmysql -u root -p nginxdata \u003c sql_dump.sql\r\n```\r\n\r\n*If you have nothing to import, the scripts will create the tables automatically on the first user data insert/call.*\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvb2007%2Fvb2007.hu-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvb2007%2Fvb2007.hu-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvb2007%2Fvb2007.hu-php/lists"}