Featured post

A more relaxed 2020 summer

As the title says this summer has been pretty chilled out. These bees in the peach tree were stressed out looking for a new home. They left after 3 days.

We are now in September and still very hot. This about nine a.m, once the sun comes up. The nights are pleasantly cool.

Here’s what been going on in July and August. It’s generally been too hot to work outside during the day. You have to start very early to work comfortably in the field. Unfortunately I still can’t wake early enough. But it’s not been bad. I am okay with my performance :). I am also learning new stuff and looking for alternative types of work which I can do – part-time.

Starting with the Mango tree.

Mango, algarve, Belnonte, Kent variety, manga D'algarve
Kent variety

This had been growing promisingly in a pot for the last two years. It’s of the Kent variety. This year it gave me a mango which wasn’t bad. But then disaster. Suddenly the growing tips shriveled and died and now all the leaves have dropped off. I think I may have not irrigated it properly for a few days during this very hot summer. Fortunately, it seems to be recovering.

Grapes.

One of the vines planted back in 2017 finally gave me grapes. Good ones :). They are of the Italia variety.

Nashi pear.

nashi pear, nashi pera, Belmonte, Luz de Tavira

I have two of these. This year one of them has given me over a dozen good pears. The biggest was the size of a tennis ball. The are very sweet when sun ripened. Some type of insect seems fond of them too and I think it lays it eggs inside as the puncture leads to the core. I need to address this to increase next year’s yield.nashi pera, nashi pear, Belmonte, Algarve, Luz de Tavira

I have had about half a dozen tomato plants that grew well and gave me a couple good size tomatoes at the end of July.

sun rioened tomatoes, Belmonte, Juz de Tavira, algarve

Planted some more in August which are still quite small and only just beginning to flower. I have to be more pro active and really make more of an effort to grow more vegetables. I planted onions in August but they didn’t take.

I have sweet potato now given to me by a nice Swedish lady. We picked carobs and almonds together. This year the carobs have a good price backed by the Government initiative to support local producers. It was €12 for 15 kg. As good as almonds were last year.

carobs, alfaroba, Belnonte, Luz de Tavira

The dogs are well. Bonji is on heat so I have to keep her locked in. I let her have a week of fun. I plan on getting her spayed soon. I take Peeps with me when I go out including cockling. She likes the excursions :). cockle, berbigão, Fuseta, Torre de Aires, Ria Formosa, Algarve

The kayaking has been good for me this summer. I still haven’t been fishing due to lack of proper bait.

Olives.

oliveiras para vender, olive trees for sale, Belmonte, Luz de Tavira
Olive trees for sale

Irrigating the olives at the bottom via a hose pipe is time consuming but they have grown well. Some of them have even got a few olives on them. I hope to sell some of them and transplant the rest around my property.

Renewable energy, Solar PV, battery bank , lead acid, Algarve

My solar P.V. system is non functional at the moment. My lead acid battery bank is exhausted and was getting seriously over charged by the charge controller which is a simple PWM (pulse width modulation ) type. I didn’t realise that this type of charge controller dumps all the current from the solar panel array into the batteries! It depends on the battery voltage to cut-off. You cannot use it to charge an individual depleted battery from a large PV array. The battery boils, gets very hot and has a good chance of exploding. This is what was happening as the batteries aged and their capacity to store charge diminished. The charge controller continued put the now excessive amount of current into them causing the batteries to seriously overheat, the electrolyte evaporate and the plates to buckle . This leads to rapid complete battery failure.

So I am working on a replacement plan. That’s all for now. Until next time!

Featured post

Finally! Pushed the boat out.

Torre de Aires, near Pinheiro, Tavira, Algarve Portugal, canoeing
Pushing the boat out

And I am really happy that after a long time I can post to this category.

So summer is well under way it’s very hot and it’s ‘o tempo do berbigão’ although I haven’t yet indulged 😀

I had to make an concerted effort to get my boat to the water, being challenged for transport.

