You don't have permission to access /admin/ajax.php on this server

I am currently running asterisk / freepbx 14.0.4.1 on centos 7 with asterisk 14 as well

This was installed from scratch and is not a distro install

Everything seems to be running ok with the following excpetion

When i first log into the Freepbx server i get the permission error in the topic title

I am able to click on the error and it goes away and then i can access the other parts of Freepbx generally – its really just the dashboard tab which gives me the error

I ran fwconsole chown to try and fix it but that did not seem to work

any ideas or assistance would be greatly appreciated

Anyone have any ideas how to fix this – its really very annoying and would like to get this buttoned up

thanks,

What are the permissions of that file and what is the owner/group set to on the file?

ls -l /var/www/html/admin/ajax.php <-- Do that and provide the output.

-rw-rw-r-- 1 asterisk asterisk 1686 Oct 23 11:36 /var/www/html/admin/ajax.php

Well that is totally correct. Open up the “Developer’s Console/Debug” in your browser (Chrome is ctrl + shift + I) and then refresh the page. See if any errors/warnings come up that might point to a reason as to why that error is happening/triggering for you.

If you can post the debug output.

is this what you are looking for:

jquery-3.1.1.min.js?load_version=14.0.4.1:4 GET http://172.27.232.1/admin/ajax.php?command=sysstat&target=asterisk&period=Hour&module=dashboard 403 (Forbidden)
send @ jquery-3.1.1.min.js?load_version=14.0.4.1:4
ajax @ jquery-3.1.1.min.js?load_version=14.0.4.1:4
jQuery.ajax @ pbxlib_17ce7f5bb350f1a3604805da83e63e395aa154a5.js?load_version=14.0.4.1:284
window.observers.builtin_aststat @ VM258:15
(anonymous) @ VM258:27
p @ jquery-3.1.1.min.js?load_version=14.0.4.1:2
Ia @ jquery-3.1.1.min.js?load_version=14.0.4.1:3
append @ jquery-3.1.1.min.js?load_version=14.0.4.1:3
(anonymous) @ jquery-3.1.1.min.js?load_version=14.0.4.1:3
S @ jquery-3.1.1.min.js?load_version=14.0.4.1:3
html @ jquery-3.1.1.min.js?load_version=14.0.4.1:3
loadIntoBox @ dashboard.js?load_version=14.0.4.1:148
success @ dashboard.js?load_version=14.0.4.1:129
i @ jquery-3.1.1.min.js?load_version=14.0.4.1:2
fireWith @ jquery-3.1.1.min.js?load_version=14.0.4.1:2
A @ jquery-3.1.1.min.js?load_version=14.0.4.1:4
(anonymous) @ jquery-3.1.1.min.js?load_version=14.0.4.1:4
load (async)
send @ jquery-3.1.1.min.js?load_version=14.0.4.1:4
ajax @ jquery-3.1.1.min.js?load_version=14.0.4.1:4
jQuery.ajax @ pbxlib_17ce7f5bb350f1a3604805da83e63e395aa154a5.js?load_version=14.0.4.1:284
updateBox @ dashboard.js?load_version=14.0.4.1:124
(anonymous) @ dashboard.js?load_version=14.0.4.1:117
each @ jquery-3.1.1.min.js?load_version=14.0.4.1:2
loadPage @ dashboard.js?load_version=14.0.4.1:117
parseInfo @ dashboard.js?load_version=14.0.4.1:37
success @ dashboard.js?load_version=14.0.4.1:28
i @ jquery-3.1.1.min.js?load_version=14.0.4.1:2
fireWith @ jquery-3.1.1.min.js?load_version=14.0.4.1:2
A @ jquery-3.1.1.min.js?load_version=14.0.4.1:4
(anonymous) @ jquery-3.1.1.min.js?load_version=14.0.4.1:4
load (async)
send @ jquery-3.1.1.min.js?load_version=14.0.4.1:4
ajax @ jquery-3.1.1.min.js?load_version=14.0.4.1:4
jQuery.ajax @ pbxlib_17ce7f5bb350f1a3604805da83e63e395aa154a5.js?load_version=14.0.4.1:284
init @ dashboard.js?load_version=14.0.4.1:25
(anonymous) @ dashboard.js?load_version=14.0.4.1:186
j @ jquery-3.1.1.min.js?load_version=14.0.4.1:2
k @ jquery-3.1.1.min.js?load_version=14.0.4.1:2
setTimeout (async)
(anonymous) @ jquery-3.1.1.min.js?load_version=14.0.4.1:2
i @ jquery-3.1.1.min.js?load_version=14.0.4.1:2
fireWith @ jquery-3.1.1.min.js?load_version=14.0.4.1:2
fire @ jquery-3.1.1.min.js?load_version=14.0.4.1:2
i @ jquery-3.1.1.min.js?load_version=14.0.4.1:2
fireWith @ jquery-3.1.1.min.js?load_version=14.0.4.1:2
ready @ jquery-3.1.1.min.js?load_version=14.0.4.1:2
R @ jquery-3.1.1.min.js?load_version=14.0.4.1:3
pbxlib_17ce7f5bb350f1a3604805da83e63e395aa154a5.js?load_version=14.0.4.1:140

403 Forbidden

Forbidden

You don't have permission to access /admin/ajax.php on this server.

