Failed open stream permission denied asterisk.conf

I just installed from wiki.freepbx.org FreePBX 13 CentOS 7 following the direction exactly and it i was able to access the web interface at first however and restarting services I am getting:

On the web page
Whoops \ Exception \ ErrorException (E_WARNING)
file(/etc/asterisk/asterisk.conf): failed to open stream: Permission denied

In freepbx log:
CRITICAL admin/bootstrap.php:270 - Connection attmempt to AMI failed

This is my second install getting the exact same result. I assumed i did something wrong during the first install so I installed centos7 fresh and performed the install again.

I have run fwconsole chown
I have performed every step as root user
fwconsole reload / restart are successful
/etc/amportal.conf, /etc/freepbx.conf /etc/asterisk/*.conf are owned by asterisk:asterisk and are 664 -rw-rw-r–

I am not sure where to go from here and am not having success finding a resolution for this problem. I would appreciate any help you could throw my way. Thank you in advance.

sudo -u asterisk cat /etc/asterisk/asterisk.conf
ps aux | grep httpd

sudo -u asterisk cat /etc/asterisk/asterisk.conf <—successful cat the file
[directories]
astetcdir=/etc/asterisk
astmoddir=/usr/lib64/asterisk/modules
astvarlibdir=/var/lib/asterisk
astagidir=/var/lib/asterisk/agi-bin
astspooldir=/var/spool/asterisk
astrundir=/var/run/asterisk
astlogdir=/var/log/asterisk
[options]
transmit_silence_during_record=yes
languageprefix=yes
execincludes=yes
[files]
astctlpermissions=775

ps aux | grep httpd
root 477 0.0 0.3 437124 14532 ? Ss 09:35 0:00 /usr/sbin/httpd -DFOREGROUND
asterisk 631 0.0 0.2 439208 9360 ? S 09:35 0:00 /usr/sbin/httpd -DFOREGROUND
asterisk 632 0.0 0.2 439208 8428 ? S 09:35 0:00 /usr/sbin/httpd -DFOREGROUND
asterisk 633 0.0 0.2 439208 9360 ? S 09:35 0:00 /usr/sbin/httpd -DFOREGROUND
asterisk 634 0.0 0.2 439208 9360 ? S 09:35 0:00 /usr/sbin/httpd -DFOREGROUND
asterisk 635 0.0 0.2 439208 9356 ? S 09:35 0:00 /usr/sbin/httpd -DFOREGROUND
asterisk 3274 0.0 0.2 439208 8432 ? S 09:49 0:00 /usr/sbin/httpd -DFOREGROUND
root 5957 0.0 0.0 112648 964 pts/2 S+ 11:00 0:00 grep --color=auto httpd

I still am stuck on this same problem if anyone has any thoughts. : )

ls -al /etc/asterisk

[[email protected] /]# ls -al /etc |grep asterisk
-rw-rw----. 1 asterisk asterisk 17586 Aug 16 09:37 amportal.conf
drwxr-xr-x. 2 asterisk asterisk 4096 Aug 15 17:24 asterisk
-rw-rw----. 1 asterisk asterisk 317 Aug 15 16:21 freepbx.conf
[[email protected] /]# ls -al /etc/asterisk
total 272
drwxr-xr-x. 2 asterisk asterisk 4096 Aug 15 17:24 .
drwxr-xr-x. 97 root root 12288 Aug 16 09:35 …
-rw-rw-r–. 1 asterisk asterisk 342 Aug 15 16:21 asterisk.conf
-rw-rw-r–. 1 asterisk asterisk 91 Aug 15 16:21 cdr_adaptive_odbc.conf
-rw-rw-r–. 1 asterisk asterisk 0 Aug 15 16:21 cdr.conf
lrwxrwxrwx. 1 asterisk asterisk 44 Aug 15 16:21 cel.conf -> /var/www/html/admin/modules/cel/etc/cel.conf
-rw-rw-r–. 1 asterisk asterisk 0 Aug 15 16:21 cel_custom_post.conf
-rw-rw-r–. 1 asterisk asterisk 783 Aug 16 09:37 cel_general_additional.conf
-rw-rw-r–. 1 asterisk asterisk 0 Aug 15 16:21 cel_general_custom.conf
lrwxrwxrwx. 1 asterisk asterisk 49 Aug 15 16:21 cel_odbc.conf -> /var/www/html/admin/modules/cel/etc/cel_odbc.conf
-rw-rw-r–. 1 asterisk asterisk 0 Aug 15 16:21 cel_odbc_custom.conf
-rw-rw-r–. 1 asterisk asterisk 664 Aug 16 09:37 chan_dahdi_additional.conf
-rw-rw-r–. 1 asterisk asterisk 1409 Aug 16 09:37 confbridge_additional.conf
lrwxrwxrwx. 1 asterisk asterisk 59 Aug 15 16:21 confbridge.conf -> /var/www/html/admin/modules/conferences/etc/confbridge.conf
-rw-rw-r–. 1 asterisk asterisk 0 Aug 15 16:21 confbridge_custom.conf
-rw-rw-r–. 1 asterisk asterisk 41 Aug 15 16:21 dnsmgr.conf
-rw-rw-r–. 1 asterisk asterisk 50 Aug 15 16:21 enum.conf
-rw-rw-r–. 1 asterisk asterisk 76750 Aug 16 09:37 extensions_additional.conf
lrwxrwxrwx. 1 asterisk asterisk 52 Aug 15 16:21 extensions.conf -> /var/www/html/admin/modules/core/etc/extensions.conf
-rw-rw-r–. 1 asterisk asterisk 0 Aug 15 16:21 extensions_custom.conf
-rw-rw-r–. 1 asterisk asterisk 0 Aug 15 16:21 extensions_override_freepbx.conf
-rw-rw-r–. 1 asterisk asterisk 708 Aug 16 09:37 features_applicationmap_additional.conf
-rw-rw-r–. 1 asterisk asterisk 0 Aug 15 16:21 features_applicationmap_custom.conf
lrwxrwxrwx. 1 asterisk asterisk 50 Aug 15 16:21 features.conf -> /var/www/html/admin/modules/core/etc/features.conf
-rw-rw-r–. 1 asterisk asterisk 712 Aug 16 09:37 features_featuremap_additional.conf
-rw-rw-r–. 1 asterisk asterisk 0 Aug 15 16:21 features_featuremap_custom.conf
-rw-rw-r–. 1 asterisk asterisk 679 Aug 16 09:37 features_general_additional.conf
-rw-rw-r–. 1 asterisk asterisk 0 Aug 15 16:21 features_general_custom.conf
-rw-rw-r–. 1 asterisk asterisk 730 Aug 15 16:21 freepbx_module_admin.conf
-rw-rw-r–. 1 asterisk asterisk 0 Aug 15 16:21 globals_custom.conf
-rw-rw-r–. 1 asterisk asterisk 802 Aug 16 09:37 http_additional.conf
lrwxrwxrwx. 1 asterisk asterisk 46 Aug 15 16:21 http.conf -> /var/www/html/admin/modules/core/etc/http.conf
-rw-rw-r–. 1 asterisk asterisk 0 Aug 15 16:21 http_custom.conf
-rw-rw-r–. 1 asterisk asterisk 664 Aug 16 09:37 iax_additional.conf
lrwxrwxrwx. 1 asterisk asterisk 45 Aug 15 16:21 iax.conf -> /var/www/html/admin/modules/core/etc/iax.conf
-rw-rw-r–. 1 asterisk asterisk 0 Aug 15 16:21 iax_custom.conf
-rw-rw-r–. 1 asterisk asterisk 0 Aug 15 16:21 iax_custom_post.conf
-rw-rw-r–. 1 asterisk asterisk 746 Aug 16 09:37 iax_general_additional.conf
-rw-rw-r–. 1 asterisk asterisk 0 Aug 15 16:21 iax_general_custom.conf
-rw-rw-r–. 1 asterisk asterisk 664 Aug 16 09:37 iax_registrations.conf
-rw-rw-r–. 1 asterisk asterisk 0 Aug 15 16:21 iax_registrations_custom.conf
-rw-rw-r–. 1 asterisk asterisk 841 Aug 16 09:37 indications.conf
-rw-rw-r–. 1 asterisk asterisk 664 Aug 16 09:37 localprefixes.conf
lrwxrwxrwx. 1 asterisk asterisk 52 Aug 15 16:21 logger.conf -> /var/www/html/admin/modules/logfiles/etc/logger.conf
-rw-rw-r–. 1 asterisk asterisk 735 Aug 16 09:37 logger_general_additional.conf
-rw-rw-r–. 1 asterisk asterisk 0 Aug 15 16:21 logger_general_custom.conf
-rw-rw-r–. 1 asterisk asterisk 753 Aug 16 09:37 logger_logfiles_additional.conf
-rw-rw-r–. 1 asterisk asterisk 0 Aug 15 16:21 logger_logfiles_custom.conf
-rw-rw-r–. 1 asterisk asterisk 0 Aug 15 16:21 manager_additional.conf
-rw-rw-r–. 1 asterisk asterisk 971 Aug 15 16:21 manager.conf
-rw-rw-r–. 1 asterisk asterisk 971 Aug 15 16:21 manager.conf.12.0.1.bak
-rw-rw-r–. 1 asterisk asterisk 0 Aug 15 16:21 manager_custom.conf
-rw-rw-r–. 1 asterisk asterisk 664 Aug 16 09:37 meetme_additional.conf
-rw-rw-r–. 1 asterisk asterisk 126 Aug 15 16:21 meetme.conf
-rw-rw-r–. 1 asterisk asterisk 0 Aug 15 16:21 meetme_general_additional.conf
-rw-rw-r–. 1 asterisk asterisk 0 Aug 15 16:21 meetme_general_custom.conf
-rw-rw-r–. 1 asterisk asterisk 1563 Aug 16 09:37 modules.conf
-rw-rw-r–. 1 asterisk asterisk 840 Aug 16 09:37 musiconhold_additional.conf
-rw-rw-r–. 1 asterisk asterisk 208 Aug 15 16:21 musiconhold.conf
-rw-rw-r–. 1 asterisk asterisk 0 Aug 15 16:21 musiconhold_custom.conf
-rw-rw-r–. 1 asterisk asterisk 90 Aug 15 16:21 phpagi.conf
-rw-rw-r–. 1 asterisk asterisk 696 Aug 16 09:37 pjsip.aor.conf
-rw-rw-r–. 1 asterisk asterisk 0 Aug 15 16:21 pjsip.aor_custom.conf
-rw-rw-r–. 1 asterisk asterisk 0 Aug 15 16:21 pjsip.aor_custom_post.conf
-rw-rw-r–. 1 asterisk asterisk 697 Aug 16 09:37 pjsip.auth.conf
-rw-rw-r–. 1 asterisk asterisk 0 Aug 15 16:21 pjsip.auth_custom.conf
-rw-rw-r–. 1 asterisk asterisk 0 Aug 15 16:21 pjsip.auth_custom_post.conf
-rw-rw-r–. 1 asterisk asterisk 1198 Aug 16 09:37 pjsip.conf
-rw-rw-r–. 1 asterisk asterisk 0 Aug 15 16:21 pjsip_custom.conf
-rw-rw-r–. 1 asterisk asterisk 0 Aug 15 16:21 pjsip_custom_post.conf
-rw-rw-r–. 1 asterisk asterisk 701 Aug 16 09:37 pjsip.endpoint.conf
-rw-rw-r–. 1 asterisk asterisk 0 Aug 15 16:21 pjsip.endpoint_custom.conf
-rw-rw-r–. 1 asterisk asterisk 0 Aug 15 16:21 pjsip.endpoint_custom_post.conf
-rw-rw-r–. 1 asterisk asterisk 701 Aug 16 09:37 pjsip.identify.conf
-rw-rw-r–. 1 asterisk asterisk 0 Aug 15 16:21 pjsip.identify_custom.conf
-rw-rw-r–. 1 asterisk asterisk 0 Aug 15 16:21 pjsip.identify_custom_post.conf
-rw-rw-r–. 1 asterisk asterisk 733 Aug 16 09:37 pjsip_notify.conf
-rw-rw-r–. 1 asterisk asterisk 705 Aug 16 09:37 pjsip.registration.conf
-rw-rw-r–. 1 asterisk asterisk 0 Aug 15 16:21 pjsip.registration_custom.conf
-rw-rw-r–. 1 asterisk asterisk 0 Aug 15 16:21 pjsip.registration_custom_post.conf
-rw-rw-r–. 1 asterisk asterisk 781 Aug 16 09:37 pjsip.transports.conf
-rw-rw-r–. 1 asterisk asterisk 0 Aug 15 16:21 pjsip.transports_custom.conf
-rw-rw-r–. 1 asterisk asterisk 0 Aug 15 16:21 pjsip.transports_custom_post.conf
-rw-rw-r–. 1 asterisk asterisk 81 Aug 15 16:21 privacy.conf
-rw-rw-r–. 1 asterisk asterisk 0 Aug 15 16:21 queues_additional.conf
-rw-rw-r–. 1 asterisk asterisk 522 Aug 15 16:21 queues.conf
-rw-rw-r–. 1 asterisk asterisk 0 Aug 15 16:21 queues_custom.conf
-rw-rw-r–. 1 asterisk asterisk 0 Aug 15 16:21 queues_custom_general.conf
-rw-rw-r–. 1 asterisk asterisk 0 Aug 15 16:21 queues_general_additional.conf
-rw-rw-r–. 1 asterisk asterisk 0 Aug 15 16:21 queues_post_custom.conf
-rw-rw-r–. 1 asterisk asterisk 846 Aug 16 09:37 res_odbc_additional.conf
lrwxrwxrwx. 1 asterisk asterisk 50 Aug 15 16:21 res_odbc.conf -> /var/www/html/admin/modules/core/etc/res_odbc.conf
-rw-rw-r–. 1 asterisk asterisk 0 Aug 15 16:21 res_odbc_custom.conf
-rw-rw-r–. 1 asterisk asterisk 735 Aug 16 09:37 rtp_additional.conf
lrwxrwxrwx. 1 asterisk asterisk 45 Aug 15 16:21 rtp.conf -> /var/www/html/admin/modules/core/etc/rtp.conf
-rw-rw-r–. 1 asterisk asterisk 0 Aug 15 16:21 rtp_custom.conf
-rw-rw-r–. 1 asterisk asterisk 664 Aug 16 09:37 sip_additional.conf
lrwxrwxrwx. 1 asterisk asterisk 45 Aug 15 16:21 sip.conf -> /var/www/html/admin/modules/core/etc/sip.conf
-rw-rw-r–. 1 asterisk asterisk 0 Aug 15 16:21 sip_custom.conf
-rw-rw-r–. 1 asterisk asterisk 0 Aug 15 16:21 sip_custom_post.conf
-rw-rw-r–. 1 asterisk asterisk 1345 Aug 16 09:37 sip_general_additional.conf
-rw-rw-r–. 1 asterisk asterisk 0 Aug 15 16:21 sip_general_custom.conf
-rw-rw-r–. 1 asterisk asterisk 0 Aug 15 16:21 sip_nat.conf
-rw-rw-r–. 1 asterisk asterisk 664 Aug 16 09:37 sip_notify_additional.conf
lrwxrwxrwx. 1 asterisk asterisk 52 Aug 15 16:21 sip_notify.conf -> /var/www/html/admin/modules/core/etc/sip_notify.conf
-rw-rw-r–. 1 asterisk asterisk 0 Aug 15 16:21 sip_notify_custom.conf
-rw-rw-r–. 1 asterisk asterisk 664 Aug 16 09:37 sip_registrations.conf
-rw-rw-r–. 1 asterisk asterisk 0 Aug 15 16:21 sip_registrations_custom.conf
lrwxrwxrwx. 1 asterisk asterisk 47 Aug 15 16:21 udptl.conf -> /var/www/html/admin/modules/core/etc/udptl.conf
-rw-rw-r–. 1 asterisk asterisk 0 Aug 15 16:21 udptl_custom.conf
-rw-rw-r–. 1 asterisk asterisk 1075 Aug 15 16:21 voicemail.conf
-rw-rw-r–. 1 asterisk asterisk 697 Aug 15 16:21 voicemail.conf.template

is the one line I was worried about.

There is literally no reason this shouldn’t “just work” from what you posted.

did you disable selinux

holy crap, literally the first command i entered on this new sever was sestatus and it said permissive so i continued. I am not sure how that could or would have changed with anything i did but its now showing enabled/enforcing so i just disabled it and rebooted. All good. Ok i’m going to go crawl under a rock. lol.

Thank you!