I have an electric bicycle type scooter and a small excellent trailer that I got from On the Rocks Bike shop in Olhão. I had to modify the connecting bar in order to get the canoe to fit. I replaced the connecting bar with a interchangeable standard 50mm diameter by 3 metre galvanized hollow steel rod.The ground clearance I ended up with is quite low, about 4 inches but I made the journey to Pinheiro including traversing speed bumps without incidence.

Prior planning and preparation.

I decided to moor the kayak/canoe in the Ria Formosa. So I had to first secure a bit of chain to the river bed to which I attached a home made bouy. The camera passed the underwater test. I also made a shroud of standard plastic shade screen which works quite well. I also made rollers of black irrigation pipe to help move the canoe over the ground.

The crossing.

Yesterday we made the crossing with Bonji to Praia Paríoso beach from Torre de Aires. We went out as the tide was coming in. So it was hard work paddling out. A bit windy too but there weren’t any waves to make the journey a bumpy ride. The Critter2, an open plastic 2 man kayak, is a river kayak/canoe and has quite a flat bottom. Bonji was very relaxed . Coming back was easier as the current was with us. I lost some time by taking a wrong channel and so had to double back. There were a lot of mullet and perch native to the Ria Formosa, leaping out of the water. They seemed to be having fun. 🙂 .

After beaching the canoe we walked across the dune, about 250 m to the beach with the real ocean. The beach goes on for miles and was deserted.

The real ocean
This is the map of where we were.

That’s all for now!

Featured post

Mid summer’s June 2020

At the Ria Formosa not far from home with Bonji and Peeps.

Ria Formosa, Belmonte, Luz de Tavira, Algarve, Portugal, nature reserve
Ria Formosa, near Belmonte, Luz de Tavira, East Algarve, Portugal

It has been very hot this week and we have had some proper mid summer nights. Very warm and humid. I have just been camped at home but it’s fine as I have enough to do. The dogs keep me busy as well.

I don’t usually bang on about Permaculture and sustainability.

physallis peruviana, cape gooseberry, almonds in porridge, Belnonte, Luz de Tavira, Algarve, Portugal
Healthy oatmeal porridge

I like to think I do what I can but I don’t think it is possible to be anywhere near 100% self-sustainable. We can make a difference to our daily lives if we make an effort to grow our own. Here is what goes into my oatmeal porridge. Almonds which I have from last year and physallis peruviana berries. This is also known as the Cape gooseberry. It is truly a permaculture plant – with a bit of compost and a decent supply of water it produces berries 8-9 months of the year and provides me with fruit when there is nothing else. Thank you Martin Maracapino for the seeds that started me off. Now the plants self-seed so all I have to do is transplant the seedlings regularly.

plum leaf eaten by pest, Belmonte, Luz de Tavira , Eastern Algarve
Badly eaten plum tree leaves.

I have half a dozen plum trees. This year my heaviest cropper the Roxo (purple), is doing poorly. It was attacked by plum curl (a fungus) and an insect that ate all the leaves. This pest only appeared last year. It deposits eggs which hatch into tiny white larvae things which I assume eat the leaves. Look at the state of the leaves.. . I’d really like to know what this pest is actually called.

plums, red and yellow/ green plum varieties, Belmonte, Luz de Tavira, East Algarve, Portugal
Plums!

I used some pesticide for the first time. It smells a bit like the stuff we used to use back in Kenya for cockroaches. I am really happy that there are no cockroaches worth mentioning here :). They are horrid things! I mixed the pesticide with soapy water and vegetable oil. It proved to be effective but it was too late for the fruit whose growth were severely stunted.

Back to the plum trees. This year, I have just the two trees bearing fruit. A red variety and a yellow/green variety. Both varieties are very good.

The grapes are coming along.

Grapevines. Dona Maria Branca and Italia varieties, Belmonte, East Algarve, Portugal
Grapevines. Dona Maria Branca and Italia varieties.

