Cкачал последнюю версию playSMS с http://sourceforge.net/projects/playsms/ в /usr/local/src
# cd /usr/local/src # wget http://downloads.sourceforge.net/project/playsms/playsms/Version%200.9.9.2/playsms-0.9.9.2.tar.gz
Распаковал архив
# tar -zxvf playsms-0.9.9.2.tar.gz -C /usr/local/src
Создаю каталоги и меняю их владельца
mkdir -p /usr/local/www/playsms/ mkdir -p /var/spool/playsms mkdir -p /var/log/playsms chown -R www /usr/local/www/playsms/ chown -R www /var/spool/playsms chown -R www /var/log/playsms
Скопировал фалы из папки web в папку web сервера и изменил владельца
# cp -r /usr/local/src/playsms-0.9.9.2/web/* /usr/local/www/playsms/ # chown -R www /usr/local/www/playsms/ # cp -r /usr/local/src/playsms-0.9.9.2/daemon/linux/bin/_playsms/playsmsd* /usr/local/bin/ # cp -r /usr/local/src/playsms-0.9.9.2/daemon/linux/etc/playsms /usr/local/etc/playsms
В файле /usr/local/etc/playsms/playsms указал пути каталогов.
# cat /usr/local/etc/playsms/playsms PLAYSMS_PATH=/usr/local/www/playsms PLAYSMS_BIN=/usr/local/bin PLAYSMS_LOG=/var/log/playsms PLAYSMS_SPOOL=/var/spool/playsms PLAYSMS_LIB=/var/lib/playsms
Создаю базу данных для playsms и копирую в неё таблицы из шаблона.
# mysqladmin -u root -p create playsms # mysql -u root -p playsms < /usr/local/src/playsms-9.9.2/db/playsms.sql
Копирую config-dist.php в config.php и редактирую
# cp /usr/local/www/playsms/config-dist.php /usr/local/www/playsms/config.php
<?php // PHP PEAR DB compatible database engine: // msql, mssql, mysql, oci8, odbc, pgsql, sqlite $core_config['db']['type'] = 'mysql'; // database engine $core_config['db']['host'] = 'localhost'; // database host/server $core_config['db']['port'] = '3306'; // database port $core_config['db']['user'] = 'root'; // database username $core_config['db']['pass'] = 'my_password_for_mysql_root_user'; // database password $core_config['db']['name'] = 'playsms'; // database name $core_config['db']['pref'] = 'playsms'; // table's prefix without trailing underscore // SMTP configuration $core_config['smtp']['relm'] = ''; // yes, not realm, its relm $core_config['smtp']['user'] = ''; $core_config['smtp']['pass'] = ''; $core_config['smtp']['host'] = 'localhost'; $core_config['smtp']['port'] = '25'; // Do not change anything below this line unless you know what to do // ----------------------------------------------------------------- // you can turn on or off PHP error reporting // on production level you should turn off PHP error reporting (set to 0), by default its on //error_reporting(0); //error_reporting(E_ALL ^ (E_NOTICE | E_WARNING | E_DEPRECATED)); error_reporting(E_ALL ^ (E_NOTICE | E_WARNING)); // logs directories $apps_path['logs'] = '/var/log/playsms'; // log level: 0=disabled, 1=info, 2=warning, 3=debug, 4=verbose // WARNING: log level 3 and 4 will also save sensitif information such as password for used gateway $core_config['logstate'] = 0; // 0 for single session login; 1 for multi session login // multi session login is not secure because playsms leaves md5 crypted username and password // on admin's computer $core_config['multilogin'] = 0; // are we using http or https ? the default is using http instead https $core_config['ishttps'] = false; ?>
В скриптах из папки /usr/local/src/playsms-0.9.9.2/daemon/linux/bin/* правлю . /etc/default/playsms на . /usr/local/etc/playsms/playsms
Копирую
# cp -r # cp -r /usr/local/src/playsms-0.9.9.2/daemon/linux/bin/* /usr/local/bin/ /usr/local/bin # ls -l | grep playsms drwxrwxr-x 2 1000 1000 512 23 мар 17:53 _playsms -rwxrwxr-x 1 root wheel 426 23 мар 15:54 playsmsd_start -rwxrwxr-x 1 root wheel 223 30 мар 23:27 playsmsd_stop # cp /usr/local/src/playsms-0.9.9.2/daemon/linux/etc/playsms /usr/local/etc/playsms/
Редактирую файл /usr/local/etc/playsms/playsms
PLAYSMS_PATH=/usr/local/www/playsms PLAYSMS_BIN=/usr/local/bin PLAYSMS_LOG=/var/log/playsms PLAYSMS_SPOOL=/var/spool/playsms PLAYSMS_LIB=/var/lib/playsms
Для автоматического старта playSMS при загрузке системы, добавляю в /etc/rc.local строку
/usr/local/bin/playsmsd_start
Т.к. в скриптах playSMS используется bash, а во FreeBSD он по умолчанию ставиться в /usr/local/bin/bash, то для нормальной работы скриптов я создал символичекую ссылку
# ln -s /usr/local/bin/bash /bin/bash
Для запуска playSMS использую команду
/usr/local/bin/playsmsd_start
Проверить стартовал ли playSMS можно так
ps -ax | grep playsms 83349 ?? R 0:00,11 /usr/local/bin/php -q /usr/local/bin/_playsms/sendsmsd.php /usr/local/www/playsms _GETQUEUE_ 83353 ?? R 0:00,21 /usr/local/bin/php -q /usr/local/bin/_playsms/playsmsd.php /usr/local/www/playsms 83355 ?? R 0:00,23 /usr/local/bin/php -q /usr/local/bin/_playsms/dlrssmsd.php /usr/local/www/playsms 44385 3- S 7:06,20 /bin/bash ./_playsms/playsmsd /usr/local/www/playsms 44388 3- S 7:06,80 /bin/bash ./_playsms/recvsmsd /usr/local/www/playsms 44392 3- S 4:16,99 /bin/bash ./_playsms/sendsmsd /usr/local/www/playsms 44398 3- S 6:40,66 /bin/bash ./_playsms/dlrssmsd /usr/local/www/playsms
Для работы вэба добавляю в httpd.conf строки
Alias /playsms "/usr/local/www/playsms/" <Directory "/usr/local/www/playsms/"> Order deny,allow Allow from all </Directory>
И перезапускаю apache
# /usr/local/etc/rc.d/apache22 restart
Теперь можно в браузере набрать http://<IP адрес сервера>/playsms/
логин-пароль по умолчанию
username: admin
password: admin
Ссылки:
https://github.com/antonraharja/playSMS/blob/9941f2bd546f56eef5bfe2fba85d00332a2b488f/web/docs/INSTALL
http://compiling.ru/solutions/installyaciya-playsms-i-sms-server-tools-2/
https://groups.google.com/forum/#!topic/playsmsusergroup/AIHlr6dLoJ0