Apache2 config with 1.22. Ho do I fix setup prob?

Support and queries relating to all previous versions of ZoneMinder
Locked
Mark Ward
Posts: 51
Joined: Thu May 11, 2006 11:28 am
Location: Kent, UK.

Apache2 config with 1.22. Ho do I fix setup prob?

Post by Mark Ward »

I've recently installed 1.22 (my first install) on Suse10. I chose this version of Linux due to the precise step-by-step guide in the "Hints & Tips" section of these forums.

I didn't undertsand what I was doing at all, but seemed to get ZM up & running by following those instructions to the letter.

I've been having problems getting jpg or mpg images to display, in fact I've yet to achieve any image that I'm aware of. Doing lots of searching of these forums I've identified quite a few places to look for problems and I now think I've found what may be the main problem.

One step on the guide reads:-
Now Configuration Time !

./configure --with-webdir=/srv/www/htdocs/ --with-cgidir=/srv/www/cgi-bin/ --with-webgroup=www --with-webuser=wwwrun ZM_DB_HOST=localhost ZM_DB_NAME=zm ZM_DB_USER=zm ZM_DB_PASS=zm --with-libarch=lib64Code:
Now I spotted that I was using a 32-Bit version so I changed the 64 to 32, but should the "srv" have been "svr"?

The reason I ask is that my Apache2 error log at /var/log/apache2/error_log shows
Sun May 21 12:08:02 2006] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec2)
[Sun May 21 12:08:06 2006] [notice] Apache/2.0.54 (Linux/SUSE) configured -- resuming normal operations
[Sun May 21 12:45:08 2006] [error] [client 127.0.0.1] script not found or unable to stat: /srv/www/cgi-bin/nph-zms, referer: http://localhost/zm.php?view=watchfeed& ... 0&control=
[Sun May 21 12:45:15 2006] [error] [client 127.0.0.1] script not found or unable to stat: /srv/www/cgi-bin/nph-zms, referer: http://localhost/zm.php?view=watchfeed& ... 0&control=
[Sun May 21 12:46:20 2006] [error] [client 127.0.0.1] script not found or unable to stat: /srv/www/cgi-bin/nph-zms, referer: http://localhost/zm.php?view=watchfeed& ... 0&control=
[Sun May 21 12:46:23 2006] [error] [client 127.0.0.1] script not found or unable to stat: /srv/www/cgi-bin/nph-zms, referer: http://localhost/zm.php?view=watchfeed& ... 0&control=
[Sun May 21 12:46:34 2006] [error] [client 127.0.0.1] script not found or unable to stat: /srv/www/cgi-bin/nph-zms, referer: http://localhost/zm.php?view=watchfeed& ... 0&control=
Searching for nph-zms I find it at :- /svr/www/cgi-bin/nph-zms. I have a "srv and "svr" folders, the majority of zm is currently in "srv".

How can I tidy up this so that zm and nph-zms are where they should be?

I'd really like to achieve a default install directory configuration if at all possible.

Many thanks,

Mark.