The pumpkins are growing slowly and some are struggling. I put them in heavy clay soil that bakes rock hard due to a current lack compost. Most have flowered but I am still waiting to see an actual pumpkin develop. I have a few tomatoes growing well. I should have really planted more in this spot. I put some elsewhere where the compost and water were insufficient and this turned out to be a mistake.

Pumpkin plant and tomatoes.

Oh apricots! In early June I had a good number of apricots. Made some jam – tastes fine :). The flowers are osteospermum. They grow very well here and are pervasive.

Apricot jam

I made my first apricot cake and preserved some apricots for the winter. I have been busy 🙂

apricors, damascos, Belmonte, Luz de TAvira, East Algarve, Portugal
Apricot cake and preserved apricots

The battery bank that supports my solar P.V system is exhausted. The batteries are not holding charge so I don’t even have solar powered lights once the sun goes down. The batteries are of the flooded lead acid variety and I used them hard so it was to be expected after 5 years. They paid for their cost but are now junk O_O. I have to come up with a replacement plan but I am not keen on more lead acid which I will have to scrap eventually. Nickel Iron batteries appeal to me even though they drain current characteristics is much lower than that of lead acid batteries. Lithium ion are good but expensive – and will have to be replaced in 10 to 15 years.

Well, that’s all from the eastern Algarve, Portugal. Hoping to push the canoe out soon!

Featured post

May and roll on Summer!

I have been recovering from the Covid-19 virus this month and been taking it easy.

This week I have been making an effort to clear grass and weeds that have regrown. We are required by law to do this by the end of this month to help reduce the risk of fires. Summer is definitely here with inside temperatures of about 27ºc max. Here the dogs Bonji and PG are cooling down inside.

To help me I have been using some light machinery. I don’t have a tractor and don’t really need one now.

I use a strimmer to get to the difficult places and to cut over the irrigation pipes.

Been using this battery operated 36V Black and Decker strimmer quite a bit all over the property.

Black+Decker 36V battery operated strimmer ,  England

It cuts really well for what it is. It has 2Ah battery and runs for about 20 mins at full tilt. I really need another spare battery. The motor’s power is quite minuscule. It’s not rated. But if it runs for 20 mins.

Then (20mins/60 mins) x 2Ah = 0.667 Amps Hence the power of the motor is given by I Amps x V volts 0.667Amps x36 Volts= 24 Watts .

I am quite shocked. I am surprised at how small the motor is in terms of power has because it does an outstanding job! It cuts through some tough weeds. I changed the standard 1.5mm gauge line to 2.4 mm. It doesn’t auto feed with this but helps me cut through the thicker weeds. I bought it on amazon.co.uk who shipped it over. I bought the battery separately and modified so that I can use an external battery pack if I need to. I tried 12V 2.5 Ah lead acid batteries x3. Still quite heavy on your back at around 6kg. The machine Black and Decker Model GLC3630LB-XJ weighs just 3 Kg (with the lithium ion battery ) and is a delight to use.

Correction: Those lead acid batteries are 5Ah and weigh 5.4kg on your back. I had to press them into service today after the lithium ion battery charger gave up the ghost. 6/062020

The real work horse has been the Italian made BNF 502, motorized scythe. The american built Briggs and Stratton 190cc petrol engine. It now takes me about 8 hours to clear my property with it. Look at the teeth. 🙂 I grease and oil the blade before making a run. Shame to have had to cut all those wild flowers.

On the growing front. Harvested the fava beans this month. I get a handful of Physalis peruviana (Cape gooseberry) berries every other day. And now I have some sun ripened apricots which are very good. No worms so far.

Still growing my lettuce in pots which as you see works well for me. I need to plant another batch soon.

alface, favas, Belmonte, Luz de Tavira, Algarve

The irrigation pipe to the young olives on the western border was a good investment. It saves me and didn’t cost the earth. I have palnted a few pumpkins next to thes young olive trees. We have to see how then get on.

olive, olive oil , Belmonte, Algarve

That’s all for now! Thanks for reading!

Featured post

Spring 2020!

Spring 2020 Algarve, Portugal

