CentOS 7 installation trouble - help please

Forum for questions and support relating to the 1.30.x releases only.
Locked
ScottBouch
Posts: 43
Joined: Sat Oct 26, 2013 2:58 pm

CentOS 7 installation trouble - help please

Post by ScottBouch »

Hmm... Having trouble.. following the ZMREPRO method... I'm sure remember apt-get just simply working out of the box on Ubuntu...? I'm new to CentOS.

Please bear in mind that this is a vanilla fresh install of CentOS 7 Minimal iso (maybe I should have used the Full iso?). I have only installed PLEX Media Server on this machine before this ZM install attempt.

I'm reading the README.Redhat file, but am left with more questions than answers... I've highlighted in bold the parts of the readme file that relate to my questions below:

What's New
==========

1. The Apache ScriptAlias has been changed from "/cgi-bin/zm/zms" to
"/cgi-bin-zm/zms". This has been to done to avoid this bug:
https://bugzilla.redhat.com/show_bug.cgi?id=973067

IMPORTANT: You must manually verify the value of PATH_ZMS under Options.
Make sure it is set to "/cgi-bin-zm/nph-zms". Failure to do so will result
in a broken system. You have been warned.

  • Starting at "/", where should I find the folder /cgi-bin/ or /cgi-bin-zm/ to check?
  • Starting at "/", where should I find the Options to check /cgi-bin-zm/nph-zms?
-

2. Due to the active state of the ZoneMinder project, we now recommend granting
ALL permission to the ZoneMinder mysql account. This change must be done
manually before ZoneMinder will run. See the installation steps below.

  • Do I need to install MySQL separately? should this be installed as part of the ZMREPRO install?
-

1. Unless you are already using MariaDB server, you need to ensure that the
server is configured to start during boot and properly secured by running:

sudo dnf install mariadb-server
sudo systemctl enable mariadb
sudo systemctl start mariadb.service
mysql_secure_installation


So I tried this, and got:

Code: Select all

$ sudo dnf install mariadb-server
[sudo] password for xxxx: 
sudo: dnf: command not found
So it would appear my vanilla install of CentOS does not include DNF, so I'll installed mariadb-server with YUM instead. Enabeld, and Started ok... however.....

Code: Select all

$ mysql_secure_installation
touch: cannot touch ‘.my.cnf.4716’: Permission denied
touch: cannot touch ‘.mysql.4716’: Permission denied
chmod: cannot access ‘.my.cnf.4716’: No such file or directory
chmod: cannot access ‘.mysql.4716’: No such file or directory

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
password for the root user.  If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none): 
Entered Root password, then:

Code: Select all

/usr/bin/mysql_secure_installation: line 232: .my.cnf.4716: Permission denied
/usr/bin/mysql_secure_installation: line 233: .my.cnf.4716: Permission denied
/usr/bin/mysql_secure_installation: line 234: .my.cnf.4716: Permission denied
/usr/bin/mysql_secure_installation: line 236: .my.cnf.4716: Permission denied
/usr/bin/mysql_secure_installation: line 205: .mysql.4716: Permission denied
/usr/bin/mysql_secure_installation: line 207: .mysql.4716: No such file or directory
Enter current password for root (enter for none): 
And this goes on....

At this point, I'm giving up in the hope that someone swings by ad says: "Hey, I see what you're doing wrong",
OR preferably says: "here's a much easier out-of-the-box installation method, with less configuration needed.... it starts with yum..."

Cheers, Scott.
bbunge
Posts: 2951
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: CentOS 7 installation trouble - help please

Post by bbunge »

User avatar
knight-of-ni
Posts: 2404
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: CentOS 7 installation trouble - help please

Post by knight-of-ni »

ScottBouch wrote: Thu Jun 29, 2017 9:50 pm

Code: Select all

$ sudo dnf install mariadb-server
Documentation has been fixed upstream to reflect yum instead of dnf and will appear in the next package.
ScottBouch wrote: Thu Jun 29, 2017 9:50 pm

Code: Select all

$ mysql_secure_installation
touch: cannot touch ‘.my.cnf.4716’: Permission denied
touch: cannot touch ‘.mysql.4716’: Permission denied
chmod: cannot access ‘.my.cnf.4716’: No such file or directory
chmod: cannot access ‘.mysql.4716’: No such file or directory
Try this instead, then report back your results:

Code: Select all

sudo mysql_secure_installation
The mysql_secure_installation binary is not unique to redhat. It ships with installations of mysql & mariadb on many distros, including ubuntu. What seems to have changed is the requirement that the tool must be run as root.
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/
ScottBouch
Posts: 43
Joined: Sat Oct 26, 2013 2:58 pm

Re: CentOS 7 installation trouble - help please

Post by ScottBouch »

Brilliant, thank you... Last night I was tired and had had enough, should have thought about sudo.. duhh..

I got through all the "New Installs" steps, and ignored the "Upgrades" steps. All seemed to go through successfully, no warnings thrown up. However....

My server IP address is 192.168.1.220, however when I visit 192.168.1.220/zm I get from Opera:

This site can’t be reached
http://192.168.1.220/zm is unreachable.


And similar results from Firefox.

When I just visit the IP address, I don't get the Apache welcome page, but I have not installed Apache, just assumed it would have arrived as part of the ZM or PLEX installs...? Is installing Apache a prerequisite? Should this installation be on a CentOS LAMP server? I have not installed Apache or PHP; but MySQL arrived as part of this installation task.

Are there any log files I should check for errors?
Is there a way of checking the right user permissions are set? would it make any difference?

-> I also now can no longer access PLEX which was working nicely before I started installing ZM.

But plex gives a different response in Opera:
This page isn’t working
192.168.1.220 didn’t send any data.


Any ideas?

Thanks, Scott
User avatar
knight-of-ni
Posts: 2404
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: CentOS 7 installation trouble - help please

Post by knight-of-ni »

Just like Windows (can't believe I just said that), Redhat distros ship with the firewall turned on. I'm actually a bit surprised others distros ship with their firewall off.

CentOS7 uses firewalld. You need to open ports 80 & 443. Firewalld is fairly new, and I don't recall the command to open ports offhand. I do know that Google will take you right to multiple blogs which can assist you.

Alternatively, you can turn the firewall off by stopping the service:

Code: Select all

sudo systemctl stop firewalld
and prevent it from starting at boot:

Code: Select all

sudo systemctl disable fierwalld
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/
ScottBouch
Posts: 43
Joined: Sat Oct 26, 2013 2:58 pm

Re: CentOS 7 installation trouble - help please

Post by ScottBouch »

Bingo!

Disable the firewall and ZM is up and running! Thanks!!!

I'l look into allowing ports 80 and 443, now you mention it, I do recall doing this before many moons ago..

PS: love the Python avatar!

Cheers, Scott
bbunge
Posts: 2951
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: CentOS 7 installation trouble - help please

Post by bbunge »

firewall-cmd --set-default-zone=public
firewall-cmd --permanent --zone=public --add-service=http
firewall-cmd --permanent --zone=public --add-service=https
firewall-cmd --reload
Locked