2 Scripts to Install LHMP and ZoneMinder on Bionic64

Configuration wizards, scanners, remote desktop, etc.
Message
Author
User avatar
rockedge
Posts: 1864
Joined: Wed 11 Apr 2012, 13:32
Location: Connecticut, United States
Contact:

2 Scripts to Install LHMP and ZoneMinder on Bionic64

#1 Post by rockedge »

Here are 2 scripts that will install a LHMP server and Zonemnder using the Pkg package manager on a fresh Bionic64.

to use set up and boot Bionic64 and create a save folder/flie with a reboot.
Load the 32 bit compatibility libraries and most important the devx sfs

Once both SFS packages are loaded, place the scripts
01-install-maria.sh
02-install-zm.sh

into a folder like /root/my-applications. Make sure both are executable.
Open a terminal in /root/my-applications and start 01-install-maria.sh.

Upon a successful completion start 02-install-zm.sh.
if it all completes in the terminal type:

Code: Select all

hiawatha
zmpkg.pl start
and if that looks like it worked open the browser and use the url
http://localhost, there should be a directory index.
now try http://localhost/zm and there should be a statement page, scroll to the bottom and save to start ZoneMinder.

goto Options and set the correct time ! default is UTC.( the date and time must be correct in the php.ini and match the system clock if done manually )

Documentation for ZM and each component like Hiawatha 10, mariadb and PHP7 are available online

the scripts can be used as a step by step recipe.

This script is experimental and use at your own risk.

Good Luck!

Remove the fake .gz
Attachments
01-install-maria.sh.gz
(843 Bytes) Downloaded 172 times
02-install-zm.sh.gz
(76.46 KiB) Downloaded 159 times
Last edited by rockedge on Thu 30 Jan 2020, 16:14, edited 1 time in total.

User avatar
rockedge
Posts: 1864
Joined: Wed 11 Apr 2012, 13:32
Location: Connecticut, United States
Contact:

#2 Post by rockedge »

Controls are :
Start / Stop / Restart the Hiawatha v10.10 web server

Code: Select all

hiawatha
killall hiawatha
or

Code: Select all

/etc/init.d/hiawatha [start | stop | restart | status]
Start / Stop the mysql server

Code: Select all

killall mysqld
mysqld &
Start / Stop / Restart zoneminder
zmpkg.pl start
zmpkg.pl stop
zmpkg.pl restart
zmpkg.pl status

Default user and password for zoneminder

Code: Select all

user = admin
passwd = admin
user, password for the mysql server is

Code: Select all

user = root
passwd = admin 
zoneminder is using the default user www-data and the hiawatha server is running as www-data.

This will break running pplog (the personal blog) from the menu.
to restore the use of pplog the hiawatha and ZM user need to match the owner of /root/Web-Server, which is "webuser:webgroup".


This can be achieved by stopping ZM and hiawatha then open and modifying /etc/hiawatha/hiawatha.conf and change

Code: Select all

ServerId = www-data
to

Code: Select all

ServerId = webuser
Then open /etc/zm/conf.d/zmcustom.conf
add the lines ->

Code: Select all

ZM_WEB_USER=webuser
ZM_WEB_GROUP=webgroup

qxotic
Posts: 27
Joined: Sun 26 Jan 2020, 00:51

gz format?

#3 Post by qxotic »

I downloaded the files, clicked on them to unzip (something flashed too quick to see) then I noticed the filename was unchanged in Downloads folder. I did a gunzip command on them in terminal and it said they were not in gzip format.

Are they already unzipped and just need renamed to end in .sh?

Thank you.

User avatar
rockedge
Posts: 1864
Joined: Wed 11 Apr 2012, 13:32
Location: Connecticut, United States
Contact:

#4 Post by rockedge »

Rename and remove the "gz". It is fake so it can be attached to the forum post. Then give them permission to execute.

the names should be

Code: Select all

 	01-install-maria.sh. 
 	02-install-zm.sh

qxotic
Posts: 27
Joined: Sun 26 Jan 2020, 00:51

Errors

#5 Post by qxotic »

Here is my result in the browser after running 01 and 02:

Warning: error_log(/var/log/zm/web_php.log): failed to open stream: Permission denied in /usr/share/zoneminder/www/includes/logger.php on line 397

Fatal error: Can't write to log file '/var/log/zm/web_php.log': error_log(/var/log/zm/web_php.log): failed to open stream: Permission denied @ /usr/share/zoneminder/www/includes/logger.php/397 in /usr/share/zoneminder/www/includes/logger.php on line 400

