# [SOLVED] apache2 + freepbx /etc access

## redwood

I've installed asterisk + apache2

and am trying to install the webapp freepbx phpscript.

My problem is that freepbx needs access to files not in htdocroot:

excerpt from /var/www/localhost/htdocs/admin/config.php

$amp_conf       = parse_amportal_conf("/etc/amportal.conf");

$asterisk_conf  = parse_asterisk_conf("/etc/asterisk/asterisk.conf");

When I try to login to http://www.mynetwork.net/admin

I get the error:

Warning: file(/etc/amportal.conf) [function.file]: failed to open stream: Permission denied in /var/www/localhost/htdocs/admin/functions.inc.php on line 35

Missing or unreadable config file (/etc/amportal.conf)...cannot continue

Other than changing apache's user.group from apache.apache to asterisk.asterisk (as the freepbx INSTALL suggests)

is there a (preferabably secure) way of giving root access to the apache2 server/

THANKS.

UPDATE: I added apache to the asterisk group which allowed apache to access /etc/amportal.conf and /etc/asterisk/*

Not sure how secure this is though.

So the perl program freepbx is now working.  

Had to edit /usr/sbin/amportal shellscript to get FOP op_server.pl to run. 

Also  had to open 5038/tcp port to allow access to my pbx from my lan.

Also, the perl script  vmail.cgi now functions since it now has access to /var/spool/asterisk/voicmail

----------

