A little bit of background: I have like 3 copies of WP installed on local machines. If you want to know how to install WP locally, I wrote already a post about it. Then one day I come back to one of them and… surprise! I can’t log in anymore. Panic. Fever. What shall we do now? Why didn’t we pay attention to this install when it was just released? Fortunately, my WP was not alone and it was coming with a mariadb and a phpmyadmin installations. From there we can destroy fix everything. Let’s do it.
Log into phpmyadmin
Search for the database storing the wp information
Browse wp_users until you find your username
Click on Edit, and change the user_pass field for your new password
Background: we had a very big disconnection and the local WP installation didn’t come back after all the other systems came back. I have access to the website (so the apache2 service is running) but the main site as well as the admin site show only php text code. I tried rebooting the computer (a virtual machine) without luck. A very simple solution this one has. As usual, the solution is in StackOverflow.
I don’t have so much mood to write lately. I guess I’ve been busy thinking or something like that. Anyway, here I am again. (B)logging the last thing I did, that is to transform a single WP install onto a multisite install.I will be following this guide to arrive to the desired multisite configuration.
I start with an installed version (so no docker) on CentOS 7. I deactivate the plugins, then edit /var/www/html/wp-config.php as indicated.
Add this code before the /* That's all, stop editing! Happy blogging. */ line:
And of course, I have given permission to access phpmyadmin on this server. But at the end, as usual I manage to get what I want. Or should I say you managed to get what you wanted? 🧐. Because what I want is to write about what I think, not about what I do. And I’m not in the mood 😔. See you around…
In other words, replace the generic entries. I test the apache configuration
# apache2ctl configtest Syntax OK
Then I go to http://IP_ADDRESS and create the root user, etc. Like it is written here, on the howto install WP on Debian. It was very easy, as it was for CentOS 😎! Note that in one of the tutorial we use an apache server, and in the last one it’s an NGINX Virtual Host. Happy wordpressing! 😁.
Sometimes you need to install the program for real. I have described you before how to install WP with a docker, now I want to tell you how to install it without dockers. I’ve followed this guide from VULTR. It worked like a charm. For the records:
## > mysql Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 4 Server version: 5.5.68-MariaDB MariaDB Server Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]> create database myexample; Query OK, 1 row affected (0.00 sec) MariaDB [(none)]> CREATE USER 'user'@'localhost' IDENTIFIED BY 'XXXX'; Query OK, 0 rows affected (0.00 sec) MariaDB [(none)]> use myexample; Database changed MariaDB [myexample]> GRANT ALL PRIVILEGES ON myexample.* TO 'user'@'localhost'; Query OK, 0 rows affected (0.00 sec) MariaDB [myexample]> exit Bye ## > yum install -y http://rpms.remirepo.net/enterprise/remi-release-7.rpm ## > yum --enablerepo=remi-php74 install php php-bz2 \ php-mysql php-curl php-gd php-intl php-common \ php-mbstring php-xml ## > systemctl restart httpd ## > wget http://WordPress.org/latest.tar.gz ## > tar -xzvf latest.tar.gz ## > mv WordPress/* /var/www/html/ ## > chown -R apache.apache /var/www/html/
$ docker run --name my-wp --network some-network -d wordpress
The installer quickly appears on 0.0.0.0:8080, but we are asked for database to connect. I do have a database, but the idea is to reduce “coding” to the minimum, so I go for the next recipe, with a docker compose. With the small modification of my server IP (1.2.3.4) I take the sample yml from the official page but I save it as :
And after that I go to 1.2.3.4:8080 to start the installer. As we can read above, we now have two dockers, one for the database and one for the wordpress engine. Filling up the next details for the admin is trivial, and we end up with a page like the one above (template Twenty-Twenty-Two). New user creation is also working without issues. We’ll see if the client is happy with it also! 😉