Never copy and paste commands that you do not understand or that were given to you by unknown people. This can be dangerous for your system, your security and your privacy. You can accidentally delete important files, get infected by a virus, give access to your data or do other unwanted actions. Always check and learn the commands before running them and use reliable sources of information.
- Debian (or similar OS)
- Login as
root
- Turn on unattended-upgrades
- PHP 8.3
- Caddy 2.7.6
One-liner:
apt purge apache* && \
apt purge php* && \
apt update && apt-get upgrade -y && apt-get dist-upgrade -y && apt-get autoremove -f -y && apt-get autoclean -y && \
apt install net-tools curl sudo wget git sqlite3 unzip -y && \
sudo apt -y install lsb-release apt-transport-https ca-certificates && \
sudo wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg && \
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/php.list &&
apt update && \
export PHP_VERSION=8.3 && \
apt install php${PHP_VERSION} php${PHP_VERSION}-fpm php${PHP_VERSION}-opcache php${PHP_VERSION}-zip php${PHP_VERSION}-sqlite3 php${PHP_VERSION}-gmp php${PHP_VERSION}-xml php${PHP_VERSION}-mbstring php${PHP_VERSION}-gd php${PHP_VERSION}-curl php-pear -y \
&& \
\
echo "unattended-upgrades unattended-upgrades/enable_auto_updates boolean true" | debconf-set-selections && \
apt install unattended-upgrades -y \
&& \
\
export CADDY_VERSION=2.8.4 && \
wget https://github.com/caddyserver/caddy/releases/download/v${CADDY_VERSION}/caddy_${CADDY_VERSION}_linux_amd64.deb && \
dpkg -i caddy_${CADDY_VERSION}_linux_amd64.deb && \
unlink caddy_${CADDY_VERSION}_linux_amd64.deb && \
caddy version; \
php -v
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php composer-setup.php --install-dir=/usr/local/bin --filename=composer
php -r "unlink('composer-setup.php');"
nano /etc/caddy/Caddyfile
http://:80 {
root * /www/w8io
php_fastcgi unix//run/php/php8.3-fpm.sock
route {
file_server /static/*
rewrite * /index.php
}
}
nano /etc/php/8.3/fpm/pool.d/www.conf
- search for "owner" with
Ctrl + W
and replace with "caddy:caddy" - (optionally) add more
pm.max_children
for examplepm.max_children = 16
(i use for w8.io)
service php8.3-fpm restart && service caddy restart
mkdir /www && \
chown -R www-data:www-data /www
chsh -s /bin/bash www-data
su - www-data
cd /www && \
git clone https://github.com/deemru/w8io.git && \
cd /www/w8io && \
composer update -o --no-cache
cp config.sample.php config.php
nano config.php
- change
W8IO_NETWORK
(default:W
) - change
W8IO_NODES
(default:http://127.0.0.1:6869
andhttps://nodes.wavesexplorer.com
) - change
W8IO_MAX_UPDATE_BATCH
to 10..50 if your node is local (default:1
)
- You should run
php w8_updater.php
command a few times - Or you can run
bash updater.sh
to do it for you - You should reach
updater
status forw8_updater
to be able to browse your data - Beware it can take A LOT of time to fully index your blockchain (mainnet 3-5 days with local node)
logout
nano /etc/crontab
@reboot www-data nohup bash /www/w8io/updater.sh > /www/w8io/var/db/updater.sh.log &
@reboot www-data nohup bash /www/w8io/updater_headers.sh > /www/w8io/var/db/updater_headers.sh.log &
If you feel you messed up with permissions you can always do as root
:
chown -R www-data:www-data /www