Spring it definitely here! It’s the last day of the month so I though I better post a blog for April.

I am not feeling very well today but best foot forward. I think the dreaded virus , the one that begins with the letter “C” is having a second go. I didn’t manage to quite shake it off after the first bout and it was still lurking within.

So with the lock down here I haven’t been doing much in April. In the agricultural sector anyway. Look at my poor excuse of a vegetable garden. horta, algrave , Portugal

You can see a few tomatoes plants I planted a few days back. The spinach is really struggling. I sowed the prepared patch densely a month ago but the results have been poor.

But look at the cabbage. Portuguese staple variety – “ Cove Galega”.

Cove Galega

I planted a couple next to several fruit trees and it has worked out well. I planted a few broad beans too. Just for myself. I didn’t bother planting extra for the people – ‘o Povo’ this year. favas, Algarve Portugal

Olive trees. I transplanted a few and have put in some irrigation so hopefully they should grow well if slowly.

olive oil, extra virgin, Belmonte

This is such a nice stone wall belonging to property just opposite to me. Hand crafted stone by stone – by craftsmen and labourers for the very wealthy here. A lot of sweat and some blood goes into building these walls. The craftsman and the labourer are not necessarily the same. But without doubt, both bear me a grudge. This being as I neither pay their wages nor work for their bosses.. . Ce la vie. In the foreground you can see one of my young pomegranate trees which is doing well due to plentiful amount of rain had here in the Algarve this spring.

Sweat and blood and a pomegranate tree

Indeed, you can see here the almonds on the almond trees growing niceiy ad the almonds plumping out. I have some plum trees but they seem to have been attacked by fungi (peach curl leaf) and some parasite that is eating the leaves. So most of the fruit has dropped of. I will give them an second spray with some insecticide this weekend.

almonds on trees, algarve, portugal

The guava trees are still in their red winter livery and the apple trees are still nude of foliage. This is because it still cold at nights. guava tree, algarve, portugal

Here is a fine apricot tree. Hopefully the black fly won’t ruin the fruit. I am trying to trap.

And here is a fine persimmon (sharon fruit) tree. it is still young just three years old so may not bear any fruit.

Finally a the bottom of the spread where self seeded olives and almonds are growing. And no, I don’t live in that caravan normally. 🙂

Portugal, East Algarve, Belmonte, amendoiras, oliverias , azeite, extra virgin olive oil
The spread 🙂
Featured post
Ubuntu 18.04

Life after MS Windows 7

Microsoft Windows 7 ended support in January 2020. What this means to MS Windows users like myself is that your computer will be increasing at risk as it is no longer patched for security vulnerabilities by Microsoft. Ubuntu 18.04

Burying your head in the sand is not an option. However if you are using an island configuration which never has to connect to other computers or the internet you can carry on as you are.

The other two options are to upgrade to Windows 10 or move to another operating system such as Linux.

I have been looking into Ubuntu Linux from Canonical. Their latest desktop version is 18.04 which you can download here.

If you have older machines with 32 bit operating systems you will have to use another distribution of Linux , as Canonical, the owners of Ubuntu only support 64 bit cpus (central processing units) . Linux itself dropped support for 32 bit cpus in 2012.

I haven’t tested any of these as yet but here are a couple of 32 bit distributions.

Ubuntu Linux 18.04 LTS (aka Bionic Beaver :))

This is what I have been testing. You can download the .iso file from (link)here and create a bootable USB or DVD with it. You will also need the Rufus program to burn the .iso. Full instructions can be found here:

Why Ubuntu Linux 18.04 LTS?

  • The LTS (Long Term Support) for starters. This means the operating system is supported for 5 years by Canonical so you will receive security patches. 18.04 LTS will be supported for 5 years until April 2023.
  • The Snap App installer ensures you download software that has been tested and checked for malware by the developers.
  • The GNOME 3 desktop is delightful to use.

The results

I am quite impressed. It picked up and installed the drivers for my network card and wireless worked straight away so I was able to connect to the internet and print to my HP 2600 printer without having to anything.

