LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-16-2014, 01:16 PM   #1
rodeored
LQ Newbie
 
Registered: May 2014
Posts: 12

Rep: Reputation: Disabled
Virtual host for ZoneMinder.


Hello
I am trying to set up a camera on my local network. I have Fedora release 20 (Heisenbug)
I built Zoneminder but I am stuck trying to understand #8 in the INSTALL file

In https://github.com/ZoneMinder/ZoneMi...master/INSTALL

"Create an apache virtual host for ZoneMinder. Make sure to use the same paths as ZM_WEBDIR and ZM_CGIDIR in /etc/zm.conf"

I'm not sure, but I think they are refering to setting up the server so that the Zoneminder web page can appear on the local host. http://localhost works, but there is no webpage for Zoneminder at http://localhost/zm/

My question is: How do I make a virtual host, especially for this particular situation? I have found examples, but they all vary in ways that I don't how to adjust for. For example
http://terminal28.com/how-to-install...x-cctv-debian/

It sets everything up in /etc/apache2/ which I don't have. Is that a standard installation location for all versions of linux?

Also, there is no ZM_WEBDIR and ZM_CGIDIR in /etc/zm.conf
but it does have ZM_PATH_WEB and ZM_PATH_CGI
 
Old 05-16-2014, 02:22 PM   #2
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware
Posts: 7,217

Rep: Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348
I believe Fedora uses /etc/httpd rather than /etc/apache2. Take a look at the fedora page below.

http://fedoraproject.org/wiki/Admini...e_Draft/Apache

Quote:
Make sure to use the same paths as ZM_WEBDIR and ZM_CGIDIR in /etc/zm.conf"
You should have a zm.conf file in the /etc/zm/ directory.


http://www.zoneminder.com/wiki/index...roubleshooting

The link below is specific to zoneminder on Fedora (18), don't know if that matters. Some of the problems you are having are related to the instructions being different for Fedora. I set up zoneminder on Ubuntu 12.04 recently and it works fine. Some minor setup problems as it was new to me.

http://www.zoneminder.com/wiki/index.php/Fedora

Quote:
but it does have ZM_PATH_WEB and ZM_PATH_CGI
That might be a change on a newer version. That is what I have in the zm.conf file also.

In my zm.conf file I have:
Quote:
Path to ZoneMinder web files
ZM_PATH_WEB=/usr/share/zoneminder
In that same directory, you should have an apache.conf or httpd.conf file. In mint I have the following:

Quote:
<Directory /usr/share/zoneminder>
The ZM_PATH_CGI I have in zm.conf is: /usr/lib/cgi-bin

Don't know if it will be the same on Fedora.

Last edited by yancek; 05-16-2014 at 03:44 PM.
 
Old 05-17-2014, 02:32 AM   #3
rodeored
LQ Newbie
 
Registered: May 2014
Posts: 12

Original Poster
Rep: Reputation: Disabled
Thank you for your reply. I've looked at those links until I'm blue in the face and I still haven't got the vaguest clue what I'm supposed to do.

First of all, can you confirm that "setting up a virtual host for Zoneminder" means setting up the server so that the Zoneminder web page can appear on the local host. http://localhost works, but there is no webpage for Zoneminder at http://localhost/zm/
So after I set up a virtual host, the content for Zoneminder will appear at http://localhost/zm/ Correct?

When you say :
Quote:
In that same directory, you should have an apache.conf or httpd.conf file.
I don't know what directory you are refering to. I have not yet found any httpd.conf file anywhere

zm.conf file is at /etc/zm.conf
It says:

# Path to ZoneMinder web files
ZM_PATH_WEB=/usr/local/share/zoneminder/www

# Path to ZoneMinder cgi files
ZM_PATH_CGI=/usr/local/libexec/zoneminder/cgi-bin

My apache conf.d is at /etc/httpd/conf.d

What specifically do I need to do to set up a virtual host? I have a vague idea that it involves opening or creating some kind of configuration file but I don't know which file or what to put into it.

Last edited by rodeored; 05-17-2014 at 03:11 AM.
 
Old 05-17-2014, 08:55 AM   #4
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware
Posts: 7,217

Rep: Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348
If you have a directory /etc/httpd then you have Apache installed. The main configuration file is usually httpd.conf which should be there somewhere. I don't use Fedora so can't really say what they use. Checked the Fedora site and it should be: /etc/httpd/conf/httpd.conf