Should I track them down and set 777 on them?

User avatar
rockedge
Posts: 1864
Joined: Wed 11 Apr 2012, 13:32
Location: Connecticut, United States
Contact:

#6 Post by rockedge »

I am testing right now. the link to Hiawatha has changed so that failed
I will be looking to see what other errors show up

yes make sure the permissions are correct

I'll follow up once my tests are done!

User avatar
jplt3
Posts: 118
Joined: Mon 08 Apr 2019, 20:40
Location: Planet Earth

#7 Post by jplt3 »

hello ,

sorry for the basic question but what is LHMP ? and ZoneMinder ?
JpLt

User avatar
rockedge
Posts: 1864
Joined: Wed 11 Apr 2012, 13:32
Location: Connecticut, United States
Contact:

#8 Post by rockedge »

Hello jplt3

A LHMP or LAMP are short for a type of web server set up that includes:

LHMP = Linux, Hiawatha. Mysql. PHP
LAMP = Linux, Apache, Mysql, PHP

ZoneMinder is a state-of-the-art video surveillance software system and network video recorder. For home or commercial use that can handle 100's of cameras or just one local webcam.

More here: -> https://zoneminder.com/

**

User avatar
rockedge
Posts: 1864
Joined: Wed 11 Apr 2012, 13:32
Location: Connecticut, United States
Contact:

#9 Post by rockedge »

Fatal error: Can't write to log file '/var/log/zm/web_php.log': error_log(/var/log/zm/web_php.log): failed to open stream: Permission denied @ /usr/share/zoneminder/www/includes/logger.php/397 in /usr/share/zoneminder/www/includes/logger.php on line 400
here is the fix ->

Code: Select all

chown -R www-data:www-data var/log/zm
There was a name change so The link for the Hiawatha package is now ->
http://files.tuxhelp.org/hiawatha/hiawa ... _amd64.deb

I had some trouble with the mysql database installation which needs to be looked into


**

qxotic
Posts: 27
Joined: Sun 26 Jan 2020, 00:51

mysql

#10 Post by qxotic »

I think I may be having the same trouble. The ownership change lets me enter hiawatha without any errors now. When I enter mysqld & it does a few things then hangs (just flashing cursor) after it says ..ready for connections. Version.... socket: '/var/run/mysqld/mysqld.sock' port: 3306 Ubuntu 18.04

User avatar
rockedge
Posts: 1864
Joined: Wed 11 Apr 2012, 13:32
Location: Connecticut, United States
Contact:

#11 Post by rockedge »

You're having good luck.....

Code: Select all

socket: '/var/run/mysqld/mysqld.sock' port: 3306 Ubuntu 18.04
means it's working.....just close the terminal or when you start mysqld use

Code: Select all

mysqld &
then you can hit enter and the command prompt will come up again.

can you use this successfully?

Code: Select all

zmpkg.pl start
can you open a browser and enter the url "http://localhost/zm"
what happens?. If there are any connection problems we will go step by step to add the mysql commands to get it going

**

User avatar
rockedge
Posts: 1864
Joined: Wed 11 Apr 2012, 13:32
Location: Connecticut, United States
Contact:

#12 Post by rockedge »

start/stop Commands for the servers:
Hiawatha

Code: Select all

Hiawatha
killall hiawatha
or

Code: Select all

/etc/init.d/hiawatha start|stop|restart|status
mysql

Code: Select all

mysqld &
killall mysqld
there are some fixes needed in the /etc/init.d/mysql to make it work, which I will detail later on.

ZoneMinder

Code: Select all

zmpkg.pl start|stop|restart|status
or control zoneminder from the web gui

**

qxotic
Posts: 27
Joined: Sun 26 Jan 2020, 00:51

Lost ground

#13 Post by qxotic »

Not sure why.. but I after I did a reboot... and I enter hiawatha I get "Error binding 0.0.0.0:80" .. had that earlier, but something I did made it go away.. now it's back.

Also.. in verifying permissions - Web-Server has messagebus as group and doing chown webuser:webgroup or just chgrp to webgroup on it does not let me change it.. it keeps the messagebus group.

qxotic
Posts: 27
Joined: Sun 26 Jan 2020, 00:51

Cont'd

#14 Post by qxotic »

I think the hiawatha error may be just because it was already running?
If I do a killall on it, then just hiawatha I don't get an error running it after the killall.

When I enter zmpkg.pl start I get -
WARNING ZoneMinder configuratin fiel found but is not readable. Check permissions on /etc/zm/zm.conf