The only major drawback was there was no storage i.e persistence.. Any programs installed and changes made were lost once you turned the computer off.

Installing Linux with Persistence on a USB stick

The Rufus v3.8 has the ability to create a bootable usb version of linux on a USB drive. See image below. However this does not work for Ubuntu 18.04.4 There is some bug that has not been fixed apparently. (Mosty, 2020).

Rufus iso bootable usb

I found this article on Foss Linux (Adel, 2019) and had a go using the Gparted application on the bootable Ubuntu USB created from the .iso image. You need another spare USB drive on which to install Ubuntu with persistence if you are booting Ubuntu from a USB drive rather than a DVD.

After using the Gparted app. to delete all partitions on the target USB, I began the installation.

(imagGpartede)

I selected Normal installation and Something else as recommend by the article.

Ubuntu normal (2 Ubuntu something elseimages)

Select the drive to partition. Also make sure the correct drive is selected in “Device for boot Menu” at the bottom.select correct drive, Ubuntu

I partitioned the drive with a FAT32, where the installation goes. You can give the mount point any name. This is a Primary partition. This should be a minimum size of 5.3 Gigabytes.Ubuntu FAT32

I next created a logical drive with a ext4 journaling partition (“ / ” mount point) and a swap file partition.

The swap file partition should be a minimum of 4.096 Gigabytes.logical linux swap partition

The ext4 journaling partition is what gives the installation the capability of persistence. I found you can’t see the FAT32 partition by default. successful Ubuntu installation with this configurtion

The Gparted application doesn’t seem to get installed by default when you install Ubuntu.

You can setup Live Patch to keep you secure once you boot up,

Ubuntu Live Patch

and install Apps with the Ubuntu Snap-in Application Manager.

Ubuntu Snap apps

All in all I am happy with Ubuntu 18.04 and am getting to grips with finding my way around this new operating system 🙂

Note: THe FAT32 on which the Ubuntu OS is installed is not visible with File Manager even as Administrator fat32 partition hidden on Ubuntu

Sources:

H. Edel 2019, https://www.fosslinux.com/10212/how-to-install-a-complete-ubuntu-on-a-usb-flash-drive.htm

Foss, 2020 https://itsfoss.com/lightweight-linux-beginners/

Ubuntu Desktop , 2020 https://ubuntu.com/download/desktop

Featured post

Using readily available biomass keeps energy bills down.

wood burning stove
Back in 2014

Using readily available biomass such as cut logs can help keep your overall energy bills down. If you are lucky to access to woody biomass which you can harvest sustainably

or access to wood residues like off-cuts it makes sense to spend time and energy collecting and processing these.

As it is on a small scale it is environmentally friendly and does not require huge amounts of energy to produce unlike wood chips or pellets.

During the winter months we use a lot more heat energy to stay warm. This can be in the form of gas central heating or electric underfloor heating or stand alone gas or electric heaters. In either case they are expensive to run. If you like your hot bath and showers in the winter this can add significantly to your energy bills. Using readily available biomass such as wood can help keep your overall energy bills down.

How much money can be saved using biomass as a form of heating.

Here is my own example. Metrics help separate fact from fiction. I like my hot showers and baths during winter. However the cost of electrically heating water at current energy prices is not trivial. [/lang en]

wood burning stove
2020

Let’s look at the cost of heating a 100 litre tank from 18ºC to 50ºC.

The specific heat capacity of water is 4200 J per kg per degree Kelvin. This is the energy required to raise the temperature of 1 kg of water by 1 degree Kelvin (or Celcius).

The temperature change is 50ºC – 20ºC = 30ºC

100 litres of water is 100 kg

The energy E, in joules required to heat the water is given by E = mass x specific heat capacity x change in temperate,

So , E = 100 kg x 4200 Joules x 30ºC => E = 12600000J (Joules)

1 J/sec = 1 Watt (W)

Hence 12600000J /(3600s) 3500 Wh or 3.5kWh

