Simple webserver

The SimpleHTTPServer module can be used in the following manner in order to set up a very basic web server serving files relative to the current directory.

import SimpleHTTPServer
import SocketServer

PORT = 8000

Handler = SimpleHTTPServer.SimpleHTTPRequestHandler

httpd = SocketServer.TCPServer(("", PORT), Handler)

print "serving at port", PORT
httpd.serve_forever()

The SimpleHTTPServer module can also be invoked directly using the -m switch of the interpreter with a port number argument. Similar to the previous example, this serves the files relative to the current directory.

python -m SimpleHTTPServer 8000

Webtrees Ubuntu Server

Install MySQL

sudo apt install mysql-server
sudo mysql
create user 'webtrees'@'localhost' identified by 'webtrees12345';
create database WEBTREES character set UTF8;
grant all privileges on WEBTREES.* to 'webtrees'@'localhost';
exit

Test DB – login with user webtrees

mysql -u webtrees --password=webtrees12345

Install Apache

sudo apt install apache2
sudo apt install php7.2 libapache2-mod-php7.2 php-mysql
sudo apt install php-curl php-json php-cgi
sudo apt-get install php7.2-gd
sudo apt-get install php-xml
sudo /etc/init.d/apache2 restart

Import DB

mysql -u webtrees -p WEBTREES < webtrees-backup.sql

Add USERNAME to EDIT FOLDER

sudo chown -R USERNAME /var/www/html
sudo chmod 777 /var/www/html/webtrees/data/

Copy webtrees files to server

Update permissions on data folder

sudo chmod 777 /var/www/html/webtrees/data/
sudo chown -R USERNAME /var/www/html/webtrees/data/media/

Edit PHP.ini

sudo nano /etc/php/7.2/apache2/php.ini

Update max wait and file size

post_max_size = 30M
upload_max_filesize = 30M
memory_limit = 128M
max_execution_time = 30

Ubuntu Kill Window

Ctrl+Alt+Esc

This gives a skull cursor. Position it on the application window and click. Program is killed.