Monday, July 12, 2021

Java 16 install (manual) on Ubuntu or Linux w/Azul

 This article was a lifesaver for me when trying to upgrade the Java version for my kid's Minecraft server.  Seems the latest Minecraft Server 1.17.1, requires Java 16 which requires a little finagling on my Ubuntu VM.

All credit goes to https://docs.azul.com/core/zulu-openjdk/install/debian

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';



Thursday, January 14, 2021

Ubuntu 18.04 - Headless Black Screen Fix (VNC or Teamviewer)

I found that when running Ubuntu 18.04 headless, I was presented with a black screen.  This occurred with VNV and Teamviewer.  

Untested Solution - One post stated that you could simply add a VGA adapter/dongle to the video output and it would "trick" the device into thinking a monitor was installed and start up the video/GUI.  I opted for the solution below and it worked beautifully.


Tried, Tested & Validated Solution (at least on my device)

Install Video Dummy Package

  1. SSH into the system
    1. If you didn't get sshd setup already, then hook up a monitor and get it setup. Could just do the fix while connected direct or remote using CLI.
  2. Install xserver-xorg-video-dummy
    sudo apt-get install xserver-xorg-video-dummy
    


Create Default X Windows Configuration File

  1. Create / Edit xorg.conf file
    1. Rename the file if already exists for backup 
      • Note:  I did not have this file and thus just created it.

  1. sudo vi /usr/share/X11/xorg.conf.d/xorg.conf
    
  2. Add the following content to the file
    1. Set the resolution to what you like (whatever resolution the screen is that is used to connect remotely is probably is a good idea)
      • I found the resolution 1920x1080 to be adequate...but that's just me.
    Section "Device"
        Identifier  "Configured Video Device"
        Driver      "dummy"
    EndSection
    
    Section "Monitor"
        Identifier  "Configured Monitor"
        HorizSync 31.5-48.5
        VertRefresh 50-70
    EndSection
    
    Section "Screen"
        Identifier  "Default Screen"
        Monitor     "Configured Monitor"
        Device      "Configured Video Device"
        DefaultDepth 24
        SubSection "Display"
        Depth 24
        Modes "1920x1080"
        EndSubSection
    EndSection
    
  3. Save the file