Requires php >= 8.1
Install prerequisites
sudo apt install apache2 php libapache2-mod-php php-sqlite3 php-gmp php-curl php-xml php-zip php-mbstring wget curl
*** Steps ***
Activate rewrite mod. Important! - security sudo a2enmod rewrite
Download and unzip bundle into proper location. In this example /var/www/serveronet will be used.
wget -O serveronet_server_bundle.zip https://sncentral.localhost/serveronet_server_bundle.zip
sudo unzip serveronet_server_bundle.zip -d /var/www/serveronet
Correct permissions
cd /var/www/serveronet
sudo chown -R www-data:www-data ./
sudo chmod 755 -R ./
Edit configuration file /etc/apache2/sites-available/000-default.conf
sudo nano /etc/apache2/sites-available/000-default.conf
Option 1: Deploy to a subdirectory i.e. http://localhost/serveronet
paste values as below at the end of the file:
DocumentRoot /var/www/serveronet/public
Alias /serveronet /var/www/serveronet/public
<Directory /var/www/serveronet/public>
AllowOverride All
Require all granted
</Directory>
or
Option 2: Deploy as an app on main address http://localhost/
replace line with DocumentRoot with
DocumentRoot /var/www/serveronet/public
<Directory /var/www/serveronet/public>
AllowOverride All
Require all granted
</Directory>
sudo systemctl restart apache2
= As Tor hidden service Follow manual instalation steps and apply these adjustments
Get onion address from
In /etc/tor/torrc adjust to additional port HiddenServicePort 80 127.0.0.1:80
Add VirtualHost to enabled site <VirtualHost *:8080> DocumentRoot /var/www/torwww/public <Directory /var/www/torwww/public> AllowOverride All Require all granted </Directory> </VirtualHost>
Restart Tor and Apache sudo systemctl restart apache2 sudo systemctl restart tor
Reference:
https://community.torproject.org/onion-services/setup/
= Termux deployment - not possible - php mod not available Steps tbd https://getcomposer.org/download/ https://www.freecodecamp.org/news/how-to-setup-laravel-8-on-android-phone/ Termux requires uncomment module and allowoverride
= Termux Test client deployment - Only for testing - artisan server deployment This is for testing and development only. Such Server is single threaded and will block on any long task. https://getcomposer.org/download/ https://www.freecodecamp.org/news/how-to-setup-laravel-8-on-android-phone/ Termux requires uncomment module and allowoverride php artisan serve --no-reload
= Publish new version //Update procedure //Bump version in H //upload_version.sh //On clients route update_client
disable mod_perl
enable socks extension in php ini - TODO review
Install Visual C++ Redistributable https://aka.ms/vs/17/release/vc_redist.x64.exe
Download Xampp Portable 8.2.4 for Windows from https://www.apachefriends.org/ (xampp-portable-windows-x64-8.2.4-0-VS16.zip)
Unzip to xampp folder
Run setup_xampp.bat
Place Serveronet_Start.bat in the root of unziped directory, where htdocs was unzipped. From https://github.com/Serveronet/utils
Download server bundle from sncentral.localhost -- TODO Settle
Unzip to htdocs directory
Add SN client version file sn-client-version.json into htdocs directory with content: { "version": "8.2.4", "platform": "linux" }
Go to apache/conf and edit httpd.conf
Edit httpd-ssl.conf
Edit "httpd-xampp.conf" in conf/extra/
Delete httpd-xampp.conf - TODO Verify
Edit "/httpd-ssl.conf" in conf/extra
Go to php subfolder and edit php.ini file -
TODO find and hide Deprecation errors in config
Clean up - delete subdirectories
Download frankenphp-linux-x86_64 from - Frankenphp Releases
Download caddy file and save as Caddyfile from -> Sn Clients github
Download Start_Serveronet.sh, Stop_Serveronet.sh [Sn Clients github](https://github.com/Serveronet/Serveronet-Clients
Download tor-browser_en-US Tor Browser
Download SN Server bundle Sn Server Bundle
sudo wget -qO /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
sudo echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/php.list
sudo apt update
sudo apt install php8.2 php8.2-common php8.2-cli php8.2-sqlite3 php8.2-gmp php8.2-curl php8.2-xml php8.2-dom php8.2-zip php8.2-mbstring php8.2-mysql
sudo a2dismod php7.4
sudo a2enmod php8.2
sudo apachectl restart
Ref https://lindevs.com/install-php-on-raspberry-pi
Follow these steps:
https://docs.ipfs.tech/install/command-line/#install-official-binary-distributions
then
https://github.com/ipfs/kubo#install
ipfs init
ipfs daemon
PS C:\Users\username> cd C:\Users\username\Desktop\xampp PS C:\Users\username\Desktop\xampp> php/php.exe composer.phar -d .\htdocs\serveronet\ update
cd C:\Users\username\Desktop\xampp php/php.exe composer.phar -d .\htdocs\serveronet\ update .\php\php.exe C:\Users\username\Desktop\xampp\htdocs\serveronet\artisan config:clear
Tor port: Defaults: 9050 (PC and Orbot), for Tor Desktop Browser: 9150
https://docs.docker.com/engine/install/raspberry-pi-os/ https://laravel.com/docs/10.x/sail#introduction
TODO Move to proper place
Add TXT record with snetdnslink as host (snetdnslink.example.com) with value snetdnslink with site ID, for example: snetdnslink=gjdg45... Serveronet client will check snetdnslink.example.com for Site ID of example.com Reference for Namecheap: https://www.namecheap.com/support/knowledgebase/article.aspx/9776/2237/how-to-create-a-subdomain-for-my-domain/#ip
You can check if configuration is correct with dig (Linux) dig snetdnslink.example.com -t TXT ;; ANSWER SECTION: snetdnslink.example.com. 3600 IN TXT "snetdnslink=gjdg45..."
This here is some very important content that we want to draw your attention to before you light dismiss it. Read it all, do not delay!