The actual time it takes for me to electrically heat the tank is 2.5 hours.

I have a 1000 Watt heater.

Therefore 1000 x (2.5h ) = 2500Wh

This is equivalent to 2.5 kWh (kiloWatts)

It would appear I use 1kWh of electricity less that estimated. This maybe be due to the fact the water sinside the tank remains at a higher temperature that the estimated 20ºC

when I start heating electrically.

I get my electricity from the energy co-operative, Coopérnico .

This is their 2019 tariff for bi-horário.

So heating the water during off peak hours (vazio) costs 0.0987 cents per kiloWatt hour (kWh)

So 0.0987€ x 2.5kWh = 0.24675€

(7 days x 4) x 0.24675€ = €6.909

With IVA (VAT) at 23% = €8.4981 is what I can save a month.

I have a hot bath by boiling a pot of 5 litres of water on my wood burner. Doing this 2-3 times a week during winter is worth my while. Besides boiling bath water I can also do a little cooking on top of the wood burner to make further savings.

Featured post

Our Olive Oil from the Algarve, Portugal

Locally produced Extra Virgin Olive Oil, Algarve, Portugal

Locally produced Extra Virgin Olive Oil

The olive oil we made came from a variety of olives. These olives grew  and ripened under the Algarve sun in southern Portugal.

The black varieties included Cornicabra and Galega gave us extra virgin oil of 0.7 degree.

Galega olives, Algarve , Portugal

Galega olives

The green varieties of olives produced extra virgin oil of 0.5 degree. These olives were more of a spherical type and some of them were huge with diameters exceeding 3 cm. I have yet to identify these varieties. Most of these trees were grafted by the Portuguese over 50 to 200 years ago.

For an explanation of the degree of olive oil see the previous article.

Cornicabra olives, Algarve Portugal

Cornicabra olives image credited to viveiros da bairrada

The healthy benefits are of Extra Virgin Oil are much vaunted .

The verified facts are:

  • Rich in anti-oxidants so a good nuero protector.

  • Unrefined olive oil is best as it is a rich source of antioxidants and vitamins.

  • The antioxidants contained in Extra Virgin Oil oil do not break down on heating. This is great as as it means you can cook with extra Virgin Olive oil without loss of the antioxidants. This brings me to the myth of cold pressed olive oil. What temperature is this “cold” exactly? Because room temperature varies from 18ºC to about 24ºC depending on the individual. Unrefined Extra virgin Oil starts to congeal at temperatures below 16ºC so you would get very little oil pressing at these temperatures in the cold season of October to December. For this reason olive oil presses have to supply some heat during the extraction process. It does not affect the beneficial properties of the olive oil nor affect the oil’s excellent taste which should be peppery ans grassy. Some Extra virgin oils are slightly bitter.

  • Cooking with Extra Virgin Oil helps prevent the break down and loss of beneficial nutrients like vitamin C in vegetables.

  • A diet that includes regular amounts Extra Virgin Oil oil has been proved to reduced bone fractures and loss of bone in the elderly.

Facts not completely verified are:

  • Reduces the risk of Stroke and Heart Attack. This could be true as the Extra Virgin Oil would replace other fats in one´s diet responsible for cholesterol and restricted flow in the blood vessels.

“Where can I get some of this fine Extra Virgin Olive oil of yours?”

If you are in Hillingdon, West London or High Wycombe, Buckinghamshire, we have a limited stock of this Portuguese unrefined Extra Virgin Olive Oil in 1 litre bottles. Email  jdsouza@lineone.net for details.

Sources:

11 Health Benefits of Extra Virgin Olive Oil That You Can’t Ignore

https://www.ncbi.nlm.nih.gov/pubmed/28143667 (refers to bone loss)

http://www.viveirosdabairrada.com

Moving a live WordPress site to a local LAMP Server

Linux, Apache, MySql, WordPress, Web Development, Algarve, Portugal
LAMP on Ubuntu 18.04

Audience: Ubuntu Desktop and Server users. Tested on 18.04

