Forbidden You don’t have permission to access /freepbx on this server

freepbx
v7

(Hitesh Dubey) #1

I have installed NS7 and installed VOIP-Freepbx from admin pannel. but i am facing this following issue. can anyone please help me out.

https://195.2xx.1xx.xx/freepbx
Forbidden
You don’t have permission to access /freepbx on this server.


(Markus Neuberger) #2

Does it happen when doing module updates?


(Hitesh Dubey) #3

it is happening when i have installed module VOIP-PBX. from software center and after that i am trying to open WebUI of freepbx then its showing this an error.


(Hitesh Dubey) #4

chown asterisk:asterisk /etc/asterisk/http_custom.conf
chown: cannot access ‘/etc/asterisk/http_custom.conf’: No such file or directory
[root@backend ~]# cd /etc/asterisk/
[root@backend asterisk]# ll
total 20
-rwxr-xr-x 1 asterisk asterisk 2816 Jul 20 10:38 acl.conf
-rwxr-xr-x 1 asterisk asterisk 411 Aug 16 12:48 asterisk.conf
-rwxr-xr-x 1 asterisk asterisk 606 Aug 16 10:37 freepbx_chown.conf
-rwxr-xr-x 1 asterisk asterisk 0 Aug 16 12:48 freepbx-id
drwxr-x— 2 asterisk asterisk 4096 Aug 16 10:37 keys
-rwxr-xr-x 1 asterisk asterisk 2255 Jul 20 10:38 pjproject.conf
-rwxr-xr-x 1 asterisk asterisk 0 Aug 16 12:48 pjsip_wizard.conf
-rwxr-xr-x 1 asterisk asterisk 0 Jul 20 10:38 rtp_general_additional.conf


(Markus Neuberger) #5

Maybe you need to enable web access to freepbx?

http://docs.nethserver.org/en/v7/freepbx.html#web-access


(Hitesh Dubey) #6

Thanks for reply ! I am getting following an error. when i am running scl enable command

/usr/bin/scl enable rh-php56 “/usr/sbin/fwconsole”

/var/tmp/scly71LMe: line 8: /usr/sbin/fwconsole: No such file or directory


(Markus Neuberger) #7

Can’t test it at the moment, did you try without paths?


(Hitesh Dubey) #8

yes i have tried both, but the same issue occurred. After installation this is the same issue even after fresh installation.
This is kind of bug or incomplete package from NS, which is non tested.


(Marc) #9

I don’t use FreePBX but it has installed fine right now on a test VM.
If fwconsole file is missing maybe the installation failed. Logs should provide you more info (/var/log/messages, /var/log/yum.log, /var/log/freepbx*, /var/log/asterisk*).
You can remove and reinstall the module. If after doing this you still have problems with the module try to Uninstall FreePBX completely
If it stills fails, even after a fresh server install, there could be a side problem (connection, repositories…)


(Hitesh Dubey) #10

thanks ! i am sharing you installation logs !

[root@backend html]# tail /var/log/freepbx_rpm_install.log
Assuming you are Database Root
Checking if SELinux is enabled…Its not (good)!
Reading /etc/asterisk/asterisk.conf…Done
Checking if Asterisk is running and we can talk to it as the ‘asterisk’ user…Yes. Determined Asterisk version to be: 13.19.1
Preliminary checks done. Starting FreePBX Installation
Checking if this is a new install…Yes (No /etc/freepbx.conf file detected)
Database Root installation checking credentials and permissions…Error!
Invalid Database Permissions. The error was: SQLSTATE[HY000] [1045] Access denied for user ‘root’@‘localhost’ (using password: YES)
/etc/e-smith/events/nethserver-freepbx-update/S55nethserver-freepbx-conf-scl: line 39: /usr/sbin/fwconsole: No such file or directory
/etc/e-smith/events/nethserver-freepbx-update/S55nethserver-freepbx-conf-scl: line 40: /usr/sbin/fwconsole: No such file or directory
[root@backend html]# vim /etc/selinux/config


(Markus Neuberger) #11

Did you change the password of mysql root user? Does mysql on command line work (you should be logged in without password)?


(Hitesh Dubey) #12

i didn’t change password ! and now able to login in mysql .
But i have applied following command to get access ! which is successfully done ! now i try for reinstallation of Freepbx.
Followed steps -
Login to NS terminal, can be done remotely]
$ sudo systemctl stop mysql
$ sudo mysqld_safe --skip-grant-tables &
$ mysql -u root


(Hitesh Dubey) #13

I have tried to install it again but its same an error !
Very strange issue is occurring. If i reset mysql root account then its access from following command.
#mysql -u root

but when i tried to install freepbx and in the log file same an error as above.
and after running mysql command - i get following an error.

#mysql -u root
ERROR 1045 (28000): Access denied for user ‘root’@‘localhost’ (using password: YES)


(Hitesh Dubey) #14

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.2 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“linux”,“arch”:“x64”})

