Run as another user:Group

Forum for questions and support relating to the 1.27.x releases only.
Locked
mehrshid
Posts: 13
Joined: Tue Apr 29, 2014 9:51 am

Run as another user:Group

Post by mehrshid »

Hello
I am hardly trying to install two very popular applications in one mashine with no luck for over a month. I Install firstly the FreePBX Distro and then the Zoneminder 1.27
Both applications have a web interface that you can access it through an Apache web server. So, the problem is that I cannot make the two web interfaces work at the same time. If the web interface of the FreePBX is working , the web interface of the Zoneminder shows a message "cannot load config file...". If the web interface of the Zoneminder is working the web interface of the FreePBX show a message "forbitten something...".
After a quick research I realize that the problem has to do with the user we enter on the httpd.conf file. The FreePBX works with the User "asterisk" of the group "asterisk" and the zoneminder works with the user "apache" of the group "apache".
I have already tried to add the users to the same group (with the command: usermod -g asterisk apache) but problems still exists. If I add the users "asterisk" and "apache" to the group "apache" the problem is the same. If I add the users to the group "asterisk" then the Zoneminder works fine but the web interface of the FreePBX appears strange and everytime I select something asks for username and password of the webinterface.


In addition files that automatically generated on dev/shm/zm.mmap have 'apache' user and group permission.
What should i do?
At this moment every time i stop and start zonminder service dev/shm/zm.mmap create with 'apache:apache'
TheKorn
Posts: 142
Joined: Fri Aug 02, 2013 12:39 pm

Re: Run as another user:Group

Post by TheKorn »

You have a permissions problem. Throwing somebody in another's group doesn't give them the same rights as that user. (It just adds that person's group privileges, which can and apparently are different in this case.)

If I were you, I'd run two simultaneous instances of apache each on a different port with its own config file. That way both can run as their expected users. (There may be a way to do it with one instance of apache and one config file, but I'm not that good with apache configs.)
Locked