Quote:
So after I set up a virtual host, the content for Zoneminder will appear at http://localhost/zm/ Correct?
Yes. I did not do anything specific to this when I installed zoneminder. There was an apache.conf file in the /etc/zm directory created during the zoneminder setup.

On my install (NOT Fedora) there is an /etc/zm directory and there are configuration files for both zoneminder and apache. I would think you would need a specific Apache config file dealing with zoneminder. The paths you list in the zm.conf are different than mine but that might be because you are using Fedora and I used Ubuntu.

Did you have LAMP installed prior to installing zoneminder? You have the L (fedora) and the A (apache) so do you have mysql(MariaDB) and php installed? If not the link below explains it on Fedora. You need mysql and php installed before zoneminder. If you've already done that, just ignore the link:

http://www.unixmen.com/install-lamp-...-on-fedora-19/

If you do have LAMP, post back and let me know.

Last edited by yancek; 05-17-2014 at 08:57 AM.
 
Old 05-17-2014, 10:33 AM   #5
rodeored
LQ Newbie
 
Registered: May 2014
Posts: 12

Original Poster
Rep: Reputation: Disabled
I have LAMP. http://localhost is working. The zm database is working. I do have a file at /etc/httpd/conf/httpd.conf

However I don't think Fedora even uses httpd.conf
My zoneminder is not even running, so I need to backup and figure out another approach. I may just switch to unbuntu.
I did find this helpful page about apache configuration files on fedora
http://articles.slicehost.com/2010/5...iles-on-fedora
Thanks for the tips.

Last edited by rodeored; 05-18-2014 at 10:15 PM.
 
Old 05-17-2014, 01:58 PM   #6
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware
Posts: 7,217

Rep: Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348
Quote:
My zoneminder is not even running
According to the Fedora page you start it with: systemctl start zoneminder.service

Part of the problem is the second link you posted in your initial post was specific to Debian and that might be the cause of a lot of the problems.
 
Old 05-17-2014, 04:12 PM   #7
rodeored
LQ Newbie
 
Registered: May 2014
Posts: 12

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by yancek View Post
According to the Fedora page you start it with: systemctl start zoneminder.service


Part of the problem is the second link you posted in your initial post was specific to Debian and that might be the cause of a lot of the problems.
[root@localhost ZoneMinder-1.27.0]# systemctl start zoneminder.service
Failed to issue method call: Unit zoneminder.service failed to load: No such file or directory.
I have absolutely no idea what that means. I compiled zoneminder, I ran cmake and make install. What am I missing?

I haven't used anything from that other page because I couldn't figure out how.

Last edited by rodeored; 05-17-2014 at 04:13 PM.
 
Old 05-17-2014, 06:55 PM   #8
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware
Posts: 7,217

Rep: Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348
Quote:
Failed to issue method call: Unit zoneminder.service failed to load: No such file or directory.
It is not configured properly. I'm not sure why you used the method you did, from the link you originally posted. With most major Linux distributions, you should install with the package manager or Software Center. On Debian and Ubuntu derivatives, you would use the "apt-get intall" command. On Fedora, you would use "yum". If you look at the link below which is similar to one I posted earlier, you will see:

Quote:
ZoneMinder is developed on the Fedora distribution and no special actions are usually required for installation.
Some differences between Fedora and Debian/Ubuntu:

Quote:
However there are some services that need to be enabled e.g. mysql, http as they are not by default when a Fedora system is set up. Do note Debian or Ubuntu have these running as default when installed.
So if you use Debian/Ubuntu, you won't need to manually start the services listed above, on Fedora you will.

The link to the page I am referring to. The grey boxes are commands which need to be entered in a terminal and you hit the Enter key and watch the output. The one box with multiple lines, those are each individual commands and you will need to hit the Enter key after each. Most of them won't apply as you already have apache, not sure if you have mysql or MariaDB configured or installed?

http://gfmediasoft.info/content/zone...edora-19-above

I would read the page a few times to get familiar with it. I expect you would have had fewer problems if you had installed using the yum package manager. If you want to remove zoneminder and start over with it you should be able to use yum to do that also:

yum remove zoneminder (You may need the version number included in the command)
 
Old 05-17-2014, 07:33 PM   #9
rodeored
LQ Newbie
 
Registered: May 2014
Posts: 12

Original Poster
Rep: Reputation: Disabled
I originally did install it with the yum package manager. I got all the services running, including Zoneminder, but there was no picture. I tried every possible setting that I could possibly imagine. My camera works fine in vlc.

