Error communicating with Asterisk. Ensure that Asterisk is properly installed and running as the asterisk user

Hello:

Fresh install on VPS.
Debian 8.7 / FreePbx 13.
Followed: “Installing FreePBX 13 on Debian 8.1”

Here is what happens:

STARTING ASTERISK
Asterisk Started
root@vps103799:/usr/src/freepbx# ./install -n
Assuming you are Database Root
Checking if SELinux is enabled…Its not (good)!
No /etc/asterisk/asterisk.conf file detected. Installing…Writing /etc/asterisk/asterisk.conf…Done
Checking if Asterisk is running and we can talk to it as the ‘asterisk’ user…Error!
Error communicating with Asterisk. Ensure that Asterisk is properly installed and running as the asterisk user
Asterisk does not appear to be running
Try starting Asterisk with the ‘./start_asterisk start’ command in this directory

So I do that and get:

root@vps103799:/usr/src/freepbx# ./start_asterisk start
STARTING ASTERISK
Asterisk is already running
root@vps103799:/usr/src/freepbx#

root@vps103799:/usr/src/freepbx# whoami
root
root@vps103799:/usr/src/freepbx#

If I browse to the ip, I get: “Not Found. The requested URL / was not found on this server.”

Does anyone know how to fix this?

I’d appreciate you help.

Rob.

It is probably because asterisk is not running as the “asterisk user”, check your /etc/default/asterisk file and

ps aux |grep asterisk

Thanks dicko. :slight_smile:

I looked at what you suggested but it does not say much to me. It looks like asterisk is running as the “root user”, but I am not certain of this. How do I make it run as the “asterisk user”?

Do you have any idea of where I screwed up in the official tutorial?

Thanks again for your time,

Rob.

What I see:

> /etc/default/asterisk:
> /etc/default/asterisk                                1684/1684              100%
> # Startup configuration for the Asterisk daemon

> # Uncomment the following and set them to the user/groups that you
> # want to run Asterisk as. NOTE: this requires substantial work to
> # be sure that Asterisk's environment has permission to write the
> # files required  for  its  operation, including logs, its comm
> # socket, the asterisk database, etc.
> #AST_USER="asterisk"
> #AST_GROUP="asterisk"

> # If you DON'T want Asterisk to start up with terminal colors, comment
> # this out.
> COLOR=yes

> # If you want Asterisk to run with a non-default configuration file,
> # uncomment the following option, and set the value appropriately.
> #ALTCONF=/etc/asterisk/asterisk.conf

> # In the case of a crash, Asterisk may create a core file.  Uncomment
> # if you want this behavior.
> #COREDUMP=yes

> # Asterisk may establish a maximum load average for the system.  This
> # may be useful to prevent a flood of calls from taking down the system.
> #MAXLOAD=4

> # Or, if you'd prefer, you can limit the maximum number of calls.
> #MAXCALLS=1000

> # Default console verbosity.  This may be raised or lowered on the console.
> # Note this is analogous to the -v command line switch, which by default
> # will cause Asterisk to start in console mode and run in the foreground,
> # unless the always fork (-F) option is also provided.
> #VERBOSITY=3

> # Enable internal timing if the DAHDI timer is available.  The default
> # behaviour is that outbound packets are phase locked to inbound packets.
> # Enabling this option causes them to be locked to the internal DAHDI
> # timer instead.
> #INTERNALTIMING=yes

> # Start all recordings into a temporary directory, before moving them to
> # their final location.
> #TEMPRECORDINGLOCATION=yes

root@vps103799:~# ps aux |grep asterisk

asterisk 13562 0.0 0.4 314232 8620 ? S 13:34 0:00 /usr/sbin/apache2 -k start
asterisk 13563 0.0 0.4 314232 8620 ? S 13:34 0:00 /usr/sbin/apache2 -k start
asterisk 13564 0.0 0.4 314232 8620 ? S 13:34 0:00 /usr/sbin/apache2 -k start
asterisk 13565 0.0 0.4 314232 8620 ? S 13:34 0:00 /usr/sbin/apache2 -k start
asterisk 13566 0.0 0.4 314232 8620 ? S 13:34 0:00 /usr/sbin/apache2 -k start
root 13593 0.0 0.0 4336 120 ? S 13:35 0:00 /bin/sh /usr/sbin/safe_asterisk -U asterisk -G asterisk
asterisk 13596 0.0 1.6 624248 32976 ? Sl 13:35 0:00 /usr/sbin/asterisk -f -U asterisk -G asterisk -vvvg -c
asterisk 13889 0.0 0.4 314232 8620 ? S 14:51 0:00 /usr/sbin/apache2 -k start
asterisk 14410 0.0 0.4 314232 8620 ? S 17:23 0:00 /usr/sbin/apache2 -k start
root 15394 0.0 0.0 12664 1712 pts/1 S+ 21:29 0:00 grep asterisk
root@vps103799:~#

Yep for Debian in /etc/default/asterisk

AST_USER="asterisk"
AST_GROUP=“asterisk”

and start asterisk with

/etc/init.d/asterisk restart

then it will do it the debian way. Yes Jessie uses systemd but still honors the old way.

When done

ps aux|grep asterisk

should show

/usr/sbin/asterisk -U asterisk -G asterisk

1 Like

Thanks dicko. :slight_smile:

I change the /etc/default/asterisk to:
AST_USER="asterisk"
AST_GROUP="asterisk"
and saved.

Then did: /etc/init.d/asterisk restart

The ps aux|grep asterisk shows:

root@vps103799:~# ps aux|grep asterisk
asterisk 703 0.0 0.4 314200 8672 ? S 22:08 0:00 /usr/sbin/apache2 -k start
asterisk 704 0.0 0.4 314232 8672 ? S 22:08 0:00 /usr/sbin/apache2 -k start
asterisk 705 0.0 0.4 314200 8672 ? S 22:08 0:00 /usr/sbin/apache2 -k start
asterisk 706 0.0 0.4 314184 8672 ? S 22:08 0:00 /usr/sbin/apache2 -k start
asterisk 707 0.0 0.4 314184 8672 ? S 22:08 0:00 /usr/sbin/apache2 -k start
asterisk 896 0.0 0.4 314184 8672 ? S 22:09 0:00 /usr/sbin/apache2 -k start
asterisk 1033 4.1 1.5 623636 31624 ? Ssl 22:38 0:00 /usr/sbin/asterisk -U asterisk -G asterisk
root 1072 0.0 0.0 12664 1688 pts/0 S+ 22:38 0:00 grep asterisk
root@vps103799:~#

But when I pint my Chromium (linux) bowser to the IP, I get:

“Not Found
The requested URL / was not found on this server.
Apache/2.4.10 (Debian) Server at 149.xx.xx.xxx Port 80”

I tried my browser both before and after a server reboot.

Is there something else that I must do?

Rob.

You might need to massage your apaches2 server configuration in /etc/apache2/*

but admin should be at

http://ip.address/admin

and

ucp at

http://ip.address/ucp

if you haven’t setup https yet.

1)cd asterisk-16*
2)./configure --with-pjproject-bundled --with-crypto --with-ssl=ssl --with-srtp --with-jansson-bundled
3) make menuselect
4)make && make install && make config && ldconfig
**5) **
skipped steps after installation
make samples && make basic-pbx
6) sed -i ‘s/ASTARGS=""/ASTARGS="-U asterisk"/g’ /usr/sbin/safe_asterisk

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