getminera / minera

Minera is a web interface to monitor and manage mining devices
http://getminera.com
Other
374 stars 156 forks source link

Manual install of version 0.8.1 #190

Closed jugOS-19 closed 6 years ago

jugOS-19 commented 6 years ago

After some errors with the image (kernel panics and networks issues) in my rPi3, I tried the manual install as instructed in the web page. Having some experience in Linux systems, I noticed there are no error checking in the script so I did it manually line by line. Doing this, I realized that lines 34 through 36 give errors that unfortunately I am not able to solve... maybe it has something to do with adding the extension ".php" in the .conf files

michelem09 commented 6 years ago

My suggestion start from the latest image https://getminera.com/download/latest Manual install requires you know what the script is doing and a clean system.

jugOS-19 commented 6 years ago

It was the latest image a couple of weeks ago, but I will try downloading it again. The manual install was done in a clean system (fresh raspbian install) and I do know what the script is doing; That's how I know that those lines are causing some trouble in the script.

michelem09 commented 6 years ago

What Raspbian version? You need Stretch.

jugOS-19 commented 6 years ago

Thanks for the quick replies :) Also the latest image available from the raspberrypi.org site:

RASPBIAN STRETCH LITE Minimal image based on Debian Stretch Version:September 2017 Release date:2017-09-07

boxofdeath commented 6 years ago

I am having a similar issue getting the manual install to work. I did some digging and the script fails at a few points. The first point of failure is under 'Install extra packages' it fails at 'libblkmaker-0.1-dev' this package is only for Jessie and there is no alternative pkg in Stretch.

Next error is:

Copying Lighttpd conf 
ln: failed to create symbolic link '/etc/lighttpd/conf-enabled/10-fastcgi.conf': File exists

chmod: cannot access '/etc/rc.local': No such file or directory
sed: can't read /etc/rc.local: No such file or directory

Configuring shellinabox
-----
Failed to restart shellinabox.service: Unit shellinabox.service not found.
Failed to restart supervisor.service: Unit supervisor.service not found.

Further digging led me to look at why lighttpd wasn't starting (journalctl -xe)

Nov 30 13:57:18 n8deb lighttpd[14694]: Duplicate array-key '.php'
Nov 30 13:57:18 n8deb lighttpd[14694]: 2017-11-30 13:57:18: (configfile.c.1154) source: /etc/lighttpd/conf-enabled/15-php-fpm.conf line: 10 pos: 1 parser failed
Nov 30 13:57:18 n8deb lighttpd[14694]: 2017-11-30 13:57:18: (configfile.c.1154) source: /usr/share/lighttpd/include-conf-enabled.pl line: 4 pos: 1 parser failed
Nov 30 13:57:18 n8deb lighttpd[14694]: 2017-11-30 13:57:18: (configfile.c.1154) source: /etc/lighttpd/lighttpd.conf line: 73 pos: 1 parser failed somehow near 
Nov 30 13:57:18 n8deb systemd[1]: lighttpd.service: Control process exited, code=exited status=255
Nov 30 13:57:18 n8deb systemd[1]: Failed to start Lighttpd Daemon.

It looks like there is an issue with one of these 3x files.

michelem09 commented 6 years ago

Thanks for feedback I think in the weekend I will put my hands on this too. I'd like to release the 0.9.0 version very soon with L3/D3 and luckily S9 support within the manual install fixes.

boxofdeath commented 6 years ago

I am digging into it right now. I'll post any advancements.

michelem09 commented 6 years ago

Hello guys, I should have fixed the manual install, is you update the git code and retry should work:

cd /var/www/minera
sudo git fetch --all && sudo git reset --hard origin/master
sudo ./install_minera.sh
boxofdeath commented 6 years ago

My issue still persists with v0.9.0 lighttpd does not start properly

lighttpd.service: Service hold-off time over, scheduling restart. Stopped Lighttpd Daemon. Starting Lighttpd Daemon... Duplicate array-key '.php' 2017-12-04 15:07:10: (configfile.c.1154) source: /etc/lighttpd/conf-enabled/15-php-fpm.conf line: 10 pos: 1 parser failed somehow near here: (EOL) 2017-12-04 15:07:10: (configfile.c.1154) source: /usr/share/lighttpd/include-conf-enabled.pl line: 4 pos: 1 parser failed somehow near here: (EOL) 2017-12-04 15:07:10: (configfile.c.1154) source: /etc/lighttpd/lighttpd.conf line: 73 pos: 1 parser failed somehow near here: (EOL) lighttpd.service: Control process exited, code=exited status=255 Failed to start Lighttpd Daemon. lighttpd.service: Unit entered failed state. lighttpd.service: Failed with result 'exit-code'.

boxofdeath commented 6 years ago

Figured it out.

FastCGI installs a default config file in /etc/lighttpd/conf-enabled/15-fastcgi-php.conf Once I removed this lighttpd started up just fine.

My next issue resided in not having 'supervisor' installed. You should add that to the list of apt dependencies. 👍

Finally I noticed nodejs / nvm wasn't being installed properly either. I followed the install instructions from nodejs and nvm's website. You need to run . $HOME/.bashrc after installing so that your bash session recognizes the new environment variables.

# Using Ubuntu
curl -sL https://deb.nodesource.com/setup_9.x | sudo -E bash -
sudo apt-get install -y nodejs
# Using Debian, as root
curl -sL https://deb.nodesource.com/setup_9.x | bash -
apt-get install -y nodejs

#install nvm
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.6/install.sh | bash

. $HOME/.bashrc

SOURCES: https://github.com/nodesource/distributions#deb https://github.com/creationix/nvm#install-script

michelem09 commented 6 years ago

Well, this https://github.com/getminera/minera/blob/master/install_nvm.sh#L5 should do it May be you had a mess installation, I will try again from a clean Raspbian.

jugOS-19 commented 6 years ago

Thanks for all the great work :)

There is a lot of stuff in the original fastcgi-php.conf. Is it ok to just remove it? Maybe just replace the lines that are redundant...

boxofdeath commented 6 years ago

@jugOS-19 just remove the 15-php-fpm.conf file. It is redundant because of the contents of 15-fastcgi-php.conf

Just make sure the socket is to a valid path.

15-php-fpm.conf
fastcgi.server += ( ".php" =>
        ((
                **"socket" => "/var/run/php/php7.0-fpm.sock",**
                "broken-scriptfilename" => "enable"
        ))
)
15-fastcgi-php.conf
fastcgi.server += ( ".php" => 
    ((
        "bin-path" => "/usr/bin/php-cgi",
        **"socket" => "/var/run/lighttpd/php.socket",**
        "max-procs" => 1,
        "bin-environment" => ( 
            "PHP_FCGI_CHILDREN" => "4",
            "PHP_FCGI_MAX_REQUESTS" => "10000"
        ),
        "bin-copy-environment" => (
            "PATH", "SHELL", "USER"
        ),
        "broken-scriptfilename" => "enable"
    ))
)