So, You Want To Host Blogs on Your VPS?

Beware! Not all blogs are equal. Some can damage your web server and web sites!

On my VPS, I have set up this blog (the one you are reading) . I had some bad experiences trying to set up my first blog, with serious damage to the functioning of my webserver, so I am writing this post as a warning to others.

First of all, decide what type of blog you want, Wordpress is well-known, of course, but there are many others, which can be found through a search on the web. Some advertise themselves proudly as Content Management Systems (CMS). These will manage not only blogs but web sites as well. I avoided those, as I already manage my web sites and didn't need an extra layer of complexity.

When you have chosen your preferred blog, take a look at the installation type. There are basically two types:

  1. Blog software that makes structural changes to the way your VPS operates, such as installing Docker, or installing a web server different from the one you already use.
  2. "Application-level" blogs which install only php files and take advantage of your exisitng PHP and database installations, without needing to install any new system-level software.

My first choice of blog software required me to make system-level changes. I installed it but found the blog maintenance requirements far too confusing and complicated, so I uninstalled it. My second choice required to install nginx, whereas my existing web server was apache.  This completely broke my system such that all my web sites stopped working. How to repair an apache webserver seriously broken by the installation of nginx is the subject of a future blog post. Don't misunderstand me. I am not blaming nginx. I'm only saying, whichever web server you use, don't install a second, unless you are an expert!

I then switched to looking at application-level blogs, and chose dotclear Welcome › Dotclear › Blog management made easy ) which has excellent documentation, easy installation and, most importantly, makes use of PHP and the MySQL database already part of my standard installation. If you are interested in knowing how to installl PHP, MySQL and other system-level software, I have written two manuals, which describe in step-by-step detail how to install a secure web server and secure mail server on a Linux VPS. The manuals can be purchased at my author website: Unusual Mysteries - Cookbook  They are not expensive and will repay your investment of a small amount of cash in both time and trouble saved.

The only problem with dotclear is adapting it to host more than one blog. If that is what you need, I will tell you how to do it in a future post.

My steps for installing dotclear on Ubuntu with MySQLi and PHP8.1 are listed below. I have made one small adjustment to improve on the recommended default installation.

It is assumed in the instructions below that you have logged into your VPS with an SSH client (such as puTTy on Windows)

First check all required software supports are installed:

php -m | grep pcre

If you don't see the response "pcre", then do: sudo apt-get -y install php-pcre

Ensure all xml support by doing:  sudo apt-get -y install php8.1-xml

You make get a message saying this is already installed.

The dotclear documentation says that SPL support is needed, but this feature appears to be integral to PHP 8.1 and does not require special installation. Look at the ini file with: sudo vim /etc/php/8.1/apache2/php.ini (or use another editor, instead of vim) Search for the line: ;extension=spl  and if present enable it by deleting the prefixing semi-colon.

Do

sudo apt-get -y install php8.1-bcmath

and

sudo apt-get -y install php8.1-gmp

Look at the ini file with: sudo vim /etc/php/8.1/apache2/php.ini (or use another editor, instead of vim) Search for the line: ;extension=gmp  and if present enable it by deleting the prefixing semi-colon.

Then do: sudo apt-get install php8.1-gd

followed by sudo service apache2 restart to activate any newly installed PHP extensions.

Now you need to set up a database. This is as simple as creating it. The dotclear installation will do the rest:

sudo mysql -u root -p

Enter your mysql password (Warning: you may be asked for your sudo password first)

CREATE DATABASE dotclear;

exit;

Let's assume you have a website called MyWebSite and you want to host a blog entitiled MyBlog

Navigate to the directory where your top level index.html and other html files are and do: mkdir MyBlog then cd MyBlog

Download the dotclear installer with: sudo wget http://download.dotclear.org/latest.tar.gz

Then expand the archive with: sudo tar -xvzf latest.tar.gz

This is where I introduce a change from the standard installation. The archive gets expanded into a sub-directory entitled dotclear. This will mean the url for your blog will be https://mywebsiteurl/dotclear/MyBlog.  I think this looks clumsy. I want the url to be https://mywebsiteurl/MyBlog.

To fix the problem move the dotclear files up one directory with: sudo mv dotclear/* .

Note that the closing "." above is not a punctuation mark. It is needed in the command to indicate the current directory as the destination of the moved files!

Now loosen some permissions with:

sudo chmod a+w cache/

sudo chmod a+w inc/

sudo chmod a+w public/

In any browser, you can now do the equivalent of: 

https://mywebsiteurl/MyBlog/admin/install/index.php

and you will see the first configuration screen. The hostname will be localhost and the database name dotclear  You also need to enter your database username and password. On hitting Continue, you will be asked to create a user name and password for exclusive access to the dotclear configuration screens. After that, you will be taken to the multi-featured configuration options for your blog and can start to make posts. 

Access the configuration and blog editing screens with:

 https://mywebsiteurl/MyBlog/admin/index.php

That's it!

   

 

Add ping

Trackback URL : https://www.businessassistant.biz/the_vps_blog/index.php?trackback/3

Page top