Rebuilding Ubuntu

Building Ubuntu 18.04 on a brand new machine

the raw steps (in what follows, newport is the new machine, burnley is an old machine with all necessary files).

add newport,et al., to /etc/hosts
# rsync -auv burnley:.bash_profile ./
# rsync -auv burnley:.bashrc ./
$ rsync -auv burnley:bin ./
# apt-get install ssh
$ ./bin/ ajh@burnley
$ ./bin/ ajh@spencer
# apt-get install emacs
# apt-get install apache2
# a2enmod actions cgid userdir
in the file /etc/apache2/mods-enabled/userdir.conf,
    change the Directory entry for /home/*/public_html
    to "AllowOverride All"
# apt-get install xsltproc
add newport to .bash_profile cases and run
$ . .bash_profile
in the file /etc/apache2/mods-enabled/dir.conf,
    change the DirectoryIndex entry to include index.xml
# systemctl restart apache2
# apt-get install python2.7
# apt-get install python3
$ mkdir /home/ajh/binln
$ cd /home/ajh/binln
$ ln -s /usr/bin/python2.7 python
$ ln -s /usr/bin/python2.7 python2.7
$ ln -s /usr/bin/python3 python3
$ ln -s /home/ajh/public_html www
$ mkdir -p local/localhost/counters
$ mkdir -p local/localhost/htmls
$ chmod -R g+w local/localhost
# chown -R ajh:www-data local/localhost
$ rsync -auv burnley:lib ./
$ rsync -auv burnley:local/localhost/environment ./local/localhost/
edit the environment file to update the hostname to newport
$ rsync -auv burnley:public_html/* public_html/
$ rsync -auv burnley:public_html/.htaccess public_html/
# apt-get install net-tools # this is to grab ifconfig,
                            # an interim measure until replaced by ip
# apt-get install make
# apt-get install psgml
# apt-get install wallch # this is a dodgy application, and doesn't always work
# apt install variety # a more reliable wallpaper application
# apt install python-pip # install pip
# pip --version # check its version (20181227:145306 pip 9.0.1)
# python -m pip install pyserial # install python module serial

I shall endeavour to add to this list as I discover missing software.


The DNS settings I use are, or IP addresses,


We recently acquired a Silverstone RM420 20-bay disk farm to house all our house needs for data storage. This was a story in its own right, but here we document the process of rebuilding Ubuntu to suit the local needs.

In what follows, we use a prompt of # to indicate that the actions must be done as superuser, and $ for actions as the (normal) user.



Depending how you got to this stage, the hostname might need fixing. To do this, simply edit (as superuser) the file /etc/hostname to the correct value.

          # vi /etc/hostname


load basic files from backup. These should include:



install sshd


Install my preferred editor Emacs

          # apt-get install emacs


Install the web server Apache

          # apt-get install apache

Enable the actions, cgid and userdir modifications.

          # a2enmod actions cgid userdir

In the file userdir.conf, change the <Directory /home/*/public_html> line containing AllowOverride to be just AllowOverride All

You also need to add index.xml into the DirectoryIndex list in the dir.conf file.

install the XSLTPROC package

# apt-get install xsltproc

Assuming all the relevant files have been copied across from backup, you should now be able to access the web server from a browser. Don't forget to make sure that the cgi script is available and executable! (It needs python2.7.)


  1. Apache2 does not enable user directories automatically. To do this, you need to install the userdir mod (above).
  2. Because I also run a cgi script driven by special instructions in the .htaccess file to perform the XML to HTML translation, I also must install the actions and cgid modifications. The latter, in particular, gives very cryptic error messages - simply saying that it cannot find the requested file.
This page is copyright, and maintained by John Hurst. 347 accesses all since
04 Feb 2022
My PhotoMy PhotoTrain Photo

Local servers: Localhost Newport Burnley Jeparit Reuilly Spencer (accessible only on local network.)
Public Web Servers: (not all may be active.)
Dynamically generated at 20230926:211954 from an XML file modified on 20190224:0505, by version 1.4.8. (UTC)