Showing posts with label Apache. Show all posts
Showing posts with label Apache. Show all posts

Sunday, March 28, 2021

Ubuntu 20.04 - LAMP Server (DigitalOcean), Apache 2.4, MySql 8, PHP 7.4.3 & WordPress 5.7

Overview - I installed a new Ubuntu marketplace instance on DigitalOcean that was designed for a 1-click install of a full LAMP server.  The system was up minutes later, however, the configuration became a bit more complicated than I had experienced just a day previous with Debian, its MySQL variant, and PHP 7.4.

Due to experiencing multiple issues I wanted to document what I experienced for historical sake.  

MySQL syntax for user creation and database permissions (GRANT) in version 8 are different.  For someone who is a DBA or hardcore MySQL user, this likely wouldn't be an issue, but it took more than an hour of googling to find the correct information, which turned out to be several issues.  Much of what I found was partially accurate creating greater confusion but in the end, I found syntax that worked correctly.

  • Make sure you create the user and its accompanying password, then Grant access to a given database.  Previously I had done this in one long command. Also, for some reason, I was not able to use 'localhost' and needed to use '%'.  And when trying to "grant privileges", I received this error "ERROR 1410 (42000): You are not allowed to create a user with GRANT"
    • Example Solutions

      • create user 'mysqluser'@'%' identified with caching_sha2_password by 'asecurepassword';
      • grant all privileges on database.* to 'mysqluser'@'%';

  • PHP & MySQL - I believe this next issue has to do with the version of PHP you are running and what authentication method is enabled.  I know there are various articles that speak to how and why etc, but I COULD NOT get my new database user accounts to connect and in the end, this MySQL command resolved my issues and allowed my WordPress user account to connect and one for phpmyadmin.
      • alter user 'mysqluser'@'%' identified with mysql_native_password by 'asecurepassword';


NOTE:  I believe the MySQL "alter" command above would assist someone experiencing similar issues following a MySQL upgrade from a version prior to 8.  

1/14/2023 

Ran into issues with "grant" commands.   
ERROR 1410 (42000): You are not allowed to create a user with GRANT

The following syntax corrected my issues.

CREATE USER 'user'@'localhost' IDENTIFIED WITH mysql_native_password BY 'superSecretPassword!123';
GRANT ALL ON `database`.* TO 'user'@'localhost';



Tuesday, August 18, 2015

Hobbit System Montoring | Debian

Hobbit monitors your hosts, your network services, and anything else you configure it to do via extensions. Hobbit can periodically generate requests to network services - http, ftp, smtp and so on - and record if the service is responding as expected. You can also monitor local disk utilisation, logfiles and processes through the use of agents installed on the servers.
Before you install, make sure you have Apache web server installed.


apt-get install apache2

Configure /etc/apach2/sites-enabled/000-default

Example: Apache conf here.


Install hobbit packages

apt-get install hobbit hobbit-client hobbit-plugins


By default hobbit only allows connections from local host. Append the IP addresses you want to allow here in all three of the Allow from[...] lines like shown here

vi /etc/apache2/conf.d/hobbit

Allow from localhost ::1/128 192.168.0.5


In this case I have added the 192.168.0.5 but you should replace it to the one on your computer

Restart apache

/etc/init.d/apache2 restart


Now you can access the hobbit monitoring console on this location http://youservername/hobbit/ (Make sure you include the trailing slash)

Client Install

apt-get install hobbit-client hobbit-plugins

Server Configuration for Client Data

vi /etc/hobbit/bb-hosts

Example bb-hosts:


Note:  Be sure to use the fully qualified name of the server along with the IP Address.  If you do not, you will not get all or any of the information desired.

If desired, you may use the local configuration file to monitor more finitely.   This also requires adding "--local" setting to FILENAMEHERE.  I found that in Ver. 4.2.0 if you must copy the hobbitd_client file from the "hobbit-server".