Updating the Midgard Database

Now you will need to enter the Midgard Virtual Host into the Midgard MySQL database. Refer to the Overview which will tell you why you need to do this.

The steps we took are outlined below which are straight out of the Midgard installation docs. We have found Webmin (available from http://www.webmin.com/webmin) to be a very capable admin utility for UNIX systems, not to mention the fact that it's graphical and web based. It includes a module for administering MySQL servers.

If you have not messed about with the host table of the database, you will find several different default hosts indicated there. The first host with id=1 is the old Midgard Admin Site. The second host with id=2 is the old Example Site. The third host with id=3 is the new Asgard Site. The corresponding 'name' fields in this host table hold some example domain names. Do a 'select * from host' in the MySQL client to check the host table structure, fields and entries. If you are using another utility like phpMyAdmin or Webmin, then you can simply browse through the host table in the Midgard database.

The objective now is to replace those host names with the ones you have created in the midgard-data.conf previously. These are for the Admin, Example and Asgard Sites. Do not put your non-Midgard sites within this host table.


	
# /usr/local/mysql/bin/mysql -u <midgard> -p <midgard> <midgard>
mysql> update host set name="www.mydomain.com",online=1,port=8101 where id=1;
	
	

Here we have changed the host name in the host table to our host name, per entries in midgard-data.conf VirtualHostname. We have also set it to run on Port 8101 which is where we chose to run the old Midgard Admin Site.


	
mysql> update host set name="www.mydomain.com",online=1,port=8099 where id=2;
	
	

Here we designate the old Example Site to run on Port 8099, consistent with the entry in midgard-data.conf VirtualHostname.


	
mysql> update host set name="www.mydomain.com",online=1,port=8102 where prefix in ('/asgard', '/asgard/framed', '/asgard/framed/top', '/asgard/framed/main');
	
	

Here we designate the new Asgard Site to run on Port 8102, consistent with the entry in midgard-data.conf VirtualHostname.


	
mysql> \q
	
	

Returns you to the shell prompt.