Updating WordPress Manually

The explanation we do is for linux Elementary OS but it is valid for any operating system, only changing the syntax of the copy, delete, etc. commands.

Very important, before updating we strongly recommend to make a backup of our current WordPress.

At the end of the next post it is explained how to make a WordPress backup and how to restore it if necessary.

The update can be done automatically from WordPress but my experience is that very frequently it fails and it is necessary to do a manual update.

But no problem because this is not difficult.

The first thing to do is download the .zip file with the latest version of WordPress from the official WordPress page.

https://wordpress.org/

We download WordPress and unzip it. The WordPress that we download is independent of the operating system we use and is valid for any operating system.

We choose download and install to download it.

If we click on Download WordPress xx we download the compressed version in zip format, if we click on Download.tar.gz we download the compressed version in tar.gz format, either of the two is valid for all operating systems, in this post we will do it with Download.tar.gz which is more linux like.

After downloading we will have the file wordpres-x.x.tar.gz in /home/UserName/Downloads

Now we open a terminal

from the terminal window we execute:

sudo tar -xf wordpres-x.x.tar.gz /opt/lampp/htdocs

In the path where we have unzipped the package, a directory called wordpress will be created.

We will change the owner of this directory and its content to our user, where UserName is the user we have logged in with the command

sudo chown -R UserName /opt/lampp/htdocs/wordpress/

We will give write permissions to the WordPress directory group. This is because WordPress needs to write configuration files, install plugins, upload content, update itself, etc.

sudo chmod -R g+w /opt/lampp/htdocs/wordpress/

We can see now the folder

From the folders that we obtain we delete wp-content because we will not need it because we will keep the one we had that contains our current WordPress site.

rm -r /home/userName/downloads/wordpress/wp-content

We also delete the unzipped file wp-config-sample.php as we will keep the old one we had.

rm /home/userName/downloads/wordpress/wp-config-sample.php

We stopped the Mysql and Apache services.

First we open Xampp Control Panel

We select the Manage Servers tab

From here we stop MySQL Database and Apache Web Server

Now we go to our old WordPress and rename the wp-admin and wp-includes folders to wp-adminOld and wp-includesOld.

sudo mv /opt/lamp/httpdocs/wordpress/wp-admin /opt/lamp/httpdocs/wordpress/wp-adminOld

sudo mv /opt/lamp/httpdocs/wordpress/wp-includes /opt/lamp/httpdocs/wordpress/wp-includesOld

I do this not to delete them, because we won’t need them anymore, we can delete them when we see that everything works ok.

sudo rm -r /opt/lamp/htdocs/wordpress/wp-adminOld

sudo rm -r /opt/lamp/htdocs/wordpress/wp-includesOld

We copy the new folders wp-admin and wp-includes to /opt/lamp/wordpress

sudo mv /home/userName/downloads/wordpress/wp-admin /opt/lamp/htdocs/wordpress/wp-admin

sudo mv /home/userName/downloads/wordpress/wp-includes /opt/lamp/htdocs/wordpress/wp-includes

Now we copy all the files that we unzipped in the folder except wp-config-sample.php that we had deleted replacing the files of our old WordPress installation

