Freepbx install problem?

I have already installed Asterisk and it is running on my system. i could see it while typing ps -ef command.
But when i try to install freepbx so i this errors:
root@test-VirtualBox:/usr/local/src/freepbx# ./install -n
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…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

How can i fix this problem?

You say Asterisk is running, so did you try “ps aux” to find out who the owner is on the process? It should be asterisk. I’ll guess it’s running as root.

But root user can not run asterisk? Do I have to run asterisk as a asterisk user? How can I fix this problem?

I don’t honestly know how that could be better phrased. What about that is confusing?

Asterisk will run as whatever user/group you tell it to, you don’t say what OS you are using or how you installed it but the init script (/etc/init.d/asterisk) will usually give you a clue, Debian like systems “source” /etc/default/asterisk other deployments use other methods, but I am pretty sure that it is documented sufficiently in “your recipe”

i think I must change ownership of some files. which file’s ownership I must change?
I use Ubuntu 12.04

,still ı could not solve the problem.
When i type:

ps -ALf | grep asterisk

so there were many asterisk threads were started with “Asterisk” user(Left side of the output of the:ps -ALf | grep asterisk )
What am i doing wrong??? I can install asterisk easly but when i try to install freepnx so i get same error !!
My manual is:
cd /usr/src/
wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-13-current.tar.gz
tar -zxvf asterisk-13-current.tar.gz
cd asterisk-13.6.0/
sudo apt-get install uuid-dev
sudo apt-get install libjansson-dev
sudo apt-get install libmpg123-dev
sudo apt-get install mpg123
sudo apt-get install libao-dev
sudo apt-get install build-essential wget libssl-dev libncurses5-dev libnewt-dev libxml2-dev linux-headers-$(uname -r) libsqlite3-dev uuid-dev
sudo apt-get install asterisk-mp3
sudo apt-get install svn
sudo apt-get install subversion
contrib/scripts/install_prereq
contrib/scripts/get_mp3_source.sh
./configure --with-crypto --with-ssl --with-srtp
make
sudo make install
sudo make config
sudo make samples
sudo ldconfig
sudo update-rc.d -f asterisk remove

sudo asterisk -vvvvvvvvvvvvvvvvvvvvvcg

sudo useradd -m asterisk
sudo chown asterisk. /var/run/asterisk
sudo chown -R asterisk. /etc/asterisk
sudo chown -R asterisk. /var/{lib,log,spool}/asterisk
sudo chown -R asterisk. /usr/lib/asterisk
sudo rm -rf /var/www/html

sudo sed -i ‘s/(^upload_max_filesize = )./\120M/’ /etc/php5/apache2/php.ini
sudo cp /etc/apache2/apache2.conf /etc/apache2/apache2.conf_orig
sudo sed -i 's/^(User|Group).
/\1 asterisk/’ /etc/apache2/apache2.conf
sudo sed -i ‘s/AllowOverride None/AllowOverride All/’ /etc/apache2/apache2.conf
sudo service apache2 restart
sudo cat >> /etc/odbcinst.ini << EOF
[MySQL]
Description = ODBC for MySQL
Driver = /usr/lib/x86_64-linux-gnu/odbc/libmyodbc.so
Setup = /usr/lib/x86_64-linux-gnu/odbc/libodbcmyS.so
FileUsage = 1

EOF

sudo cat >> /etc/odbc.ini << EOF
[MySQL-asteriskcdrdb]
Description=MySQL connection to ‘asteriskcdrdb’ database
driver=MySQL
server=localhost
database=asteriskcdrdb
Port=3306
Socket=/var/run/mysqld/mysqld.sock
option=3

EOF

cd /usr/src/
wget http://mirror.freepbx.org/modules/packages/freepbx/freepbx-13.0-latest.tgz
tar vxfz freepbx-13.0-latest.tgz
cd freepbx
./start_asterisk start
root@test-VirtualBox:/usr/local/src/freepbx# ./install -n
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…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

Wait - what???