I have not used anything from this link. I just thought it might have something pertinent about seeing up a virtual host but I never used anything.
http://terminal28.com/how-to-install...x-cctv-debian/

If you mean why did I build and install from the install file that cam with the build, I did that so I could build Zoneminder with vlc, so that the vlc option would be available in the zoneminder settings.
 
Old 05-17-2014, 10:34 PM   #10
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware
Posts: 7,217

Rep: Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348
Here are a couple of things I had to do to get it working. I added www-data to the video group. This won't work in Fedora, see below. You need to add apache to the video group.

Quote:
By default, the httpd daemon runs as the user and group apache. Therefore, all files that the httpd needs to access to operate properly must be accessible by user apache
I changed the owner:group of /dev/video to www-data so you may need to change that to apache:apache. If you make either of these changes you will need to restart apache. Also, to have mysql start before zoneminder (which is necessary) add this: sleep 15 to the /etc/init.d/zoneminder file. It needs to be on the line just abovethe line: zmfix -a It is near the top of the file. I don't know if Fedora uses init.d, it may be another directory but there should be a zoneminder file somewhere. Check the Fedora link below:

http://docs.fedoraproject.org/en-US/...-run-boot.html

I also linked apache to zoneminder with the command below. You will have to change that to point to the correct zoneminder.conf file as there is no apache2 directory. If you don't have a zm directory in /etc, it won't work.

ln -s /etc/zm/apache.conf /etc/apache2/conf.d/zoneminder.conf

Do you get the same result when you enter your machine ip address instead of localhost/zm?
 
Old 05-19-2014, 08:51 AM   #11
rodeored
LQ Newbie
 
Registered: May 2014
Posts: 12

Original Poster
Rep: Reputation: Disabled
I did get the zoneminder-apache connection to work by starting over with the package instead of building it myself
Now I'm running into another problem.
I'm using Fedora 20
The zoneminder service is running, the monitor is set up but not getting any images.
I'm getting this error
Can't open memory map file /dev/shm/zm.mmap.2:No such file or directory.

What would cause this error? I did this on a newly installed Fedora 20 system, so why would this happen?
What usually happens to make that file?
 
Old 05-19-2014, 09:54 AM   #12
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware
Posts: 7,217

Rep: Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348
Quote:
Can't open memory map file /dev/shm/zm.mmap.2:No such file or directory.
What would cause this error?
Not having that file. I have that file on my system so I don't know why you would not. The site below gives an explanation and possible solution of the "Can't open memory map file...", scroll about half way down the page.

http://www.zeth.net/2012/12/30/zonem...on_ubuntu.html

The FAQ at Zoneminder below gives an explanation which I think would apply although the error is not exactly the same. It is a problem with shared memory and resolution settings. I'm using a little Acer notebook and the Capture settings are: 320x240. The quote below is from the link I post below. I would open zoneminder and click on /dev/video0 and in the new window which opens, click the Source tab and then change the Capture Width/Height to 320/240 and restart zoneminder. If you get images, then you can follow the link below to increase max shared memory. Not sure why you don't have the zm.mmap.2 file or why it has a '2' at the end, mine has a 1?

Quote:
In recent kernels the shmmax is set to 33554432 bytes for only 32 MB of maximum shared memory allocatable at a time, hardly enough for ZoneMinder to go above 320 x 240 x 24-bit
http://www.zoneminder.com/wiki/index...er_resolutions.
 
Old 05-20-2014, 08:36 AM   #13
rodeored
LQ Newbie
 
Registered: May 2014
Posts: 12

Original Poster
Rep: Reputation: Disabled
This only happens with certain settings. I did manage to get it working via http/jpeg settings

Last edited by rodeored; 05-20-2014 at 09:08 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Ping to Honeyd virtual host replying Destination Host Unreachable Doejohn Linux - Networking 1 05-18-2014 03:43 AM
Virtual host inside Virtual Host, apache2 pinguim007 Linux - Server 1 08-22-2013 02:49 AM
[SOLVED] Ping from Vmware host to Virtual Box host greatcyrus Linux - Virtualization and Cloud 7 03-09-2011 02:03 AM
debian lenny - all virtual hosts lead to first virtual host rantastic Linux - Server 2 04-21-2010 09:32 PM
[SOLVED] Apache2 - virtual host defaulting to default host slimjim Linux - Server 1 10-31-2009 01:47 AM


All times are GMT -5. The time now is 01:04 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration