Table of Contents

2024 Radio Topics

YaDDNet : New VPS

Moving YaDDNet from USA to UK

Background

New VPS

curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py
sudo python2 get-pip.py
sudo apt-get install python-dev
sudo wget https://raw.githubusercontent.com/paulfitz/mysql-connector-c/master/include/my_config.h -O /usr/include/mysql/my_config.h
sudo pip2 install MySQL-python

MySQL config

$ sudo systemctl stop mysql
$ sudo systemctl status mysql
$ sudo systemctl edit mysql
[Service]
ExecStart=
ExecStart=/usr/sbin/mysqld --skip-grant-tables --skip-networking
$ sudo systemctl daemon-reload
$ sudo systemctl start mysql
$ sudo mysql -u root
mysql> FLUSH PRIVILEGES;
mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '';
mysql> exit
$ sudo systemctl revert mysql
$ sudo systemctl daemon-reload
$ sudo systemctl restart mysql

Make database for yadd

$mysql -u root
mysql> create database yadd;
mysql> quit;

Get the data

$ mysqldump -u root yadd > yadd_backup.sql
mysql -u root yadd < yaddnet_backup.sql

Web pages

sudo apt-get install php-mysql
CREATE USER 'XXXXX'@'localhost' IDENTIFIED WITH mysql_native_password BY 'YYYYY';
GRANT ALL PRIVILEGES ON *.* TO 'XXXXX'@'localhost' WITH GRANT OPTION;
# MySQL systemd service file

[Unit]
Description=MySQL Community Server
After=network.target

[Install]
WantedBy=multi-user.target

[Service]
Type=notify
User=mysql
Group=mysql
PIDFile=/run/mysqld/mysqld.pid
PermissionsStartOnly=true
ExecStartPre=/usr/share/mysql/mysql-systemd-start pre
ExecStart=/usr/sbin/mysqld  --sql-mode=STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION
TimeoutSec=infinity
Restart=on-failure
RuntimeDirectory=mysqld
RuntimeDirectoryMode=755
LimitNOFILE=10000

# Set enviroment variable MYSQLD_PARENT_PID. This is required for restart.
Environment=MYSQLD_PARENT_PID=1
~
~

Then

systemctl daemon-reload
systemctl restart mysql
./new_tmux.sh

Clean up

@reboot sleep 60; sudo -u gm4slv /home/gm4slv/yaddnet/tmux_yadd.sh >/dev/null 2>&1
 
 
15 */4 * * * /home/gm4slv/yaddnet/purge_err.sh > /dev/null
* * * * * /home/gm4slv/yaddnet/purge_tmp.sh > /dev/null

hg init
hg add
hg com -m "first commit, new server"

Extra

<Directory /path/to/website/database_tweaks/config>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
</Directory>
AuthType Basic
AuthName "Password Protected Area"
AuthUserFile  /path/to/website/database_tweaks/config/.htpasswd
Require valid-user
<Directory /var/www/>
        Options  FollowSymLinks
        AllowOverride None
        Require all granted
</Directory>
<Directory /var/www/html/pages/php/test/>
        Options Indexes FollowSymLinks
        AllowOverride None
        Require all granted
</Directory>

John Pumford-Green 14/04/24 18:11 BST

Further Information