sudo cp -r /home/userName/downloads/wordpress/* /opt/lamp/htdocs/wordpress

We start now MySQL Database and Apache Web Server.

Now we write in the navigation bar of our browser depending on the port we are using for http:

http://localhost/wordpress/wp-admin/upgrade.php or http://localhost:81/wordpress/wp-admin/upgrade.php

We click on Update wordpress database and the update is finished.

Now we write in the navigation bar of our browser depending on the port we are using for http:

http://localhost or http://localhost:81

and we already access our updated WordPress.

Installing WordPress over Xampp on Elementary OS

In this previous post we explain how to install Xampp on Elementary OS.

In this other previous one we learned how to open our server to the Internet

Now is time to install WorPress to manage our website in a simple and efficient way.

The first thing we will do is create the database that WordPress needs to work.

Before installing WordPress either a new installation or to migrate a WordPress installation to our web server, we need to create a new database.

Initially we will do a fresh installation, but at the end of this post we will explain how to make and restore WordPress backups.

Restoring the backup (no matter what operating system it resides on) is the procedure that will be used to migrate a previous WordPress installation to our new web server.

For that we are going to use phpMyAdmin, which is the tool that manages the MySQL databases from our Xampp server.

We write in the navigation bar of our browser

localhost:81/phpmyadmin

When accessing the phpMyAdmin database manager on the left side you will see the databases that are created by default on the server.

We click on New.

In the right part we write the name of the database, for example wordpress (*) and we choose the option utf8_general_ci.

We click on the Create button.

(*) If we are going to migrate a previous installation, we will give it the same name that the database had in the previous installation.

Now in the section on the left you will have your new database created.

This will be the database that WordPress will use.

The user to manage it is root, which is the main user that MySQL creates, and by default the root user does not have any password.

Once we have the new database created to install WordPress, the first thing we have to do is download the .zip file with the latest version of WordPress from the official WordPress page.

https://wordpress.org/

We choose download and install to download it.

If we click on Download WordPress xx we download the compressed version in zip format, if we click on Download.tar.gz we download the compressed version in tar.gz format, either of the two is valid for all operating systems, in this post we will do it with Download.tar.gz which is more linux like.

After downloading we will have the file wordpres-x.x.tar.gz in /home/UserName/Downloads

Now we open a terminal

from the terminal window we execute:

sudo tar -xf wordpres-x.x.tar.gz /opt/lampp/htdocs

In the path where we have unzipped the package, a directory called wordpress will be created.

We will change the owner of this directory and its content to our user, where UserName is the user we have logged in with the command

sudo chown -R UserName /opt/lampp/htdocs/wordpress/

We will give write permissions to the WordPress directory group. This is because WordPress needs to write configuration files, install plugins, upload content, update itself, etc.

sudo chmod -R g+w /opt/lampp/htdocs/wordpress/

Now we write in the navigation bar of our browser

http://localhost:81/wordpress/

“wordpress” is the folder that we just created.

That will automatically take you to the welcome screen to begin the installation and configuration of WordPress.

We click let’s go!

click submit

Click on the Run the install button.

Here you have to fill in the data for the WordPress installation, such as the title of your new site, the name of the user you want to create to manage it, your password, email.

You can select the option Discourage search engines from indexing this site if you want, but then your WordPress will be ignored by Google and other search engines, (not recommended).

Then click Install WordPress.

If everything has gone well you will see a message like this in which it tells you that WordPress has been installed correctly.

Now you can click the Login button to go to the login window of your WordPress.

Use the username and password you chose earlier. Click the Login button and you will enter your new WordPress dashboard.

From the desktop you can create your website.

And typing in the navigation bar of our browser

http://localhost: 81/wordpress/

you will see how your site looks like.

If you installed your web server following the post Installing a web server at home with Xampp and Elementary OS and you opened it to the internet following the post Openning our home Xampp web server to the internet anyone who types in the navigation bar of their browser http://HomeServer.ddns.net/wordpress will access to your brand new website.

( Important: In order you can access to your WordPress site typing in the navigation bar of our browser http://HomeServer.ddns.net/wordpress , you should previously go to http://localhost:81/wordpress/wp-admin and then to Settings, General Settings and type as WordPress address (URL) and Site address (URL) http://HomeServer.ddns.net:81/wordpress ).

Finally, if we want WordPress to be the main home page of your site and that when anyone who writes in the navigation bar of their browser http://HomeServer.ddns.net (or the name that yow have given to your site) or localhost:81 from the Xampp server locally will access to your WordPress site directly.

We will open a terminal and type in the command line:

sudo io.elementary.code /opt/lampp/htdocs/index.php

The editor code will then be opened as superuser and in the index.php file we will change dashboard to wordpress and save

WordPress is already the main home page of our site.

Finally I will explain how to make and restore WordPress backups.

Remember that restoring the backup (no matter what operating system it resides on) is the procedure that will be used to migrate a previous WordPress installation to our web server.

To make the backup in the Xammp control panel we will stop Apache Web Server but we will not stop MySql Database.

We will copy the complete wordpress directory to the place where we are going to make the backup, for example, we open a terminal window and type

sudo cp -r /opt/lampp/htdocs/wordpress /opt/lampp/htdocs/wordpresscopy

We already have in /opt/lampp/htdocs/wordpresscopy the backup of the WordPress files

Now we will make the backup of the database

We open a terminal window and execute the following two commands:

cd /opt/lampp/bin

sudo ./mysqldump –user=root –password= passwordMySqlAdmin wordpress > backup.sql

Instead of passwordMySqlAdmin we will write the password of MySql root user, if root user do not have a password we will not write anything.

The backup.sql file will contain the backup of the database.

To restore the backup we will again stop Apache but we will not stop MySql.

Then we will delete the entire wordpress directory and copy the backup we made to /opt/lampp/htdocs/wordpress

For example opening a terminal window and typing

sudo rm -r /opt/lampp/htdocs/wordpress

sudo cp -r /opt/lampp/htdocs/wordpresscopy /opt/lampp/htdocs/wordpress

To restore the database (Previously, if the database does not exist, we will create it as we saw at the beginning of this post, we type in our browser localhost: 81/phpmyadmin … and we create it) and then from the terminal window we type

cd /opt/lampp/bin

sudo ./mysql –user=root –password= passwordMySqlAdmin wordpress < backup.sql

We have already restored the wordpress database, we only have to start Apache in the Xammp control panel.

If instead of Linux the operating sistem we are using is windows the commands for backup and restore are:

Backup

cd C:\xampp\mysql\bin

mysqldump –user=root –password= passwordMySqlAdmin wordpress > c:\ backup.sql

Restore

cd C:\xampp\mysql\bin

mysql –user=root –password= passwordMySqlAdmin < c:\backup.sql

Remote Control in Elementary OS

Remote Desktop Protocol (RDP) is not compatible with Pantheon, the Elementary OS desktop, so for now we have to ignore RDP to establish a remote control system over a system based on Elementary OS.

However, Virtual Network Computing (VNC) does work perfectly with Pantheon, so we are going to choose VNC for our remote control.

The VNC server is the program on your computer that shares your screen. The server passively allows the client to take control of it.

The VNC client is the program that monitors, controls and interacts with the server. The client controls the server.

Regarding VNC there are several solutions, some are free and others are not, such as Real VNC, in which the server part is not free and only the client is free with certain limitations, it also implies having to register and provides few advantages over other solutions.

As a VNC server we have chosen X11VNC, which is robust, simple and free.

We install it with the following commands by openning a command window:

sudo apt-get update

sudo apt-get install x11vnc net-tools

Ok is already installed, now we are going to configure it

First we establish the password to access from the client.

x11vnc -storepasswd 

Enter VNC password: *********
Verify password: *********  
Write password to /home/user/.vnc/passwd?  [y]/n y
Password written to: /home/user/.vnc/passwd

The VNC server will start on default port 5900. In case the port 5900 is busy with some other service, it will automatically select the next available port like 5901.

If we want to establish another port we will do it with the parameter -rfbport portNumber

For example we can start the server from the command line:

sudo x11vnc -auth guess -forever -loop -noxdamage -repeat -rfbauth /home/UserName/.vnc/passwd -rfbport 5959 -shared

We can also start the server from the graphical x11vnc environment from the applications menu

Then this screen is displayed

we click ok and then we see this other screen

We choose Accept Connetions and write the access passwords, the top one is for desktop control and the bottom one is for viewing only.

Finally, click on Apply and Ok and the VNC server is already started and waiting for the connection.

We only need a VNC client to connect, there are clients for Android like VNC Viewer, for Linux like Remmina and for almost all operating systems.

We are going to do it with UltraVNC viewer for Windows that works well, and it is free.

You can download it from here

You write the name of the server or the IP address of the server and followed by: the port (5900) for example 192.168.1.95:5900

Then it asks for the password and voila we are already connected to the VNC server.

Serra Tiy new musical album En lo Mío

Opening our home Xampp web server to the internet

In a previous article we have installed Xampp on Elementary OS and we could already see from our local network the default main page of the server by typing in the navigation bar of our browser http://localhost

The first thing we need is a domain name of our own to be visible through that domain name from the internet.

We can hire this domain from different providers or create a new free domain name for example through NoIP, which is what we are going to do.

NoIP is actually going to provide us with a free subdomain but this is enought for our purpose.

We will need to register on NoIP from here

Once registered on the NoIP page, we will display DynamicDNS and click on Create Hostname

We fill in the form with the domain name and subdomain that we prefer, the only restriction is that it is not previously registered, NoIP will inform us about it if necessary

Congratulations, we have our subdomain created, for example HomeServer.ddns.net where HomeServer is the subdomain and ddns.net is the domain.

Our home Internet Services Provider (ISP) generally provide us with dynamic external IP.

This external IP is the IP that the provider assigns to our router with which we reach the internet.

Dynamic external IP means that it is not always the same, our external IP changes, for example when we turn off and on the router.

NoIP needs to know our external IP continuously so that the DNS service can assign it to our new domain, in our example HomeServer.ddns.net or the name you have chosen.

For example: HomeServer.ddns.net could refer to the external IP 83.88.18.23

For this, NoIP provides us with the DUC client that constantly notifies to NoIP our external IP, in our example 83.88.18.23 and when it changes, DUC notifies NoIP.

Follow the NoIP instructions below to install:

How to Install the Linux Dynamic Update Client DUC on Ubuntu

this works for both Ubuntu and Elementary OS that derives from Ubuntu

Once we have solved with DUC the fact that our external IP is dynamic, we face another problem, that most Internet providers ISP reserve port 80, which is the port on which the Apache server that we have installed with Xampp listens by default.

There is no major problem either, we will change the port on which Apache listens as follows, in the Xampp Control Panel we click on configure and change port 80 to 81 for example, or if you prefer we can also edit the file /opt/lamp/etc/httpd .conf whith an editor as administrator, for example with the command

sudo io.elementary.code

and then open from the editor the file /opt/lamp/etc/httpd.conf

In any of these ways, we change port 80 to 81, now with the Stop button we stop Apache Web Server and with the Restart button we restart it on port 81.

Well this is almost done, we are just missing a couple of things.

We have to open ports 80 and 81 in our router and direct the traffic that comes to port 80 to 81, let me explain if someone from the internet writes on the navigation bar of their browser HomeServer.ddns.net goes to the http port by default 80 from our brand new server.

To go to port 81 you must type HomeServer.ddns.net:81.

To avoid that visitors to our portal the annoyance to write: 81 we redirect the traffic coming from the default port 80 to 81 on our router.

To do this we write in the navigation bar of the browser the internal IP of our router, in my case 192.168.1.1 (it is the gateway of my network, because the IP address of my server is 192.168.1.95 the IP address of my router will be 192.168.1.1)

The internal IP address of your router by default is written on a sticker attached to your router and also the password to access.

Once in your router, this varies according to models and providers we enter the configuration menu ports generally in the menu option NAT (Network Address Translator) and here we open ports 80 and 81 and redirect port 80 to 81, on my router it looks like this:

192.168.1.95 is the internal IP address of my internet Xampp server

Now we type from outside our network in the navigation bar of the browser HomeServer.ddns.net

When I say from outside, I mean without being connected to the home network or WiFi, for example with the mobile phone using 4G or 5G not connected to our home WiFi or from a friend’s house.

The home page of our internet server must be displayed on the browser.

If we cannot access to our server now from outside, it is because the ports in the Elementary OS firewall are closed.

In case that we cannot access to our server, we will open ports 80 and 81 with the command:

sudo ufw allow 80: 81 / tcp

If ufw is not installed in our Elemetary OS, we install it with the following commands:

sudo apt update

sudo apt upgrade

sudo apt-get install ufw

sudo apt install ufw

and now we run again the command

sudo ufw allow 80: 81 / tcp

We then write again from outside our network in the navigation bar of the browser HomeServer.ddns.net and voila we can see the home page of our server from internet.

Add Xampp Control Panel to Elementary OS Applications menu

In this previous post we learned how to install Xampp on Elementary OS

After installing Xampp in Elementary OS to launch the Xampp Control Panel we must open a terminal window

and run the command

sudo /opt/lampp/manager-linux-x64.run

sudo will ask us for the user’s password and after entering it the Xampp Control Panel window will appear

sudo vim /usr/share/applications/Xampp.desktop

The problem happens if for convenience we want to add the Xampp Control Panel to the Elementary OS Applications menu to be able to launch it without executing any command in the terminal.

In order to add an installed program to this menu, we must create the file with the extension ‘.desktop’ in the following folder: /usr/share/applications

To do that we will create the Xampp.desktop file with any text editor for example:

vim sudo vim /usr/share/applications/Xampp.desktop

inside the file we include the following text:

[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Icon=/opt/lampp/htdocs/favicon.ico
Name=XAMPP
Exec=sudo /opt/lampp/manager-linux-x64.run
Comment[en_US]=Start XAMPP Control Panel
Name=XAMPP
Comment=Start XAMPP Control Panel

Now if we display the applications menu, the Xampp Control Panel appears

But when we click on the Xampp Control Panel it does not get started

The problem is that when launching it from applications we cannot provide the password to sudo so in the end it does not get started

The simplest solution is to prevent sudo from asking for a password, so we execute it from a terminal

sudo visudo

This sentence will open a configuration document for the «sudo» command.

We must go to the end of the document and as the last line add this one.

username ALL = (ALL) NOPASSWD: ALL

as “username” we write the username with which we have logged in Elementary OS and then we save

Now to the user specified sudo will no longer ask for a password and if we now click on the Applications menu on the Xampp Control Panel it will start up without any problem.

Installing a web server at home with Xampp and Elementary OS

We start by downloading the version of Xampp for Linux in English from here

or if you prefer the Xampp version in Spanish it from here

Once the download is finished, we will have the installation file in our download directory

We open a terminal from Applications

From the terminal we go to the downloads directory by using the command

cd downloads

Then we write

ls

to see the name of the downloaded Xampp installation file and give it execution permissions to install

chmod +x xampp-linux-x64-5.6.40-0-installer.run

Now we install by writing

./xampp-linux-x64-5.6.40-0-installer.run

After the installation starts Xampp Control Panel, from where we select the Manage Servers tab

From there we start Apache and MySql

Now open the browser and in the address bar type localhost and we can see the Apache home page of our new server

if in the browser address bar we write localhost/phpmyadmin/

we can manage the MySql database

Installing Elementary OS

If your Windows operating system has become unstable and after reinstalling it rejects your OEM license number or you simply decide change from a proprietary and inefficient operating system for an open and efficient one in the need of hardware resources, Elementary OS is the best option.

Elementary OS is a Linux distribution derived from Ubuntu which is based on Debian and presents an elegant desktop with a style reminiscent of the expensive and limited Mac OS.

Elementary OS performs perfectly on practically any hardware, with an Intel i3 or similar and 4 GB of memory (RAM) runs really well.

You can download Elementary OS from here

To make an installation USB memory stick you can use Rufus by downloading it from here

To install from the USB memory Stick, you must restart your laptop starting the BIOS (this is done by holding down the escape key when restarting in some models such American Megatrends or by holding down the F2 key in others such as HP – consult your laptop documentation anyway-).

When in the BIOS enter into the Boot menu and disable Secure Boot.

Then select UEFI USB as the first boot option, after this exit the BIOS by choosing Quit & Save.

Then the laptop will restart showing the following screen

Here you can choose to test the Elementary OS without installing it or installing it directly.

I recommend trying it first to see if you like it and if it is compatible with your laptop hardware.

Enjoy your new operating system, it will pleasantly surprise you.

Tweaks, configure and minimize windows in Elementary OS

One of the first things you’ll miss in Elementary OS is that the windows cannot be minimized.

But don’t worry, this has a solution, install Tweaks.

Open the command window

From the command window type:

sudo apt install software-properties-common -y

sudo will request the user’s password

then type:

sudo add-apt-repository ppa:philip.scott/elementary-tweaks -y

and finally

sudo apt install elementary-tweaks -y

Tweks is installed.

Now go to Applications – System Settings – Tweaks

From Window Controls select the type of window you prefer, like Windows, Ubuntu, OS X where the button to minimize window will appear.

Here you can also select the type and size of the font, cursor, icons etc.