PS. What plugins are necessary to display cams in Firefox as mpg? and jpg? I get broken links on jpg and additional plugs are required (but can't be found) on mpeg.
jameswilson
Posts: 5111
Joined: Wed Jun 08, 2005 8:07 pm
Location: Midlands UK

Post by jameswilson »

getting mpeg to run can be fun so id concentrate on getting everything else working first. If you getting jpeg issues you will never get mpeg to work nicely. I cant help with the suse thing im afraid
James Wilson

Disclaimer: The above is pure theory and may work on a good day with the wind behind it. etc etc.
http://www.securitywarehouse.co.uk
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

As far as your libarch, you can leave that switch out or use /lib (for 32bit anyway).

As far as your path for the cgi scripts, you can change that in the options under the paths tab to change from /srv to /svr (full path of coarse to zms or nph-zms).

You can recompile with the correct information or just change the path for zms as zm should have picked up the /lib directory anyway.

Good spot on that and thank you for the informative posting :D

Cheers,
Corey
Mark Ward
Posts: 51
Joined: Thu May 11, 2006 11:28 am
Location: Kent, UK.

Post by Mark Ward »

Thanks for the info, I'm going to attempt to move everything to "svr" which is where I take it it should have originally been.

Could a moderator edit dgconseil's excellent thread http://www.zoneminder.com/forums/viewtopic.php?t=5686 so that others don't make the same error I did?

Many thanks,

Mark.[/url]
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

I have edited the other thread.
Phil
Mark Ward
Posts: 51
Joined: Thu May 11, 2006 11:28 am
Location: Kent, UK.

Post by Mark Ward »

I know a little knowledge is a dangerous thing, but having done a complete clean install of Suse10.1 I discover that by default I don't have a "svr" directory, but do have a "srv".

Now I'm confused. How did I end up with the cgi-bin containing nph-zms under "svr" yet the majority of zonemaster php files under "srv"?

I asked the question whether the zm install dir should have been "svr", but as it appears that's not a default system dir for webpages was it actually the cgi-bin folder that turned up in the wrong place.

Before I mess this up again..... In order to install into the intended default location... should zm end up in svr or srv?

Was the error in the step-by-step guide after all? or in the zm installer's paths?

For future upgrading I really want to be in the intended default locations. Where should zm be ending up please?

Many thanks,

Mark.
maciekc
Posts: 150
Joined: Wed Feb 23, 2005 9:21 pm
Location: Czestochowa, POLAND

Post by maciekc »

Mark Ward wrote:I know a little knowledge is a dangerous thing, but having done a complete clean install of Suse10.1 I discover that by default I don't have a "svr" directory, but do have a "srv".

Now I'm confused. How did I end up with the cgi-bin containing nph-zms under "svr" yet the majority of zonemaster php files under "srv"?

I asked the question whether the zm install dir should have been "svr", but as it appears that's not a default system dir for webpages was it actually the cgi-bin folder that turned up in the wrong place.

Before I mess this up again..... In order to install into the intended default location... should zm end up in svr or srv?

Was the error in the step-by-step guide after all? or in the zm installer's paths?

For future upgrading I really want to be in the intended default locations. Where should zm be ending up please?

Many thanks,

Mark.
There is no default location.
When recompiling zm you need to specify the dirs.
That is your choose if you want to be compatible with what the "masters of suse" want.
You can place these dirs anywhere you want IMHO.
byte
Posts: 39
Joined: Mon May 22, 2006 3:02 pm
Location: Sunny Essex in UK

Post by byte »

Mark,

Maybe what also happend is that when you at first complied zm using the how to and entering svr instead of srv and running make did you then run make clean to be clear that you started again from a clean slate?
Mark Ward
Posts: 51
Joined: Thu May 11, 2006 11:28 am
Location: Kent, UK.

Post by Mark Ward »

Maybe what also happend is that when you at first complied zm using the how to and entering svr instead of srv
That's entirely possible, if you take a careful look at my original posting in this thread I ended up with Zoneminder in srv, but my logs showed that it could not access nph-zms which had somehow ended up under "svr".

With my complete lack of Linux directory structure knowledge I asked the question whether zm should have also ended up in "svr"? and the result it appear I may have inadvertantly caused the "How-To" to be altered incorrectly :oops:
and running make did you then run make clean to be clear that you started again from a clean slate?
I actually completely re-installed Suse, I wasn't sure what links and files would be left behind and wanted to be as sure as I could. Bizarrely the 2nd install resulted in my root user having no permisiions to access localhost, or at least the php files in zm didn't have permission.

So I am at a 3rd attempt here and want to be sure I achieve something close to a default set of files for zm :)

I've currently installed Suse 10.1 (having read of another zm user's success at this) and will be following the "HowTo" again once I'm clear what I should be aiming for :)

Mark.
jameswilson
Posts: 5111
Joined: Wed Jun 08, 2005 8:07 pm
Location: Midlands UK

Post by jameswilson »

lol @ 3rd install (Are you sure suse is the way to go!!)

I take my hat off to your perserverance!
James
James Wilson

Disclaimer: The above is pure theory and may work on a good day with the wind behind it. etc etc.
http://www.securitywarehouse.co.uk
Mark Ward
Posts: 51
Joined: Thu May 11, 2006 11:28 am
Location: Kent, UK.

Post by Mark Ward »

lol @ 3rd install (Are you sure suse is the way to go!!)
I'm sure it's nothing to do with Suse, I was very unclear what I was doing the first time but it worked ok, other than the fact I couldn't display images in ZM, a problem with the installation Dirs.

2nd one? Root user has no permission to access Localhost? God knows what I did wrong there.

3rd time lucky right? :D
I take my hat off to your perserverance!
ZM is exactly what I need at home, I can already see that it'll be worth the effort. I'm being ultra-cautious with all these re-installs, but I reckon that if I allow some non-standard quirks into my install at the start I'll be living with them a long while.

I'm that confident that this is the way to go I sent off my PayPal Donation a few days ago whilst still on install 1, and I'd still do it now. The problems I'm having aren't with zm, there with gathering the necessary knowledge. The WIKI will help there when a little more info is in place :)

Mark.
byte
Posts: 39
Joined: Mon May 22, 2006 3:02 pm
Location: Sunny Essex in UK

Post by byte »