Steps to follow to setup a local development WordPress installation.

1) Copy your entire live WordPress directory to your local LAMP server.

Do this by means of FTP using and FTP Client such as Filezilla.

This should include your wp-admin, wp-includes , wp-admin and all the files in the root directory in which these reside. This is where the wp-config.php, wp-login.php, .htaccess files etc reside.

2) On your LAMP server these should be placed in the directory. It is advisable to create a folder under the html directory where these files will go if you are hosting more than one test site. e.g var/www/html/testsite

3) Backup the MySql database related to your WordPress live site. It is easiest to do this using PHPMyAdmin provided by your control panel of your hosting site. This is the only way have done it so far. Accept defaults and export the database. You will be given the option to save the file as a *.sql file.

Ubuntu 18.04, WordPress, Stack Exchange, Ask Ubuntu, Algarve, Portugal

4) On your LAMP server create a MySql database and database user. You can use PHPMyAdmin. However I have had problems, with PHPMyAdmin throwing up errors and not importing the database correctly or granting user privileges correctly. I have had to do it via command line like this. I strongly advise this method, as command line rules. 🙂

By command line.

Log into mysql as root

Create database

mysql> create database db_name;

Import the database:

mysql> use db_name;

mysql> source backup-file.sql;

Create a user and grant privileges

GRANT ALL PRIVILEGES ON mydb.sql TO myuser@localhost IDENTIFIED BY "mypassword";

5) Edit your WordPress wp-config.php ensuring that the database name, username and user password match the ones created.

6) Update your tables to ensure your links work but running the following 3 command line MySql queries on the following tables. You can do this by logging into mysql as root via command line.

UPDATE wp_options SET option_value = replace(option_value, 'http://www.example.com', 'http://localhost/test-site') WHERE option_name = 'home' OR option_name = 'siteurl';

UPDATE wp_posts SET post_content = replace(post_content, 'http://www.example.com', 'http://localhost/test-site');

UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://www.example.com','http://localhost/test-site');

These queries will replace references to your live site’s URL from database with the localhost URL.

7) Lastly, an mostly importantly this pertains to the Ubuntu operating system environment. Apache here is installed differently from a native install for security reasons. In order to get your development WordPress running, you must do the following otherwise none of the symlinks ( symbolic links) to other pages on your site will work.

Note: nano is a text editor that’s pre-installed on Ubuntu

  1. In /etc/apache2/apache2.conf, edit AllowOverride None for /var/www/ to AllowOverride All
  2. To edit use

sudo nano /etc/apache2/apache2.conf

Press CTRL + W and search for “<Directory /var/www/>”

Change here AllowOverride None to AllowOverride All

Save file and exit. (Press CTRL + X, press Y and then press ENTER)

  1. Type in the following command to enable mod_rewrite for .htaccess

sudo a2enmod rewrite

  1. Restart your apache server:

sudo service apache2 restart

Finally make sure you have a .htaccess file in the root directory where WordPress is installed.

It should contain code similar to this:

# BEGIN WordPress

<IfModule mod_rewrite.c>

RewriteEngine On

RewriteBase /your_directory/

RewriteRule ^index\.php$ – [L]

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule . /your_directory index.php [L]

</IfModule>

# END WordPress

That’s about it for now! Coming soon, a Control Panel App for a local LAMP install.

Sources:

Credits to: https://wordpress.stackexchange.com/users/84055/avinash (April,2020)

Credits to: https://www.wpbeginner.com, Editorial Staff at WPBeginner led by Syed Balkhi. (April,2020)

LAMP on Ubuntu 18.04

I took the leap and migrated to linux, ditching MS Windows 7 as my main operating system.

On the whole I am very pleased with Ubuntu 18.04.

I was running XAMPP on Windows 7 as test environment for hosting WordPress and PHP based applications.

So I needed to install a similar test environment on Ubuntu 18.04 desktop. In the Linux world this is LAMP. The components of LAMP are Linux, Apache Web Server, MySQL Server and PHP

