After a crash, Foxpro complained that a dbf was not a database file. Turns out this was due to an incorrect record count in the .dbf header. Bytes 04-07 in the header contain the record count and it seems that if this does not match the expected file size Foxpro complains. Calculate the correct record count and use a hex editor to alter the header.
Bytes 08-09 in the header are a pointer to the first record (Header size)
Bytes 10-11 contain the size of one record.
The record count can be calculated from this, although I was able to use LibreOffice base to open the .dbf. This does not complain if the file size does not match the record count.
My way of using vHhosts on pfSense involves Squid reverse proxy, DNS and vHosts.
Make sure you’ve got the Squid3 and vHosts packages installed.
First, the pfSense web gui should be on a port other than 80 or 443. This should be done as a matter of course anyway (use https on port 8443 maybe).
We need to play around with the Squid Reverse Proxy settings.
Make sure Enable HTTP Reverse Proxy is ticked, and the Reverse HTTP Port is set to 80. Do the same for HTTPS on port 443 if you need to.
Now move over to the Web Servers tab, and add a new web server (A Peer). We are going to add a reference to the pfSense box – where the vHosts server is running. We are telling squid that there is a peer server names pfSense running on localhost (127.0.0.1) and listening at port 10081.
Choose the Mappings tab and add a new mapping. We are telling squid, that when it receives a request for a particular URI, to forward that request on to another server. Choose whatever you want for the Group Name and Group Description. From the Peers list, chose the peer server we defined above. In the lower URI’s section, enter the address of the web pages you want to host (eg. test.yourdomain.com), this will correspond with each vHost we define later.
So now we create a vHost for each site we will be hosting. Add a new vHosts with the Host name being a URI we entered earlier. The IP Address will be 127.0.0.1. Port will be 10081 as we defined earlier in the Squid Peers section. Set Enabled to true and enter a description if you want.
Whichever DNS system you are using, you will need to add an entry for the URI’s for each vHost to hit your pfSense host box.
To make sure everything is updated, restart your Squid and vHost services. Point your browser to on of the sites you’ve defined and things should work…. they did for me.
After 10 hours of rail travel, stage one is complete. A smooth journey, with only one minor delay which luckily didn’t result in a missed connection. We passed into Cornwall over the Taymar bridge thinking we were nearly there; wrong. It takes a long time to get to the end of the earth. Our journey was most pleasant (trying to sound like Michael Portillo and his great British railway journey) and shared with some most delightful fellow passengers with one kind lady donating to our cause: maybe she felt responsible for the weather which seemed ‘set in’ as we left Bodmin. If the lady in question happens to read this, please drop us an email so that we might keep in touch.
So. The rain WILL clear by tomorrow morning and as it’s not stopping it’s dinner and beverages in the hotel.