James - SUSE is lovely ;)

Mark - SUSE use's "srv" for it's web document root, "svr" is nothing you can safely delete that folder... Here is how I recently installed ZM under SuSE 10.x

Following most of the how-to you posted (with some additonal corrections)

Boot up to installation and change software settings to include these packages...

apache2-worker
apache2
apache2-mod_perl
apache2-mod_php4
php4-session updated 2006-03-24 thnax to mickecarlsson
mod_php4-core
mysql
mysql-devel
gcc
gcc-c++
libmpeg2-devel
libjpeg-devel
pcre-devel
xawtv
lynx Updated 2006-03-23 : needed by cpan configuration
openssl-devel

If you don't have any of the package's download them from rpmfind as if you have the CD Version not all packages will be on there.

Note:

I'm not installing this package as I found it doesn't need to be...

ncftp Updated 2006-03-23 : needed by cpan configuration

And I will maybe/probably install this package if I want to export video's into mpeg...

ffmpeg


Once you have install and rebooted type yast and system > system services (runlevel) make sure you enable apache2 and mysql to say yes

Now they have started you can run...
When you first run...

perl -MCPAN -e shell

It will ask you for a load of questions, I found all the default one's to work for me and select you own mirror's for it to download the packages, then run the below for each line only...

install Bundle::CPAN
reload CPAN
install Archive::Tar (seems to be optional => depend on the way you install yourdistro)
install Archive::Zip (seems to be optional => depend on the way you install yourdistro)
install MIME::Lite
install MIME::Tools
install DateTime
install Date::Manip updated 2006-03-04 thanx to mickecarlsson
install Bundle::libnet
install Device::SerialPort
install Astro::SunTime Updated 2006 03 24 correct spelling error on SunTime (thanx to mickecarlsson)
install X10

Then grab the latest & greatest ZoneMinder and extract like...

tar zxvf ZoneMinderTarball.tar.gz
cd ZoneMinderSourceDirectory

Now run configure like

./configure --with-webdir=/srv/www/htdocs/ --with-cgidir=/srv/www/cgi-bin/ --with-webgroup=www --with-webuser=wwwrun ZM_DB_HOST=localhost ZM_DB_NAME=zm ZM_DB_USER=zm ZM_DB_PASS=zm

Note: the above is on one line.

Before you log into mysql make sure you are still in the ZoneMinder source directory otherwise you will get error's...

Log into Mysql...

mysql -h localhost -u root -p

And then for each line do...

source db/zm_create.sql;
grant select,insert,update,delete on zm.* to 'zm'@localhost identified by 'zm';
flush privileges;
quit

Now you can type make followed by make install

Go to you browser and type http://localhost/zm.php

Now depending on your card (as I'm finding out) you may need to start xawtv change the input then you will find the monitoring in zm working, I'm still working on a few tweak's (see other post) to see if I can get it to boot up on start up.

Hope this help's you while it's a brief how to you should be able to get a working ZM
Mark Ward
Posts: 51
Joined: Thu May 11, 2006 11:28 am
Location: Kent, UK.

Post by Mark Ward »

Thanks for that byte! That's this afternoon taken up! :D

I re-installed the OS as Suse 10.1 this time as I'd read that someone else had done this succesfully with zm. I couldn't find any of the php4 packages listed there however. They're either default to 10.1 or missing from the package list on that particular repository I guess. I've asked the question about this in the thread where the guy installed 10.1 [EDIT]And I just found out you answered that one too! Thanks!

Do you log in as root to do all these installs? I have been so far. Also, once installed can the system be viewed locally if logged in as a user?

Is apache2 enabled by default after all this procedure? Even when I did get zm working the first time I wasn't able to access it from a remote machine with http://192.168.0.x/zm.php. That could of course been down to the fact that I'd not got all the files in the correct place.

Could you put your instructions up on the Wiki too? They'd be a very usefull source of reference for others.

Many thanks,

Mark.
byte
Posts: 39
Joined: Mon May 22, 2006 3:02 pm
Location: Sunny Essex in UK

Post by byte »

Mark Ward wrote: Do you log in as root to do all these installs? I have been so far. Also, once installed can the system be viewed locally if logged in as a user?
You can (and recommend) log in as user and type "sudo" to do a root command for example...

sudo make install

Rule here is we should never be root user.
Is apache2 enabled by default after all this procedure? Even when I did get zm working the first time I wasn't able to access it from a remote machine with http://192.168.0.x/zm.php. That could of course been down to the fact that I'd not got all the files in the correct place.
No apache2 and mysql are not enable after all this procedure, you will have to do that step where I said go to yast > system > .... Then you should as I did be able to view from localhost and remote.
Locked