raspberry pi with lighttpd, php7 and magento webshop -
i setup raspberry pi lighttpd, php7 , magento. unfortunately after unpack magento /var/www/html internal server error when open webinterface setup.
this steps did far:
- put raspbian jessie lite on rasberry pi 3
install lighttpd
apt install lighttpd -y
because php 7 not available in jessie repo new stretch repo:
echo "deb http://httpredir.debian.org/debian stretch main contrib non-free" | tee /etc/apt/sources.list.d/debian-stretch.list apt install php7.0 php7.0-fpm -t stretch rm /etc/apt/sources.list.d/debian-stretch.list apt-get update -y
next need enable fastcgi , tell lighttpd find php.
tee /etc/lighttpd/conf-enabled/php.conf > /dev/null <<eof fastcgi.server += (".php" => (( "socket" => "/var/run/php/php7.0-fpm.sock" ))) eof lighttpd-enable-mod fastcgi lighttpd-enable-mod fastcgi-php /etc/init.d/lighttpd force-reload
install mysql , create magento db 1 user
apt-get install mysql-server apt-get install mysql-client mysql -u root -p create database magento; create user magento_user@localhost identified 'password'; grant privileges on magento.* magento_user@localhost identified 'password'; flush privileges; exit
unpack magento. in winscp copied tar.gz file manually /home/magento
mkdir /home/magento tar xzvf /home/magento/magento-ce-2.1.6-2017-03-29-01-08-05.tar.gz -c /home/magento apt-get install rsync sudo rsync -avp /home/magento/. /var/www/html/
opening website http://192.168.2.103 raises 500 internal server error.
see error log. dont know if these right errors...
cat /var/log/lighttpd/error.log 2017-04-14 12:58:45: (mod_fastcgi.c.2702) fastcgi-stderr: php message: php fatal error: uncaught magento\framework\exception\filesystemexception: file "/var/www/html/var/.regenerate" cannot deleted warning!unlink(/var/www/html/var/.regenerate): permission denied in /var/www/html/vendor/magento/framework/filesystem/driver/file.php:382 2017-04-14 12:58:45: (mod_fastcgi.c.2702) fastcgi-stderr: stack trace: 2017-04-14 12:58:45: (mod_fastcgi.c.2702) fastcgi-stderr: #0 /var/www/html/vendor/magento/framework/filesystem/directory/write.php(172): magento\framework\filesystem\driver\file->deletefile('/var/www/html/v...') 2017-04-14 12:58:45: (mod_fastcgi.c.2702) fastcgi-stderr: #1 /var/www/html/vendor/magento/framework/code/generatedfiles.php(98): magento\framework\filesystem\directory\write->delete('/var/.regenerat...') 2017-04-14 12:58:45: (mod_fastcgi.c.2702) fastcgi-stderr: #2 /var/www/html/vendor/magento/framework/app/objectmanagerfactory.php(114): magento\framework\code\generatedfiles->cleangeneratedfiles() 2017-04-14 12:58:45: (mod_fastcgi.c.2702) fastcgi-stderr: #3 /var/www/html/vendor/magento/framework/app/bootstrap.php(385): magento\framework\app\objectmanagerfactory->create(array) 2017-04-14 12:58:45: (mod_fastcgi.c.2702) fastcgi-stderr: #4 /var/www/html/vendor/magento/framework/app/bootstrap.php(362): magento\framework\app\bootstrap->initobjectmanager() 2017-04-14 12:58:45: (mod_fastcgi.c.2702) fastcgi-stderr: #5 /var/www/html/vendor/magento/framewor...
i followed following tutorials far:
after sitting here whole day found way working.
i achieved install following on raspberry pi 3:
- lighttpd (version 1.4.35)
- php7.0 (7.0.16-3)
- mysql (ver 14.14 distrib 5.7.17, linux (armv7l))
- magento 2 webshop (magento-ce-2.1.5-2017-02-20-05-04-55.zip)
this actions do:
- put raspbian jessie lite on rasberry pi 3
install lighttpd
apt install lighttpd -y
because php 7 not available in jessie repo new stretch repo:
echo "deb http://httpredir.debian.org/debian stretch main contrib non-free" | tee /etc/apt/sources.list.d/debian-stretch.list apt install php7.0 php7.0-fpm apt php7.0-xml php7.0-curl php7.0-mcrypt php7.0-intl php7.0-mbstring php7.0-zip php7.0-gd php7.0-mysql -t stretch rm /etc/apt/sources.list.d/debian-stretch.list apt-get update -y
next need enable fastcgi , tell lighttpd find php.
tee /etc/lighttpd/conf-enabled/php.conf > /dev/null <<eof fastcgi.server += (".php" => (( "socket" => "/var/run/php/php7.0-fpm.sock" ))) eof lighttpd-enable-mod fastcgi lighttpd-enable-mod fastcgi-php /etc/init.d/lighttpd force-reload
magento needs mysql-5.6 or higher it's not in raspbian repo. following code install version 5.7:
wget http://ftp.debian.org/debian/pool/main/m/mysql-5.7/libmysqlclient-dev_5.7.17-1_armhf.deb wget http://ftp.debian.org/debian/pool/main/m/mysql-5.7/libmysqlclient20_5.7.17-1_armhf.deb wget http://ftp.debian.org/debian/pool/main/m/mysql-5.7/libmysqld-dev_5.7.17-1_armhf.deb wget http://ftp.debian.org/debian/pool/main/m/mysql-5.7/mysql-client-5.7_5.7.17-1_armhf.deb wget http://ftp.debian.org/debian/pool/main/m/mysql-5.7/mysql-client-core-5.7_5.7.17-1_armhf.deb wget http://ftp.debian.org/debian/pool/main/m/mysql-5.7/mysql-server-5.7_5.7.17-1_armhf.deb wget http://ftp.debian.org/debian/pool/main/m/mysql-5.7/mysql-server-core-5.7_5.7.17-1_armhf.deb wget http://ftp.debian.org/debian/pool/main/m/mecab/libmecab2_0.996-3_armhf.deb wget http://ftp.debian.org/debian/pool/main/m/mysql-defaults/mysql-common_5.8+1.0.2_all.deb wget http://ftp.debian.org/debian/pool/main/l/lz4/liblz4-1_0.0~r131-2+b1_armhf.deb sudo apt install libaio1 libaio-dev libhtml-template-perl libevent-core-2.0-5 sudo dpkg -i libmecab2_0.996-3_armhf.deb sudo dpkg -i liblz4-1_0.0~r131-2+b1_armhf.deb sudo dpkg -i mysql-common_5.8+1.0.2_all.deb sudo dpkg -i mysql-client-core-5.7_5.7.17-1_armhf.deb sudo dpkg -i mysql-client-5.7_5.7.17-1_armhf.deb sudo dpkg -i mysql-server-core-5.7_5.7.17-1_armhf.deb sudo dpkg -i mysql-server-5.7_5.7.17-1_armhf.deb apt-get update -y/
create magento db 1 user (needed later magento web installer)
mysql -u root -p create database magento; create user magento_user@localhost identified 'password123'; grant privileges on magento.* magento_user@localhost identified 'password'; flush privileges; exit
unpack magento. in winscp copied tar.gz file manually /home/magento
mkdir /home/magento tar xzvf /home/magento/magento-ce-2.1.6-2017-03-29-01-08-05.tar.gz -c /home/magento apt-get install rsync sudo rsync -avp /home/magento/. /var/www/html/
- set permissions (attention! not productiv use! see official site setting permissions right:)
http://devdocs.magento.com/guides/v2.0/install-gde/prereq/file-system-perms.html
chmod -r 777 /var/www/html
- opening webshop url (enter ip of raspberry pi in webbrowser) , finish magento web installer.
for me helpful open second putty session , observing lighttpd error.log detect errors following command:
tail -f /var/log/lighttpd/error.log
please feel free give advices better or faster.
maybe can tell me how fix mistake permissions , set right ones ;)
sources:
https://www.raspberrypi.org/forums/viewtopic.php?f=29&t=162960,
Comments
Post a Comment