Forbidden when trying to access admin page

I have actaully been working on this all day. I have changed the permissions on the admin folder previously, and was getting a completely seperate issue so I started over at square one here hoping you guys could help me.

I am running asterisk v11.2.1
freePBX 2.11.0beta1
CentOS 6.4

The reason I am doing this is because I am determined to load chan_motif via FreePBX. I know I could do it manually configuring asterisk, but now it has become a quest… a challenge… an adventure. Hopefully someone can help me slay this mighty dragon.

httpd error log

[Wed Mar 20 18:03:41 2013] [error] [client ::1] (13)Permission denied: access to /admin/images/freepbx.png denied, referer: http://localhost/
[Wed Mar 20 18:03:43 2013] [error] [client ::1] (13)Permission denied: access to /admin/index.php denied, referer: http://localhost/
[Wed Mar 20 18:03:43 2013] [error] [client ::1] (13)Permission denied: access to /admin/index.html denied, referer: http://localhost/
[Wed Mar 20 18:03:43 2013] [error] [client ::1] (13)Permission denied: access to /admin/index.html.var denied, referer: http://localhost/

install is as follows:

[[email protected] freepbx-2.11.0beta1]# ./install_amp
Checking for PEAR DB…OK
PHP Warning: date_default_timezone_get(): It is not safe to rely on the system’s timezone settings. You are required to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected ‘America/Denver’ for ‘MDT/-6.0/DST’ instead in /usr/src/freepbx-2.11.0beta1/amp_conf/htdocs/admin/libraries/utility.functions.php on line 76
Checking for PEAR Console::Getopt…OK
Checking user…OK
Checking if Asterisk is running…running with PID: 3641…OK
Checking for /etc/amportal.conf…OK
Reading /etc/amportal.conf…parsed amp_conf variables from /etc/amportal.conf:
amp_conf [ASTMANAGERHOST] => [localhost]
amp_conf [AMPMGRPASS] => [amp111]
amp_conf [ASTMANAGERPORT] => [5038]
amp_conf [ASTMANAGERPROXYPORT] => []
amp_conf [AMPMGRUSER] => [admin]
amp_conf [ASTMGRWRITETIMEOUT] => [5000]
amp_conf [AMPLOCALBIN] => []
amp_conf [FPBXDBUGFILE] => [/var/log/asterisk/freepbx_dbug]
amp_conf [DEVEL] => [FALSE]
amp_conf [FPBXDBUGDISABLE] => [TRUE]
amp_conf [DEVELRELOAD] => [FALSE]
amp_conf [CFRINGTIMERDEFAULT] => [0]
amp_conf [ASTCONFAPP] => [app_meetme]
amp_conf [ZAP2DAHDICOMPAT] => [TRUE]
amp_conf [ENABLECW] => [TRUE]
amp_conf [DISABLECUSTOMCONTEXTS] => [FALSE]
amp_conf [DYNAMICHINTS] => [FALSE]
amp_conf [USEDEVSTATE] => [FALSE]
amp_conf [CONCURRENCYLIMITDEFAULT] => [0]
amp_conf [FCBEEPONLY] => [FALSE]
amp_conf [DIVERSIONHEADER] => [FALSE]
amp_conf [NOOPTRACE] => [0]
amp_conf [CWINUSEBUSY] => [TRUE]
amp_conf [ASTSTOPPOLLINT] => [2]
amp_conf [AMPBADNUMBER] => [TRUE]
amp_conf [USEGOOGLEDNSFORENUM] => [FALSE]
amp_conf [ASTSTOPTIMEOUT] => [120]
amp_conf [AUTOMIXMON] => [FALSE]
amp_conf [ASTAGIDIR] => [/var/lib/asterisk/agi-bin]
amp_conf [ASTVARLIBDIR] => [/var/lib/asterisk]
amp_conf [ASTETCDIR] => [/etc/asterisk]
amp_conf [ASTLOGDIR] => [/var/log/asterisk]
amp_conf [ASTMODDIR] => [/usr/lib/asterisk/modules]
amp_conf [ASTRUNDIR] => [/var/run/asterisk]
amp_conf [ASTSPOOLDIR] => [/var/spool/asterisk]
amp_conf [AMPCGIBIN] => [/var/www/cgi-bin ]
amp_conf [AMPBIN] => [/var/lib/asterisk/bin]
amp_conf [AMPSBIN] => [/usr/sbin]
amp_conf [AMPWEBROOT] => [/var/www/html]
amp_conf [MOHDIR] => [moh]
amp_conf [FOPWEBROOT] => []
amp_conf [BADDESTABORT] => [FALSE]
amp_conf [XTNCONFLICTABORT] => [FALSE]
amp_conf [CHECKREFERER] => [TRUE]
amp_conf [SERVERINTITLE] => [FALSE]
amp_conf [CUSTOMASERROR] => [TRUE]
amp_conf [RELOADCONFIRM] => [TRUE]
amp_conf [USECATEGORIES] => [TRUE]
amp_conf [MODULEADMINWGET] => [FALSE]
amp_conf [MAXCALLS] => []
amp_conf [CDRDBHOST] => []
amp_conf [CDRDBNAME] => []
amp_conf [CDRDBPASS] => []
amp_conf [CDRDBPORT] => []
amp_conf [CDRDBTABLENAME] => []
amp_conf [CDRDBTYPE] => []
amp_conf [CDRDBUSER] => []
amp_conf [AMPSYSLOGLEVEL] => [FILE]
amp_conf [AMPDISABLELOG] => [FALSE]
amp_conf [AMPEXTENSIONS] => [extensions]
amp_conf [AUTHTYPE] => [database]
amp_conf [AMPVMUMASK] => [007]
amp_conf [AMPWEBADDRESS] => []
amp_conf [AMPASTERISKGROUP] => [asterisk]
amp_conf [AMPASTERISKUSER] => [asterisk]
amp_conf [AMPDEVGROUP] => [asterisk]
amp_conf [AMPDEVUSER] => [asterisk]
amp_conf [AMPASTERISKWEBGROUP] => [asterisk]
amp_conf [AMPASTERISKWEBUSER] => [asterisk]
amp_conf [AMPENGINE] => [asterisk]
amp_conf [AMPMPG123] => [TRUE]
amp_conf [SSHPORT] => []
amp_conf [AMPPLAYKEY] => []
amp_conf [AMPDBUSER] => [root]
amp_conf [AMPDBPASS] => [daphne74]
amp_conf [AMPDBHOST] => [localhost]
amp_conf [AMPDBNAME] => [asterisk]
amp_conf [AMPDBENGINE] => [mysql]
amp_conf [datasource] => []
amp_conf [AMPENABLEDEVELDEBUG] => []
amp_conf [TCINTERVAL] => [60]
amp_conf [TCMAINT] => [1]
amp_conf [DAYNIGHTTCHOOK] => []
OK
Checking for /etc/asterisk/asterisk.conf…OK
Reading /etc/asterisk/asterisk.conf…OK
Using asterisk as PBX Engine
Checking for Asterisk version…11.2.1
Checking for selinux…OK
Connecting to database…OK
Checking current version of AMP…2.11.0beta1
Installing new FreePBX files…OK (569 files copied, 0 skipped)
amportal…no fpbx…freepbx_engine…freepbx_setting…gen_amp_conf.php…done
apply username/password changes to conf files:
running apply_conf.sh from freepbx_settings
chown: cannot dereference `/var/www/html/provisioning’: No such file or directory
Bootstrapping Configuration Settings
Updating configuration…
/etc/asterisk/cdr_mysql.conf user: [root] password: [daphne74] hostname: [localhost]
/etc/asterisk/manager.conf user: [admin] secret: [amp111]
/etc/asterisk/vm_email.inc
You might need to modify /etc/asterisk/vm_email.inc manually
Adjusting File Permissions…

Please wait…

SETTING FILE PERMISSIONS
Permissions OK
Done
done with apply_conf.sh
creating missing #include files…OK
OK
Setting permissions on files…chown: cannot dereference `/var/www/html/provisioning’: No such file or directory
OK
Checking for upgrades…No further upgrades necessary
Creating or updating freepbx_conf settings…PHP Notice: Undefined index: mainstyle_css_generated in /usr/src/freepbx-2.11.0beta1/libfreepbx.install.php on line 2269
…OK
Generating AMP configs…
Generating Configurations.conf, (if Asterisk is not running, you will get an error
In case of error, start Asterisk and hit the red bar in the GUI to generate the Configurations.conf files
Checking for PEAR Console::Getopt…OK
Running module install.php and install.sql scripts
Skipping extension and destination registry checks
checking if Voicemail Admin (vmailadmin) is installed…not installed, ok
Checking if directdids need migrating…already done
updating zap callgroup, pickupgroup…not needed
checking for delay_answer field …already exists
checking for pricid field …already exists
Checking for Global var RECORDING_STATE…Created
Checking if trunk table migration required…not needed
Checking if privacy manager options exists…already exists
Checking for noanswer_cid field…already exists
Checking for busy_cid field…already exists
Checking for chanunavail_cid field…already exists
Checking for noanswer_dest field…already exists
Checking for busy_dest field…already exists
Checking for chanunavail_dest field…already exists
Checking for General Setting migrations…not needed
Converting IAX notransfer to transfer if needed…updated 0000 records
deleting obsoleted record_in and record_out entries…ok
array(2) {
[“featurename”]=>
string(19) “directdialvoicemail”
[“description”]=>
string(18) “Direct Dial Prefix”
}
[FATAL] SELECT * FROM zapchandids ORDER BY channel [nativecode=1146 ** Table ‘asterisk.zapchandids’ doesn’t exist]SQL -
SELECT * FROM zapchandids ORDER BY channel

Trace Back:

/var/www/html/admin/libraries/sql.functions.php:11 die_freepbx()
[0]: SELECT * FROM zapchandids ORDER BY channel [nativecode=1146 ** Table ‘asterisk.zapchandids’ doesn’t exist]SQL -
SELECT * FROM zapchandids ORDER BY channel

/var/www/html/admin/modules/core/functions.inc.php:5589 sql()
[0]: SELECT * FROM zapchandids ORDER BY channel
[1]: getAll
[2]: 2

/var/www/html/admin/modules/core/functions.inc.php:1462 core_zapchandids_list()

/var/lib/asterisk/bin/retrieve_conf:649 core_get_config()
[0]: asterisk

Generating AMP configs…OK
Checking voicemail… checking if Voicemail Admin (vmailadmin) is installed…not installed, ok
Module voicemail successfully installed

SETTING FILE PERMISSIONS
chown: cannot dereference `/var/www/html/provisioning’: No such file or directory
Permissions OK
The following error(s) occured:

  • Module voicemail is already enabled
    installed
    Checking infoservices… Module infoservices successfully installed

SETTING FILE PERMISSIONS
chown: cannot dereference `/var/www/html/provisioning’: No such file or directory
Permissions OK
The following error(s) occured:

  • Module infoservices is already enabled
    installed
    Checking recordings… checking for fcode field…already exists
    checking for fcode_pass field…already exists
    Module recordings successfully installed

SETTING FILE PERMISSIONS
chown: cannot dereference `/var/www/html/provisioning’: No such file or directory
Permissions OK
The following error(s) occured:

  • Module recordings is already enabled
    installed
    Checking fw_ari… No directory /var/www/html/admin/modules/fw_ari/htdocs_ari, install script not needed
    Module fw_ari successfully installed

SETTING FILE PERMISSIONS
chown: cannot dereference `/var/www/html/provisioning’: No such file or directory
Permissions OK
installed
Checking featurecodeadmin… Module featurecodeadmin successfully installed

SETTING FILE PERMISSIONS
chown: cannot dereference `/var/www/html/provisioning’: No such file or directory
Permissions OK
The following error(s) occured:

  • Module featurecodeadmin is already enabled
    installed
    Checking music… Module music successfully installed

SETTING FILE PERMISSIONS
chown: cannot dereference `/var/www/html/provisioning’: No such file or directory
Permissions OK
The following error(s) occured:

  • Module music is already enabled
    installed
    Checking dashboard… Module dashboard successfully installed

SETTING FILE PERMISSIONS
chown: cannot dereference `/var/www/html/provisioning’: No such file or directory
Permissions OK
The following error(s) occured:

  • Module dashboard is already enabled
    installed
    Checking core… Checking if directdids need migrating…already done
    updating zap callgroup, pickupgroup…not needed
    checking for delay_answer field …already exists
    checking for pricid field …already exists
    Checking for Global var RECORDING_STATE…Already exists!
    Checking if trunk table migration required…not needed
    Checking if privacy manager options exists…already exists
    Checking for noanswer_cid field…already exists
    Checking for busy_cid field…already exists
    Checking for chanunavail_cid field…already exists
    Checking for noanswer_dest field…already exists
    Checking for busy_dest field…already exists
    Checking for chanunavail_dest field…already exists
    Checking for General Setting migrations…not needed
    Converting IAX notransfer to transfer if needed…updated 0000 records
    deleting obsoleted record_in and record_out entries…ok
    Module core successfully installed

SETTING FILE PERMISSIONS
chown: cannot dereference `/var/www/html/provisioning’: No such file or directory
Permissions OK
The following error(s) occured:

  • Module core is already enabled
    installed
    Checking framework… No directory /var/www/html/admin/modules/framework/amp_conf/htdocs, install script not needed
    Module framework successfully installed

SETTING FILE PERMISSIONS
chown: cannot dereference `/var/www/html/provisioning’: No such file or directory
Permissions OK
installed
Checking customappsreg… Module customappsreg successfully installed

SETTING FILE PERMISSIONS
chown: cannot dereference `/var/www/html/provisioning’: No such file or directory
Permissions OK
The following error(s) occured:

  • Module customappsreg is already enabled
    installed
    Checking cdr… Checking if field did is present in cdr table…
    did field already present.
    Checking if field recordingfile is present in cdr table…
    recordingfile field already present.
    Module cdr successfully installed

SETTING FILE PERMISSIONS
chown: cannot dereference `/var/www/html/provisioning’: No such file or directory
Permissions OK
The following error(s) occured:

  • Module cdr is already enabled
    installed
    Please update your modules and reload Asterisk by browsing to your server.

  • Note: It’s possible that if you click the red ‘Update Now’ bar BEFORE *
  • updating your modules, your machine will start dropping calls. Ensure *
  • that all modules are up to date BEFORE YOU CLICK THE RED BAR. As long *
  • as this is observed, your machine will be fully functional whilst the *
  • upgrade is in progress. *

Not really following what you are trying to do… chan_motif is an Asterisk module that must be compiled with Asterisk… FreePBX configures Asterisk, but only what has been compiled… seems the cart is before the horse.

Sorry for not being clear. chan_motif only works on FreePBX if I have all of this installed and working. The problem is I can’t get FreePBX to work. It says “Forbidden” when I go to the admin page. Once I can get FreePBX working I will then load the module.

What you are saying makes no sense. It’s like going to the doctor and saying I have a ringing in my ears and then pointing to your ass.

chan_motif and all Asterisk modules (including channel tech) get loaded when Asterisk starts. Asterisk has to be loaded before FreePBX can do anything.

Access denied sounds like a permissions error with your http server.

Keep in mind that a module to configure chan_motif is available for FreePBX in the app library.

Well it is actually more like saying I want to run a marathon… can you fix my sore knee? Anyway forget the chan_motif. That was purely anecdotal. I just added that to help explain why I am using these versions. This version of FreePBX seems to have a neat module loader that supports the chan_motif. That is all. The REAL problem is…

Getting Forbidden when I log in to the admin page <==#####

I agree it sounds like a permissions thing. I am just not familiar enough with Apache and FreePBX to figure out how to troubleshoot this. Would anyone be able to help me trouble shoot the problem with…

Getting Forbidden when going to the FreePBX admin page?

Gracias.

Check that apache user/group in /etc/httpd/conf/httpd.conf matches permission of /var/www/html. Generic install and most distributions set it to “asterisk”

If “AllowOverride All” in httpd.conf make sure /var/www/html/admin/.htaccess is not blocking. Try set “AllowOverride None” to test.

That was it. Thanks so much. Once I corrected the User in /etc/httpd/conf/httpd.conf it took care of business.

i have upgraded all the modules to 2.5 …, but when i say apply configuration i am getting below mention error.

[FATAL] SELECT * FROM zapchandids ORDER BY channel [nativecode=1146 ** Table ‘asterisk.zapchandids’ doesn’t exist]SQL -
SELECT * FROM zapchandids ORDER BY channel

Yes, that happens on the upgrade from older versiions.

Go to /usr/src/freepb(version you are running)/SQL/new-install

toward the bottom of the file is the zapdid database create stuff. Cut it and paste it to a new file.

Remove the static declarations for time zone and stuff. Not needed in this instance and they are not declared in the snipet so will cause it to bomb.

Put these changes in a file the mysql -D asterisk < changefile

this will update the DB and keep you going