The ‘ps’ provide process status. You need to post what you are seeing for us to help you. You interpreting the output and telling us what you think is wrong is the same as you telling us what you think is wrong. Help us help you and just post the output.

Ok I will post output without interpreting. I will copy and paste whole output of the command.

when i type ps -ALf | grep asterisk so output is:
root@as:/usr/local/src/freepbx# ps -ALf | grep asterisk
asterisk 8062 1 8062 0 41 08:46 ? 00:00:00 /usr/sbin/asterisk -p -U asterisk
asterisk 8062 1 8064 0 41 08:46 ? 00:00:00 /usr/sbin/asterisk -p -U asterisk
asterisk 8062 1 8065 0 41 08:46 ? 00:00:00 /usr/sbin/asterisk -p -U asterisk
asterisk 8062 1 8066 0 41 08:46 ? 00:00:00 /usr/sbin/asterisk -p -U asterisk
asterisk 8062 1 8067 0 41 08:46 ? 00:00:00 /usr/sbin/asterisk -p -U asterisk
asterisk 8062 1 8068 0 41 08:46 ? 00:00:00 /usr/sbin/asterisk -p -U asterisk
asterisk 8062 1 8069 0 41 08:46 ? 00:00:00 /usr/sbin/asterisk -p -U asterisk
asterisk 8062 1 8070 0 41 08:46 ? 00:00:00 /usr/sbin/asterisk -p -U asterisk
asterisk 8062 1 8071 0 41 08:46 ? 00:00:00 /usr/sbin/asterisk -p -U asterisk
asterisk 8062 1 8072 0 41 08:46 ? 00:00:00 /usr/sbin/asterisk -p -U asterisk
asterisk 8062 1 8073 0 41 08:46 ? 00:00:00 /usr/sbin/asterisk -p -U asterisk
asterisk 8062 1 8074 0 41 08:46 ? 00:00:00 /usr/sbin/asterisk -p -U asterisk
asterisk 8062 1 8075 0 41 08:46 ? 00:00:00 /usr/sbin/asterisk -p -U asterisk
asterisk 8062 1 8079 0 41 08:46 ? 00:00:00 /usr/sbin/asterisk -p -U asterisk
asterisk 8062 1 8085 0 41 08:46 ? 00:00:00 /usr/sbin/asterisk -p -U asterisk
asterisk 8062 1 8086 0 41 08:46 ? 00:00:00 /usr/sbin/asterisk -p -U asterisk
asterisk 8062 1 8087 0 41 08:46 ? 00:00:00 /usr/sbin/asterisk -p -U asterisk
asterisk 8062 1 8088 0 41 08:46 ? 00:00:00 /usr/sbin/asterisk -p -U asterisk
asterisk 8062 1 8089 0 41 08:46 ? 00:00:00 /usr/sbin/asterisk -p -U asterisk
asterisk 8062 1 8090 0 41 08:46 ? 00:00:00 /usr/sbin/asterisk -p -U asterisk
asterisk 8062 1 8091 0 41 08:46 ? 00:00:00 /usr/sbin/asterisk -p -U asterisk
asterisk 8062 1 8092 0 41 08:46 ? 00:00:00 /usr/sbin/asterisk -p -U asterisk
asterisk 8062 1 8093 0 41 08:46 ? 00:00:00 /usr/sbin/asterisk -p -U asterisk
asterisk 8062 1 8094 0 41 08:46 ? 00:00:00 /usr/sbin/asterisk -p -U asterisk
asterisk 8062 1 8095 0 41 08:46 ? 00:00:00 /usr/sbin/asterisk -p -U asterisk
asterisk 8062 1 8096 0 41 08:46 ? 00:00:00 /usr/sbin/asterisk -p -U asterisk
asterisk 8062 1 8097 0 41 08:46 ? 00:00:00 /usr/sbin/asterisk -p -U asterisk
asterisk 8062 1 8098 0 41 08:46 ? 00:00:02 /usr/sbin/asterisk -p -U asterisk
asterisk 8062 1 8099 0 41 08:46 ? 00:00:00 /usr/sbin/asterisk -p -U asterisk
asterisk 8062 1 8100 0 41 08:46 ? 00:00:00 /usr/sbin/asterisk -p -U asterisk
asterisk 8062 1 8101 0 41 08:46 ? 00:00:00 /usr/sbin/asterisk -p -U asterisk
asterisk 8062 1 8102 0 41 08:46 ? 00:00:00 /usr/sbin/asterisk -p -U asterisk
asterisk 8062 1 8103 0 41 08:46 ? 00:00:00 /usr/sbin/asterisk -p -U asterisk
asterisk 8062 1 8104 0 41 08:46 ? 00:00:00 /usr/sbin/asterisk -p -U asterisk
asterisk 8062 1 8105 0 41 08:46 ? 00:00:00 /usr/sbin/asterisk -p -U asterisk
asterisk 8062 1 8106 0 41 08:46 ? 00:00:00 /usr/sbin/asterisk -p -U asterisk
asterisk 8062 1 8107 0 41 08:46 ? 00:00:00 /usr/sbin/asterisk -p -U asterisk
asterisk 8062 1 8108 0 41 08:46 ? 00:00:00 /usr/sbin/asterisk -p -U asterisk
asterisk 8062 1 8109 0 41 08:46 ? 00:00:00 /usr/sbin/asterisk -p -U asterisk
asterisk 8062 1 8110 0 41 08:46 ? 00:00:00 /usr/sbin/asterisk -p -U asterisk
asterisk 8062 1 8113 0 41 08:46 ? 00:00:00 /usr/sbin/asterisk -p -U asterisk
asterisk 8063 8062 8063 0 1 08:46 ? 00:00:00 astcanary /var/run/asterisk/alt.asterisk.canary.tweet.tweet.tweet 8062
asterisk 21240 21235 21240 0 1 09:06 ? 00:00:00 /usr/sbin/apache2 -k start
asterisk 21241 21235 21241 0 1 09:06 ? 00:00:00 /usr/sbin/apache2 -k start
asterisk 21242 21235 21242 0 1 09:06 ? 00:00:00 /usr/sbin/apache2 -k start
asterisk 21243 21235 21243 0 1 09:06 ? 00:00:00 /usr/sbin/apache2 -k start
asterisk 21244 21235 21244 0 1 09:06 ? 00:00:00 /usr/sbin/apache2 -k start
root 22324 2564 22324 0 1 09:20 pts/2 00:00:00 grep --color=auto asterisk