the ownership is www-data and permission was 600.. changed to 760 but same result.
Other info - DBI connect... failed: Access denied for user 'webuser'@'localhost' (using password: NO)

I get 404 not found on the webpage

Is there a way to copy and paste text from the terminal in puppy? I'm not getting the option when I right click.

EDITED to add.... copy text as normal with ctrl + c.... in terminal use shift + insert, or middle mouse button, or both mouse buttons at the same time to paste.
Last edited by qxotic on Wed 12 Feb 2020, 15:09, edited 1 time in total.

B.K. Johnson
Posts: 807
Joined: Mon 12 Oct 2009, 17:11

#15 Post by B.K. Johnson »

@rockedge
Will the instructions hold true for 32bit if compatibility libs are excluded and the right devx used?
Thanks
[color=blue]B.K. Johnson
tahrpup-6.0.5 PAE (upgraded from 6.0 =>6.0.2=>6.0.3=>6.0.5 via quickpet/PPM=Not installed); slacko-5.7 occasionally. Frugal install, pupsave file, multi OS flashdrive, FAT32 , SYSLINUX boot, CPU-Dual E2140, 4GB RAM[/color]

qxotic
Posts: 27
Joined: Sun 26 Jan 2020, 00:51

Cont'd - progress

#16 Post by qxotic »

I went to each error file/location.. and gave them 777 permissions. One file a zmdc.log did not exist... I did a touch to create it and gave it 777... those steps have gotten rid of all errors when I run zmpkg.pl now I get three lines
first line Sanity checkign States table...
Second line Command: start
Third - Single server configuration detected. Starting up services

I still only have 404 not found when I got to http://localhost/zm/

User avatar
rockedge
Posts: 1864
Joined: Wed 11 Apr 2012, 13:32
Location: Connecticut, United States
Contact:

#17 Post by rockedge »

Hello B.K. Johnson,

Yes you can use it like a recipe or run it as is in 32 bit or 64 bit.
Replace the hiawatha .deb link in the second script to:

Code: Select all

wget https://files.tuxhelp.org/hiawatha/hiawatha_10.10-1_i386.deb
and of course use the devx for your OS.

I have some 32 bit Bionic's that run ZM very well.
Last edited by rockedge on Wed 29 Jan 2020, 18:48, edited 1 time in total.

User avatar
rockedge
Posts: 1864
Joined: Wed 11 Apr 2012, 13:32
Location: Connecticut, United States
Contact:

#18 Post by rockedge »

Hello qxotic

open up the scripts in geany and look at them carefully and make sure each step was done.
the hiawatha server will start at each boot of the system unless you specify it doesn't so the bind error means Hiawatha is already running.

check the hiawatha conf file that it is correct in /etc/hiawatha
check that /etc/zm and all the other directories have the correct permissions, this you will see in the install scripts once opened up in geany.

otherwise it might be good to start over fresh, but will see. It sounds like nyou are close to having it going


**

qxotic
Posts: 27
Joined: Sun 26 Jan 2020, 00:51

#19 Post by qxotic »

I removed the pet packages for zoneminder, PHP, mariadb adn hiawatha I could recoginize and re-ran your .sh files and watched them closely for troubles. I did not notice any on the 01 file. The 02 file I saw some errors..
The name 'bionic-oconnor' is not a valid repo name

Download zoneminder from repo:
Error: Package URL not found
Can't find zoneminder_1.34.0~20200120113610-bionic or not a valid pkg..
Can't create database zm; database exists
failed to open file zm_create.sql

User avatar
rockedge
Posts: 1864
Joined: Wed 11 Apr 2012, 13:32
Location: Connecticut, United States
Contact:

#20 Post by rockedge »

there will be stuff left dangling even after you uninstall the packages.
best would to back up your save folder / file and copy it somewhere and remove it from the Bionic64 directory and or use advance boot menu and boot the OS straight into RAM and reboot and create a new save folder so you can start fresh. There are pieces of the whole install all over the place and would be difficult to explain in detail what you need to remove. So a completely fresh start would be recommended.

You were really close to having it running. Start fresh fresh and make sure the wget link in the script is up to date with the correct name for the Hiawatha .deb file download.

let the first script run and test with

Code: Select all

mysql -uroot -padmin
you should see a response simlar to this :

Code: Select all

mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.5.5-10.1.43-MariaDB-0ubuntu0.18.04.1 Ubuntu 18.04

Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>
if so use ctrl - d key combo to exit the mysql command line.
Run the second script.

**

Post Reply