(anonymous) @ pbxlib_17ce7f5bb350f1a3604805da83e63e395aa154a5.js?load_version=14.0.4.1:140
dispatch @ jquery-3.1.1.min.js?load_version=14.0.4.1:3
q.handle @ jquery-3.1.1.min.js?load_version=14.0.4.1:3
trigger @ jquery-3.1.1.min.js?load_version=14.0.4.1:4
A @ jquery-3.1.1.min.js?load_version=14.0.4.1:4
(anonymous) @ jquery-3.1.1.min.js?load_version=14.0.4.1:4
load (async)
send @ jquery-3.1.1.min.js?load_version=14.0.4.1:4
ajax @ jquery-3.1.1.min.js?load_version=14.0.4.1:4
jQuery.ajax @ pbxlib_17ce7f5bb350f1a3604805da83e63e395aa154a5.js?load_version=14.0.4.1:284
window.observers.builtin_aststat @ VM258:15
(anonymous) @ VM258:27
p @ jquery-3.1.1.min.js?load_version=14.0.4.1:2
Ia @ jquery-3.1.1.min.js?load_version=14.0.4.1:3
append @ jquery-3.1.1.min.js?load_version=14.0.4.1:3
(anonymous) @ jquery-3.1.1.min.js?load_version=14.0.4.1:3
S @ jquery-3.1.1.min.js?load_version=14.0.4.1:3
html @ jquery-3.1.1.min.js?load_version=14.0.4.1:3
loadIntoBox @ dashboard.js?load_version=14.0.4.1:148
success @ dashboard.js?load_version=14.0.4.1:129
i @ jquery-3.1.1.min.js?load_version=14.0.4.1:2
fireWith @ jquery-3.1.1.min.js?load_version=14.0.4.1:2
A @ jquery-3.1.1.min.js?load_version=14.0.4.1:4
(anonymous) @ jquery-3.1.1.min.js?load_version=14.0.4.1:4
load (async)
send @ jquery-3.1.1.min.js?load_version=14.0.4.1:4
ajax @ jquery-3.1.1.min.js?load_version=14.0.4.1:4
jQuery.ajax @ pbxlib_17ce7f5bb350f1a3604805da83e63e395aa154a5.js?load_version=14.0.4.1:284
updateBox @ dashboard.js?load_version=14.0.4.1:124
(anonymous) @ dashboard.js?load_version=14.0.4.1:117
each @ jquery-3.1.1.min.js?load_version=14.0.4.1:2
loadPage @ dashboard.js?load_version=14.0.4.1:117
parseInfo @ dashboard.js?load_version=14.0.4.1:37
success @ dashboard.js?load_version=14.0.4.1:28
i @ jquery-3.1.1.min.js?load_version=14.0.4.1:2
fireWith @ jquery-3.1.1.min.js?load_version=14.0.4.1:2
A @ jquery-3.1.1.min.js?load_version=14.0.4.1:4
(anonymous) @ jquery-3.1.1.min.js?load_version=14.0.4.1:4
load (async)
send @ jquery-3.1.1.min.js?load_version=14.0.4.1:4
ajax @ jquery-3.1.1.min.js?load_version=14.0.4.1:4
jQuery.ajax @ pbxlib_17ce7f5bb350f1a3604805da83e63e395aa154a5.js?load_version=14.0.4.1:284
init @ dashboard.js?load_version=14.0.4.1:25
(anonymous) @ dashboard.js?load_version=14.0.4.1:186
j @ jquery-3.1.1.min.js?load_version=14.0.4.1:2
k @ jquery-3.1.1.min.js?load_version=14.0.4.1:2
setTimeout (async)
(anonymous) @ jquery-3.1.1.min.js?load_version=14.0.4.1:2
i @ jquery-3.1.1.min.js?load_version=14.0.4.1:2
fireWith @ jquery-3.1.1.min.js?load_version=14.0.4.1:2
fire @ jquery-3.1.1.min.js?load_version=14.0.4.1:2
i @ jquery-3.1.1.min.js?load_version=14.0.4.1:2
fireWith @ jquery-3.1.1.min.js?load_version=14.0.4.1:2
ready @ jquery-3.1.1.min.js?load_version=14.0.4.1:2
R @ jquery-3.1.1.min.js?load_version=14.0.4.1:3
pbxlib_17ce7f5bb350f1a3604805da83e63e395aa154a5.js?load_version=14.0.4.1:276 JQMIGRATE: jQuery.unique is deprecated, use jQuery.uniqueSort

also getting this error

{“error”:“ajaxRequest declined - Referrer”}

You’ve now posted two different errors. How did you get the second one.

the first error is shown under the console tab and the second under the network tab when i push ctrl + shift + I in chrome

You are on the same local network as the PBX? There is no VPN/Internet involved?

i think that maybe the issue Blaze

to answer you question – this server is currently hosted on a linode vm

I am using openvpn to connect to the server and access the web console - GUI to administer the server and avoid leaving ports open on the public side of things

looking at the headers on the network tab i see the following

  1. Request URL:

http://172.27.232.1/admin/ajax.php?command=getcontent&module=dashboard&rawname=Overview&section=overview

  1. Request Method:

GET

  1. Status Code:

403 Forbidden

  1. Remote Address:

172.27.232.1:80

  1. Referrer Policy:

unsafe-url

I think the unsafe-url and the vpn both point to the issue

now just need to fix it

Well the second error about the referrer was the clue. It means the PBX doesn’t like where you are being sent from to get to it. That usually happens when a VPN gets involved and it’s not configured properly.

While on this topic i have also assigned a private IP to the Freepbx server as well – i get the same error regardless of whether i connect using the Openvpn ip range or try connecting using the private ip assigned

^^ That.

that makes sense – can you give me a general idea of what you would change on the openvpn server?

Unfortunately, no. I’m not well versed in OpenVPN.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.