That is an ALARMING number of asterisk instances.

Reboot, start one of them, and try again.

How did you understand alarming number from my ps - ALf output?

There should never be more than 1 of these:

You have 5.

You should never have more than 1 of these:

You have 41.

This is especially true since you are running in “high priority mode”. One of them will run at high priority because of being paired with astcanary, but not all 40+ of them.

How did you understand high priority mode?from which parameter?or parameters?

No, there’s not an alarming number of Asterisk processess. There’s only one - process id 8062. The extra lines that @cynjut can see are threads inside that process.

Also, ‘safe_asterisk’ isn’t running, so something’s starting asterisk incorrectly. Stop it, run ./start_asterisk (as the instructions say), and it should be fine.

The normal command is ps auxw | grep asterisk - it is case sensitive, and it depends on not having a minus in front of it.

hola buena noche a todos, he estado tratando de resolver el “mismo problema” pero he seguido sus indicaciones al pie de la letra y no ha funcionado sigo con el mismo problema, gracias por la atencion:

STARTING ASTERISK
Asterisk is already running
[root@CentosOS7A01 freepbx]# ./install -n
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…Error!
Error communicating with Asterisk. Ensure that Asterisk is properly installed and running as the asterisk user
Asterisk appears to be running as root
Try starting Asterisk with the ‘./start_asterisk start’ command in this directory

Usted está comenzando ‘asterisk’ incorrectamente. Está ejecutando ‘asterisk’ como ‘root’ y debe ejecutarse propiedad del usuario ‘asterisk’. Por favor, detenga ‘asterisk’ y reinicie usando ‘fwconsole start’.