Post
Topic
Board Mining (Altcoins)
Re: [Minera v0.7.0] Your next mining dashboard - Networked/CPUminer/CGminer/BFGminer
by
paintballer4lfe
on 16/11/2016, 21:26:44 UTC
when you installed minera did you use Ubuntu 16 ?.  if so, the problem may be with the PHP in Ubuntu 16 you have use php 7.0 . i was having kind of the same issue . I made up my own install_minera.sh
 and do manual installs no issue now  but one bfg doesn't auto start but no big deal, i just  haven't got around to fixing it . here's is my install_minera.sh

with the corrected php for Ubuntu 16.4.1 installs. my install_minera.sh file installs no mining software other then maybe cpuminer, i replace BFG with my own version with the cp command.


Code:
#!/bin/bash
# This is the main install script for Minera https://github.com/michelem09/minera
# This script, as Minera, is intended to be used on a Debian-like system

echo -e "-----\nSTART Minera Install script\n-----\n"

echo -e "-----\nInstall extra packages\n-----\n"
apt-get -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" install -y build-essential libtool libcurl4-openssl-dev libjansson-dev libudev-dev libncurses5-dev autoconf automake postfix redis-server git screen php7.0-cli php7.0-curl php7.0-fpm php7.0-readline php7.0-json wicd-curses uthash-dev libmicrohttpd-dev libevent-dev libusb-1.0-0-dev libusb-dev libblkmaker-0.1-dev shellinabox supervisor lighttpd

echo -e "Adding Minera user\n-----\n"
adduser minera --gecos "" --disabled-password
echo "minera:minera" | chpasswd

echo -e "Adding groups to Minera\n-----\n"
usermod -a -G dialout,plugdev,tty,www-data minera

echo -e "Adding sudoers configuration for www-data and minera users\n-----\n"
echo -e "\n#Minera settings\nminera ALL = (ALL) NOPASSWD: ALL\nwww-data ALL = (ALL) NOPASSWD: ALL" >> /etc/sudoers

MINER_OPT="--gc3355-detect --gc3355-autotune --freq=850 -o stratum+tcp://ltc.ghash.io:3333 -u michelem.minera -p x --retries=1"
MINER_BIN=`pwd`"/minera-bin/"
MINERA_LOGS="/var/log/minera"
MINERA_CONF=`pwd`"/conf"
MINERA_OLD_LOGS=`pwd`"/application/logs"

echo -e "Adding SSL certificate\n-----\n"
mkdir /etc/lighttpd/certs
cp $MINERA_CONF/lighttpd.pem /etc/lighttpd/certs/
chmod 400 /etc/lighttpd/certs/lighttpd.pem

echo -e "Copying Lighttpd conf\n-----\n"
cp $MINERA_CONF/lighttpd.conf /etc/lighttpd/
cp $MINERA_CONF/10-fastcgi.conf /etc/lighttpd/conf-available/10-fastcgi.conf
cp $MINERA_CONF/15-php7.0-fpm.conf /etc/lighttpd/conf-available/15-php7.0-fpm.conf
ln -s /etc/lighttpd/conf-available/10-fastcgi.conf /etc/lighttpd/conf-enabled/10-fastcgi.conf
ln -s /etc/lighttpd/conf-available/15-php7.0-fpm.conf  /etc/lighttpd/conf-enabled/15-php7.0-fpm.conf
service lighttpd restart

echo -e "Playing with minera dirs\n-----\n"
chown -R minera.minera `pwd`
mkdir -p $MINERA_LOGS
chmod 777 $MINERA_LOGS
chmod 777 $MINERA_CONF
chmod 777 minera-bin/cgminerStartupScript
chown -R minera.minera $MINERA_LOGS
rm -rf $MINERA_OLD_LOGS
ln -s $MINERA_LOGS $MINERA_OLD_LOGS

echo -e "Adding Minera logrotate\n-----\n"
cp `pwd`"/minera.logrotate" /etc/logrotate.d/minera
service rsyslog restart

echo -e "Adding default startup settings to redis\n-----\n"
echo -n $MINER_OPT | redis-cli -x set minerd_settings
echo -n "70e880b1effe0f770849d985231aed2784e11b38" | redis-cli -x set minera_password
echo -n "1" | redis-cli -x set guided_options
echo -n "0" | redis-cli -x set manual_options
echo -n "1" | redis-cli -x set minerd_autodetect
echo -n "1" | redis-cli -x set anonymous_stats
echo -n "cpuminer" | redis-cli -x set minerd_software
echo -n '["132","155","3"]' | redis-cli -x set dashboard_coin_rates
echo -e '[{"url":"stratum+tcp://ltc.ghash.io:3333","username":"michelem.minera","password":"x"}]'  | redis-cli -x set minerd_pools

echo -e "Adding minera startup command to rc.local\n-----\n"
chmod 777 /etc/rc.local

RC_LOCAL_CMD='su - minera -c "/usr/bin/screen -dmS cpuminer '$MINER_BIN'minerd '$MINER_OPT'"\nexit 0'

sed -i.bak "s/exit 0//g" /etc/rc.local

echo -e $RC_LOCAL_CMD >> /etc/rc.local

echo -e "Adding cron file in /etc/cron.d\n-----\n"

echo -e "*/1 * * * * www-data php `pwd`/index.php app cron" > /etc/cron.d/minera

echo -e "Configuring shellinabox\n-----\n"
sudo cp conf/shellinabox /etc/default/
sudo service shellinabox restart

echo -e "Copying cg/bfgminer udev rules\n-----\n"
sudo cp conf/01-cgminer.rules /etc/udev/rules.d/
sudo cp conf/70-bfgminer.rules /etc/udev/rules.d/
sudo service udev restart

echo -e "Installing NVM and Node requirements\n-----\n"
su - minera -c /var/www/minera/install_nvm.sh

echo -e "Installing libblkmaker\n-----\n"
LIBCOUNT=`strings -n5 /etc/ld.so.cache|grep -i libblkmaker|wc -l`
if [ $LIBCOUNT -lt 2 ];
then
cd minera-bin/src/libblkmaker
sudo make install
sudo ldconfig
fi

echo -e "Generating unique SSH keys\n-----\n"
sudo rm /etc/ssh/ssh_host_*
sudo dpkg-reconfigure openssh-server
sudo service ssh restart

echo -e "Building miners, this will take loooooooot of time in a low resource system, I strongly suggest you to take a beer (better two) and relax a while. Your Minera will be ready after this.\n-----\n"
su - minera -c /var/www/minera/build_miner.sh

echo -e 'DONE! Minera is ready!\n\nOpen the URL: http://'$(hostname -I | tr -d ' ')'/minera/\n\nAnd happy mining!\n'

I manually install minera on any PI type Or PC, i can install Ubuntu 16 on and not just RPI's, like this :.

Code:
sudo apt-get update
sudo apt-get upgrade



sudo apt-get install -y lighttpd php7.0-cgi
sudo lighty-enable-mod fastcgi-php
sudo lighty-enable-mod fastcgi
sudo service lighttpd force-reload

sudo apt-get install -y redis-server git screen php7.0-cli php7.0-curl libblkmaker-0.1-dev

cd /var/www
sudo git clone https://github.com/michelem09/minera
cd /var/www/minera

sudo ./install_minera.sh

replace the install_minera.sh file

before you do this:

Code:
sudo ./install_minera.sh

here:

Code:
cd /var/www/minera



It is 16.04, i tried your modified install and php7 but it just shells out refused connection and errors, i'm going to play around with it a little more but for the mean time i spun up a 14.04 server that i'll see if it changes/works on it. I don't care what version it goes on i just want it to work.