Finished updating libraries!
Generating CSS…Done
Installed Missing Dependency of: pm2 13.0.3.18
Detected Missing Dependency of: certman
Downloading Missing Dependency of: certman
Processing certman
Downloading…
0/157609 [>---------------------------] 0%
20520/157609 [===>------------------------] 13%
35568/157609 [======>---------------------] 22%
49248/157609 [========>-------------------] 31%
65632/157609 [===========>----------------] 41%
82016/157609 [==============>-------------] 52%
101200/157609 [=================>----------] 64%
117584/157609 [====================>-------] 74%
133968/157609 [=======================>----] 85%
142160/157609 [=========================>–] 90%
157609/157609 [============================] 100%
Finished downloading
Extracting…Done
Module certman successfully downloaded
Installing Missing Dependency of: certman
The following error(s) occured:

  • FreePBX version 14.0.3 or higher is required, you have 14.0.1.8
    Unable to resolve dependencies for module ucp:
    Updating Hooks…Done

Installing userman…
Updating table userman_users…Done
Updating table userman_users_settings…Done
Updating table userman_groups…Done
Updating table userman_groups_settings…Done
Updating table userman_directories…Done
Generating CSS…Done
Module userman successfully installed
Updating Hooks…Done

Done. All modules installed.
Updating Hooks…Done
Done installing modules
sh: /dev/tty: No such device or address
Generating default configurations…
Finished generating default configurations
Trusting FreePBX…Trusted
You have successfully installed FreePBX
Setting Permissions…
Setting base permissions…Done
Setting specific permissions…
0 [>---------------------------]
100 [---------------->-----------]
200 [---->-----------------------]
300 [-------------------->-------]
400 [-------->-------------------]
500 [------------------------>—]
600 [------------>---------------]
700 [>---------------------------]
800 [---------------->-----------]
900 [---->-----------------------]
1000 [-------------------->-------]
1100 [-------->-------------------]
1200 [------------------------>—]
1300 [------------>---------------]
1400 [>---------------------------]
1500 [---------------->-----------]
1600 [---->-----------------------]
1700 [-------------------->-------]
1800 [-------->-------------------]
1900 [------------------------>—]
2000 [------------>---------------]
2100 [>---------------------------]
2200 [---------------->-----------]
2300 [---->-----------------------]
2400 [-------------------->-------]
2500 [-------->-------------------]
2600 [------------------------>—]
2700 [------------>---------------]
2800 [>---------------------------]
2900 [---------------->-----------]
3000 [---->-----------------------]
3100 [-------------------->-------]
3200 [-------->-------------------]
3300 [------------------------>—]
3400 [------------>---------------]
3500 [>---------------------------]
3600 [---------------->-----------]
3700 [---->-----------------------]
3800 [-------------------->-------]
3900 [-------->-------------------]
4000 [------------------------>—]
4100 [------------>---------------]
Finished setting permissions
Reloading FreePBX
Successfully reloaded


(Hitesh Dubey) #15

as per logs its showing successfully done !
But on web interface its same Error.10%20PM


(Markus Neuberger) #16

I think the mysql root user password is wrong. Nethserver stores passwords in /var/lib/nethserver/secrets/. To reset the mysql root password please follow these steps:

Get the password of mysql root:

cat /var/lib/nethserver/secrets/mysql

Reset root password, replace SECRET with the password you got in previous step.

systemctl stop mysqld
mysqld_safe --skip-grant-tables &
mysql mysql
update user set password=PASSWORD("SECRET") where User='root';
flush privileges;
exit
mysqladmin shutdown
systemctl start mysqld

http://docs.nethserver.org/projects/nethserver-devel/en/v7/mysql.html

To reconfigure freepbx:

signal-event nethserver-freepbx-update

Just to compare rights/owner, maybe there’s a permission problem (too):

ll /var/www/html/
total 0
drwxrwxr-x 3 asterisk asterisk 54 Aug 10 20:17 freepbx

(Hitesh Dubey) #17

Yes this is the issue with mysql … before i have rebooted and mysqld_safe … command and then it was successfully installed but now after installation its creating problem. As you instructed i have followed commands. But it couldn’t reset.

[root@backend ~]# systemctl stop mysqld
[root@backend ~]# mysqld_safe --skip-grant-tables &
[1] 27340
[root@backend ~]# 180818 19:39:42 mysqld_safe Logging to ‘/var/log/mariadb/mariadb.log’.
180818 19:39:42 mysqld_safe A mysqld process already exists

[1]+ Exit 1 mysqld_safe --skip-grant-tables
[root@backend ~]# mysql mysql
ERROR 1045 (28000): Access denied for user ‘root’@‘localhost’ (using password: YES)
[root@backend ~]# mysql mysql
ERROR 1045 (28000): Access denied for user ‘root’@‘localhost’ (using password: YES)


(Mark Verlinde) #18

You can try:

mysql --defaults-file=/root/.my.cnf

EDIT just checked mysql has to run for this


(Markus Neuberger) #19

A mysqld_safe process was still running so it didn’t work to get into mysql as root.

You may reboot to restart running processes and try again, it worked here already. As soon as the login works you should be able to reset the root password.


(Hitesh Dubey) #20

I have rebooted the server and again tried to reset but its mysqld_safe --skip-grant-tables, But again its not allowing to reset.