cynjut
(Dave Burgess)
October 7, 2020, 5:14pm
21
vi /etc/freepbx.conf
It should come back with the contents of the file on the screen. Look at the bottom line of the display - it should not say “READONLY”.
Don’t change anything. When done looking, type ‘ZZ’ (two capital Z)
That will save the file and exit. If the file is not writable, it will complain on the way out. Otherwise, you just end up back at the prompt.
mvogel4949
(mvogel4949)
October 7, 2020, 5:18pm
22
Thank you! It did not say readonly and there was no complaint on the way out about being not writable
cynjut
(Dave Burgess)
October 7, 2020, 5:21pm
23
OK, so the Asterisk user can read and write the file, and your Apache instance is owned by Asterisk (check that in the Apache Config files or using “ps -aux”) so the problem must be in the Apache Config somewhere.
mvogel4949
(mvogel4949)
October 7, 2020, 5:21pm
24
Does this tell me that apache is owned by root?
cynjut
(Dave Burgess)
October 7, 2020, 5:26pm
25
That tells you that ‘root’ owns the files. The question is about “in flight”, which we can only get from a “ps” command or from the Apache Config file.
mvogel4949
(mvogel4949)
October 7, 2020, 5:32pm
26
cynjut:
ps -aux
[root@localhost httpd]# ps -aux
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.0 0.1 43720 4032 ? Ss 11:57 0:02 /usr/lib/systemd/systemd --switched-root --system --deserialize 22
root 2 0.0 0.0 0 0 ? S 11:57 0:00 [kthreadd]
root 4 0.0 0.0 0 0 ? S< 11:57 0:00 [kworker/0:0H]
root 5 0.0 0.0 0 0 ? S 11:57 0:00 [kworker/u8:0]
root 6 0.0 0.0 0 0 ? S 11:57 0:00 [ksoftirqd/0]
root 7 0.0 0.0 0 0 ? S 11:57 0:00 [migration/0]
root 8 0.0 0.0 0 0 ? S 11:57 0:00 [rcu_bh]
root 9 0.1 0.0 0 0 ? S 11:57 0:09 [rcu_sched]
root 10 0.0 0.0 0 0 ? S< 11:57 0:00 [lru-add-drain]
root 11 0.0 0.0 0 0 ? S 11:57 0:00 [watchdog/0]
root 12 0.0 0.0 0 0 ? S 11:57 0:00 [watchdog/1]
root 13 0.0 0.0 0 0 ? S 11:57 0:00 [migration/1]
root 14 0.0 0.0 0 0 ? S 11:57 0:00 [ksoftirqd/1]
root 16 0.0 0.0 0 0 ? S< 11:57 0:00 [kworker/1:0H]
root 18 0.0 0.0 0 0 ? S 11:57 0:00 [kdevtmpfs]
root 19 0.0 0.0 0 0 ? S< 11:57 0:00 [netns]
root 20 0.0 0.0 0 0 ? S 11:57 0:00 [khungtaskd]
root 21 0.0 0.0 0 0 ? S< 11:57 0:00 [writeback]
root 22 0.0 0.0 0 0 ? S< 11:57 0:00 [kintegrityd]
root 23 0.0 0.0 0 0 ? S< 11:57 0:00 [bioset]
root 24 0.0 0.0 0 0 ? S< 11:57 0:00 [bioset]
root 25 0.0 0.0 0 0 ? S< 11:57 0:00 [bioset]
root 26 0.0 0.0 0 0 ? S< 11:57 0:00 [kblockd]
root 27 0.0 0.0 0 0 ? S< 11:57 0:00 [md]
root 28 0.0 0.0 0 0 ? S< 11:57 0:00 [edac-poller]
root 29 0.0 0.0 0 0 ? S< 11:57 0:00 [watchdogd]
root 30 0.0 0.0 0 0 ? S 11:57 0:00 [kworker/0:1]
root 35 0.0 0.0 0 0 ? S 11:57 0:00 [kswapd0]
root 36 0.0 0.0 0 0 ? SN 11:57 0:00 [ksmd]
root 37 0.0 0.0 0 0 ? SN 11:57 0:00 [khugepaged]
root 38 0.0 0.0 0 0 ? S< 11:57 0:00 [crypto]
root 46 0.0 0.0 0 0 ? S< 11:57 0:00 [kthrotld]
root 48 0.0 0.0 0 0 ? S< 11:57 0:00 [kmpath_rdacd]
root 49 0.0 0.0 0 0 ? S< 11:57 0:00 [kaluad]
root 50 0.0 0.0 0 0 ? S< 11:57 0:00 [kpsmoused]
root 52 0.0 0.0 0 0 ? S< 11:57 0:00 [ipv6_addrconf]
root 65 0.0 0.0 0 0 ? S< 11:57 0:00 [deferwq]
root 101 0.0 0.0 0 0 ? S 11:57 0:00 [kauditd]
root 146 0.0 0.0 0 0 ? S< 11:57 0:00 [ata_sff]
root 150 0.0 0.0 0 0 ? S 11:57 0:00 [scsi_eh_0]
root 151 0.0 0.0 0 0 ? S< 11:57 0:00 [scsi_tmf_0]
root 152 0.0 0.0 0 0 ? S 11:57 0:00 [scsi_eh_1]
root 154 0.0 0.0 0 0 ? S< 11:57 0:00 [scsi_tmf_1]
root 155 0.0 0.0 0 0 ? S 11:57 0:00 [scsi_eh_2]
root 157 0.0 0.0 0 0 ? S< 11:57 0:00 [scsi_tmf_2]
root 158 0.0 0.0 0 0 ? S 11:57 0:00 [scsi_eh_3]
root 160 0.0 0.0 0 0 ? S< 11:57 0:00 [scsi_tmf_3]
root 161 0.0 0.0 0 0 ? S 11:57 0:00 [kworker/u8:2]
root 179 0.0 0.0 0 0 ? S< 11:57 0:00 [kworker/1:1H]
root 180 0.0 0.0 0 0 ? S< 11:57 0:00 [kworker/0:1H]
root 187 0.0 0.0 0 0 ? S 11:57 0:00 [jbd2/sda2-8]
root 188 0.0 0.0 0 0 ? S< 11:57 0:00 [ext4-rsv-conver]
root 259 0.0 0.1 40204 6468 ? Ss 11:57 0:04 /usr/lib/systemd/systemd-journald
root 282 0.0 0.0 45132 1984 ? Ss 11:57 0:00 /usr/lib/systemd/systemd-udevd
root 337 0.0 0.0 0 0 ? S 11:57 0:00 [jbd2/sda1-8]
root 338 0.0 0.0 0 0 ? S< 11:57 0:00 [ext4-rsv-conver]
dbus 350 0.0 0.0 58128 2324 ? Ss 11:57 0:00 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --system
rpc 351 0.0 0.0 69280 1008 ? Ss 11:57 0:00 /sbin/rpcbind -w
root 353 0.0 0.0 24260 1560 ? Ss 11:57 0:00 /usr/lib/systemd/systemd-logind
root 359 0.0 0.0 15040 1168 ? Ss 11:57 0:00 /usr/sbin/incrond
avahi 364 0.0 0.0 60080 2008 ? Ss 11:57 0:00 avahi-daemon: running [linux.local]
chrony 370 0.0 0.0 117808 1840 ? S 11:57 0:00 /usr/sbin/chronyd -f /etc/sangoma_chrony.conf
avahi 372 0.0 0.0 60080 392 ? S 11:57 0:00 avahi-daemon: chroot helper
root 380 0.0 0.0 25908 940 ? Ss 11:57 0:00 /usr/sbin/atd -f
root 383 0.0 0.0 126424 1648 ? Ss 11:57 0:00 /usr/sbin/crond -n
root 397 0.0 0.0 110208 844 tty1 Ss+ 11:57 0:00 /sbin/agetty --noclear tty1 linux
root 404 0.0 0.0 0 0 ? S< 11:57 0:00 [cfg80211]
root 633 0.0 0.6 624772 26148 ? Ss 11:57 0:00 /usr/sbin/httpd -DFOREGROUND
root 634 0.0 0.1 216424 6176 ? Ssl 11:57 0:01 /usr/sbin/rsyslogd -n
nobody 635 0.0 0.0 53900 1828 ? Ss 11:57 0:00 /usr/sbin/dnsmasq -k
root 638 0.0 0.1 112924 4304 ? Ss 11:57 0:00 /usr/sbin/sshd -D
redis 639 0.1 0.1 143060 6796 ? Ssl 11:57 0:07 /usr/bin/redis-server 127.0.0.1:6379
mysql 719 0.0 0.0 113416 1604 ? Ss 11:57 0:00 /bin/sh /usr/bin/mysqld_safe --basedir=/usr
mongodb 727 0.3 1.4 678552 57012 ? Sl 11:57 0:16 /usr/bin/mongod --quiet -f /etc/mongod.conf run
apache 928 0.0 0.4 625616 16372 ? S 11:57 0:00 /usr/sbin/httpd -DFOREGROUND
apache 932 0.0 0.4 626160 16548 ? S 11:57 0:00 /usr/sbin/httpd -DFOREGROUND
apache 933 0.0 0.3 625028 13916 ? S 11:57 0:00 /usr/sbin/httpd -DFOREGROUND
apache 936 0.0 0.3 625004 13104 ? S 11:57 0:00 /usr/sbin/httpd -DFOREGROUND
apache 942 0.0 0.4 625116 16176 ? S 11:57 0:00 /usr/sbin/httpd -DFOREGROUND
mysql 965 0.6 3.8 1629368 148812 ? Sl 11:57 0:37 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/
root 1050 0.0 0.0 89704 2204 ? Ss 11:57 0:00 /usr/libexec/postfix/master -w
postfix 1051 0.0 0.1 89808 4056 ? S 11:57 0:00 pickup -l -t unix -u
postfix 1052 0.0 0.1 89984 4384 ? S 11:57 0:00 qmgr -l -t unix -u
postfix 1057 0.0 0.1 89820 4136 ? S 11:57 0:00 tlsmgr -l -t unix -u
root 1356 0.2 3.1 392532 120496 ? Ss 11:58 0:14 /usr/local/fop2/fop2_server
apache 1816 0.0 0.4 625152 15820 ? S 11:58 0:00 /usr/sbin/httpd -DFOREGROUND
root 2627 0.0 0.1 148752 6080 ? Ss 11:58 0:00 sshd: root@notty
root 2917 0.0 0.0 72388 3004 ? Ss 11:58 0:00 /usr/libexec/openssh/sftp-server
asterisk 4610 0.1 0.9 919552 35448 ? Ssl 11:59 0:09 PM2 v2.10.6: God Daemon (/home/asterisk/.pm2)
root 4829 0.0 0.1 148240 5636 ? Ss 11:59 0:00 sshd: root@pts/0
root 4836 0.1 1.1 156816 43360 pts/0 Ss 11:59 0:09 -bash
root 8562 0.0 0.0 0 0 ? S 12:16 0:00 [kworker/1:0]
polkitd 9524 0.0 0.3 612352 12260 ? Ssl 12:23 0:00 /usr/lib/polkit-1/polkitd --no-debug
root 9583 0.0 0.0 0 0 ? S 12:23 0:00 [kworker/1:2]
apache 10435 0.0 0.3 625240 14376 ? S 12:31 0:00 /usr/sbin/httpd -DFOREGROUND
apache 10438 0.0 0.3 625004 12796 ? S 12:31 0:00 /usr/sbin/httpd -DFOREGROUND
apache 10439 0.0 0.3 624904 12564 ? S 12:31 0:00 /usr/sbin/httpd -DFOREGROUND
apache 11074 0.0 0.3 625004 12656 ? S 12:33 0:00 /usr/sbin/httpd -DFOREGROUND
root 11094 26.0 0.4 1231172 15876 ? Sl 12:33 15:04 /usr/bin/python /usr/bin/fail2ban-server -b -s /var/run/fail2ban/fail2ban.sock
root 11096 0.0 0.0 15276 2220 ? S 12:33 0:02 /usr/libexec/gam_server
root 11201 0.0 0.0 113284 792 pts/0 S 12:33 0:00 /bin/sh /usr/sbin/safe_asterisk -U asterisk -G asterisk
asterisk 11207 2.5 1.9 2148540 74800 pts/0 Sl 12:33 1:29 /usr/sbin/asterisk -f -U asterisk -G asterisk -vvvg -c
asterisk 11420 0.4 1.1 499108 43840 ? Ss 12:33 0:14 php /var/www/html/admin/modules/restapps/restapps.php
asterisk 11532 0.7 1.7 1024560 66748 ? Ssl 12:34 0:25 node /var/www/html/admin/modules/ucp/node/index.js
asterisk 11704 0.7 2.5 1201956 99060 ? Ssl 12:34 0:27 letschat
root 12454 0.0 0.0 0 0 ? S 12:39 0:00 [kworker/0:2]
asterisk 18232 0.0 0.2 198092 8580 ? Ss 13:28 0:00 /usr/bin/python /usr/local/bin/pnp_server
root 18699 0.0 0.0 155476 1876 pts/0 R+ 13:31 0:00 ps -aux
cynjut
(Dave Burgess)
October 7, 2020, 5:38pm
27
The process is owned by Apache, not Asterisk.
That might be your problem.
mvogel4949
(mvogel4949)
October 7, 2020, 5:42pm
28
mvogel4949:
ps -aux
Looking at other systems it appears httpd is owned by root and or asterisk. I don’t see apache on the left. Can I change this?
cynjut
(Dave Burgess)
October 7, 2020, 5:53pm
29
Owned by root would probably work; the default User and Group for Apache should be set in the Apache Config file…
1 Like
mvogel4949
(mvogel4949)
October 7, 2020, 6:10pm
30
You are a genius.
If you wish httpd to run as a different user or group, you must run
httpd as root initially and it will switch.
User/Group: The name (or #number ) of the user/group to run httpd as.
It is usually good practice to create a dedicated user and group for
running httpd, as with most system services.
User apache
Group apache
Changed to asterisk and it came back to life. Thank you!
I would get the apache config files from a “fresh” install to compare against what you now have as perhaps something else is not correct. i.e. compare /etc/httpd/conf/* and /etc/httpd/conf.d/* files against known good ones.
cynjut
(Dave Burgess)
October 7, 2020, 6:43pm
32
That’s a good suggestion.
petecat1
(Peter Arnold-Nott)
October 12, 2020, 1:32am
33
Looks like this is all sorted but faced with this one previous time I found this to work: service httpd restart
system
(system)
Closed
October 19, 2020, 1:32am
34
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.