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/mkremlog.sh ajh@burnley
$ ./bin/mkremlog.sh 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)
    

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

DNS

The DNS settings I use are internode.on.net, or IP addresses 192.231.203.132, 192.231.203.3

Background

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.

Tasks

Hostname

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
        

Files

load basic files from backup. These should include:

          ~/.bash_profile
          ~/.bashrc
          ~/bin/*
          ~/lib/emacs
          ~/.emacs
        

SSH

install sshd

Emacs

Install my preferred editor Emacs

          # apt-get install emacs
        

Apache

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 same 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.

Gotchas

  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. 111 accesses since
30 Dec 2017
My PhotoMy PhotoTrain Photo

Local servers: Localhost Newport Burnley Hamilton Echuca Heywood Richmond Spencer (Note that these are only accessible on my local network.)
Public Web Servers: Hurst Server/ajhurst.org Home Server/ajh.co CSSE Server Internode Server (In order of preference; not all of these may be active.)
Dynamically generated at 20181201:2341 from an XML file modified on 20180919:0207.

114 accesses since 30 Dec 2017, HTML cache rendered at 20181210:1038