Here is how to install LAMP on Ubuntu 18.04

Using command line via Terminal (press Control+Alt+T ) Terminal  Ubuntu 18.04

Install Mysql.

  • Ensure you have an internet connection then open Terminal.
  • Type sudo apt install mysql-server

Press Enter on the keyboard. This will install the Mysql Metapackage from the Debian repositories.

Test your Mysql server installation by typing mysql in the terminal window. You used be able to login with your Ubuntu user login password.

Install Apache 2

To install Apache you must install the Metapackage apache2 from the Debian repositories. This can by

  • Ensure you have an internet connection then open Terminal.
  • Type sudo apt install apache2

Install PHP

  • Ensure you have an internet connection then open Terminal.
  • sudo apt install php-pear php-fpm php-dev php-zip php-curl php-xmlrpc php-gd php-mysql php-mbstring
  • Your server should restart Apache automatically after the installation of both MySQL and PHP. If it doesn’t, execute this command.

Check Apache

You should see the following page with a message saying that it work

Apache Web Server running

Check PHP

  • You can check your PHP by executing any PHP file from within /var/www/.
  • Alternatively you can execute the following command, which will make PHP run the code without the need for creating a file . $ php -r ‘echo “Your PHP installation is working\n”;’

Pat yourself on the back and take a break. Congratulations! You have just successfully installed a LAMP server on Apache.

As a reward install and play Chromium BSU.

  • Ensure you have an internet connection then open Terminal.
  • Type sudo apt install chromium-bsu

This should download and install this excellent arcade game which you can play for 5 minutes to have a break :). I tried downloading it from the Ubuntu Snap store but it didn’t install correctly from there. Chromium B.S.U Debian, Ubuntu 18.04

Preparing LAMP to run as a local WordPress and Web Hosting Test Environment.

Ubuntu installs Apache in modules and splits the configuration files which is different from the standard install.

The Mysql server installs with the Ubuntu user as root for authentication. WordPress and other applications use native mysql authentication.

Here is how to enable native root user authentication and change the mysql root user password.

  • Stop mysql:
  • $ sudo service mysql stop
  • (Be sure to stop the current server before performing the steps. Only one server can run at a time.)
  • $ sudo mkdir /var/run/mysqld; sudo chown mysql /var/run/mysqld
  • $ sudo mysqld_safe –skip-grant-tables&
You should see sonething like this if it runs successfully

[1] 1901

*@*-desktop:~$ 2020-04-29T20:36:42.126862Z mysqld_safe Logging to syslog.

2020-04-29T20:36:42.132327Z mysqld_safe Logging to ‘/var/log/mysql/error.log’.

  • 2020-04-29T20:36:42.197722Z mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
  • Next run $ sudo mysql --user=root mysql
  • This will log you in as the native mysql root user.

“Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 2

Server version: 5.7.29-0ubuntu0.18.04.1 (Ubuntu)..”

and you should have the mysql prompt mysql>

  • to change the root pasword run

mysql> update user set authentication_string=PASSWORD('new_password') where user='root';

You should see

Query OK, 1 row affected, 1 warning (0.03 sec)

Rows matched: 1 Changed: 1 Warnings: 1”

  • To change the authentication plugin run

mysql> UPDATE user SET plugin=’mysql_native_password’;

You should see someething like

Query OK, 4 rows affected (0.00 sec)

Rows matched: 4 Changed: 4 Warnings: 0

  • Finally

mysql> FLUSH PRIVILEGES;

  • mysql> quit
  • stop and start the mysql server and test root login:

Stop mysql:

$ sudo service mysql stop

Start mysql (normal):

$ sudo service mysql start

Log in as root on localhost:

$ mysql -h localhost -u root -p 

That’s it for now! 

Sources:
Ask Ubuntu - software installation - mysql doesn't ask for root password when installing - Ask Ubuntu

Initial Server Setup with Ubuntu 18.04 | DigitalOcean

https://howtoubuntu.org/ ,How to Install LAMP on Ubuntu, April,2020