Pass2PHP

Moderator: leecollings

ropske
Posts: 483
Joined: Tuesday 12 August 2014 5:37
Target OS: Raspberry Pi / ODroid
Domoticz version: V3_8394
Location: Rumbeke,Belgium
Contact:

Re: Pass2PHP

Post by ropske »

waaren wrote: Thursday 14 May 2020 22:18
ropske wrote: Thursday 14 May 2020 22:02 seems it must be installed from source on debian buster:
sudo apt install phpmyadmin should do it.

stijn@debian:~$ sudo apt install phpmyadmin
[sudo] password for stijn:
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package phpmyadmin
Trigun
Posts: 390
Joined: Wednesday 30 November 2016 11:58
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.10717
Contact:

Re: Pass2PHP

Post by Trigun »

Why do you want to install MySQL? Mariadb is also working since MySQL is deprecated in buster. If I remember tomorrow morning I’ll post my “how to” for buster I also have a “how to” for setting up domoticz on a vm. I’ll share it so hopefully it will help you


Sent from my iPhone using Tapatalk
ropske
Posts: 483
Joined: Tuesday 12 August 2014 5:37
Target OS: Raspberry Pi / ODroid
Domoticz version: V3_8394
Location: Rumbeke,Belgium
Contact:

Re: Pass2PHP

Post by ropske »

Trigun wrote: Thursday 14 May 2020 22:45 Why do you want to install MySQL? Mariadb is also working since MySQL is deprecated in buster. If I remember tomorrow morning I’ll post my “how to” for buster I also have a “how to” for setting up domoticz on a vm. I’ll share it so hopefully it will help you


Sent from my iPhone using Tapatalk
thank you so much mate!
User avatar
Egregius
Posts: 2592
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: v2024.7
Location: Beitem, BE
Contact:

Re: Pass2PHP

Post by Egregius »

Several users have wrote their how-to's in this topic. They're linked from the readme at Github: https://github.com/Egregius/PHP-Floorpl ... r-Domoticz
I never use a full image, only the net installer. It's easier to add what you need than to remove what you don't need.
https://cdimage.debian.org/debian-cd/cu ... etinst.iso

Btw, phpmyadmin can be installed by downloading a zip file from https://www.phpmyadmin.net/downloads/
That way you have control where it's installed and you can secure it. Definitely don't expose phpmyadmin to the internet. I have it my secure folder wich is secured in the virtual hosts file of Apache2:

Code: Select all

	<Directory /var/www/html/secure>
		order deny,allow
		allow from 127.0.0.1
		SetEnvIf X-Forwarded-For ^192\.168\.2\.50 allow
		SetEnvIf X-Forwarded-For ^192\.168\.2\.51 allow
		Allow from env=allow
		allow from 192.168.2.20
		allow from 192.168.2.50
		Deny from All
		AllowOverride None
	</Directory>
The "SetEnvIf X-Forwarded-For" is needed because I access the webserver thru HAProxy.

A great advantage you have now is that you can easily run a second VM to try stuff without messing up the first one.
ropske
Posts: 483
Joined: Tuesday 12 August 2014 5:37
Target OS: Raspberry Pi / ODroid
Domoticz version: V3_8394
Location: Rumbeke,Belgium
Contact:

Re: Pass2PHP

Post by ropske »

Trigun wrote: Thursday 14 May 2020 22:45 Why do you want to install MySQL? Mariadb is also working since MySQL is deprecated in buster. If I remember tomorrow morning I’ll post my “how to” for buster I also have a “how to” for setting up domoticz on a vm. I’ll share it so hopefully it will help you


Sent from my iPhone using Tapatalk
You found anything for me mate?
Is it the same for Debian Buster as for other Debian releases? Else i can follow the other tutorials.
Trigun
Posts: 390
Joined: Wednesday 30 November 2016 11:58
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.10717
Contact:

Re: Pass2PHP

Post by Trigun »

Crap!! Sorry totally forgot!! Damn!! I’ll make a note and send it over ASAP!


Sent from my iPhone using Tapatalk
Trigun
Posts: 390
Joined: Wednesday 30 November 2016 11:58
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.10717
Contact:

Re: Pass2PHP

Post by Trigun »

Ok, here they are.

Just use whatever you need, hope it helps.

Cheers!
Attachments
Install Domoticz on Debian 10 VM.docx
(37.45 KiB) Downloaded 58 times
Install phpMyAdmin on Debian Buster(10).docx
(14.02 KiB) Downloaded 51 times
ProxMox Setup.docx
(379.41 KiB) Downloaded 52 times
ropske
Posts: 483
Joined: Tuesday 12 August 2014 5:37
Target OS: Raspberry Pi / ODroid
Domoticz version: V3_8394
Location: Rumbeke,Belgium
Contact:

Re: Pass2PHP

Post by ropske »

Trigun wrote: Saturday 16 May 2020 17:49 Ok, here they are.

Just use whatever you need, hope it helps.

Cheers!
hi mate, thanks a lot.
i've done everything like in your manuals, except phpmyadmin is not working, gonna recheck, retry again.
Trigun
Posts: 390
Joined: Wednesday 30 November 2016 11:58
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.10717
Contact:

Re: Pass2PHP

Post by Trigun »

it should work. bare in mind that it is a combination of the PHPMyadmin "how-to" file and the pass2php "how-to" file.
ropske
Posts: 483
Joined: Tuesday 12 August 2014 5:37
Target OS: Raspberry Pi / ODroid
Domoticz version: V3_8394
Location: Rumbeke,Belgium
Contact:

Re: Pass2PHP

Post by ropske »

ok, yesterday it phpmyadmin worked fine,

today after a reboot of my nuc, its not working anymore; i get this:

403 Forbidden
nginx/1.14.2


LEMP(nginx) or LAMP(apache) must be installed?
Trigun
Posts: 390
Joined: Wednesday 30 November 2016 11:58
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.10717
Contact:

Pass2PHP

Post by Trigun »

ropske wrote:ok, yesterday it phpmyadmin worked fine,

today after a reboot of my nuc, its not working anymore; i get this:

403 Forbidden
nginx/1.14.2


LEMP(nginx) or LAMP(apache) must be installed?
Please check the php configs again and or set the correct rights. It has to do with one of those. You followed the instructions correct?

Also if you followed the instructions you’ll see that it’s based on nginx and not apache2. Just follow the instructions to the letter and you’ll be fine.


Sent from my iPhone using Tapatalk
User avatar
Egregius
Posts: 2592
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: v2024.7
Location: Beitem, BE
Contact:

Re: Pass2PHP

Post by Egregius »

Both should work just fine. I prefer Apache2.
Something to do with config file of your webserver.
ropske
Posts: 483
Joined: Tuesday 12 August 2014 5:37
Target OS: Raspberry Pi / ODroid
Domoticz version: V3_8394
Location: Rumbeke,Belgium
Contact:

Re: Pass2PHP

Post by ropske »

hmmm, strange, seems apache is not running:

apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Mon 2020-05-18 23:26:57 CEST; 18s ago
Docs: https://httpd.apache.org/docs/2.4/
Process: 975 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE)

May 18 23:26:57 debian apachectl[975]: AH00558: apache2: Could not reliably determine the server's fully qualified domain na
May 18 23:26:57 debian apachectl[975]: (98)Address already in use: AH00072: make_sock: could not bind to address [::]:80
May 18 23:26:57 debian apachectl[975]: (98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
May 18 23:26:57 debian apachectl[975]: no listening sockets available, shutting down
May 18 23:26:57 debian apachectl[975]: AH00015: Unable to open logs
May 18 23:26:57 debian apachectl[975]: Action 'start' failed.
May 18 23:26:57 debian apachectl[975]: The Apache error log may have more information.
May 18 23:26:57 debian systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE
May 18 23:26:57 debian systemd[1]: apache2.service: Failed with result 'exit-code'.
May 18 23:26:57 debian systemd[1]: Failed to start The Apache HTTP Server.
ropske
Posts: 483
Joined: Tuesday 12 August 2014 5:37
Target OS: Raspberry Pi / ODroid
Domoticz version: V3_8394
Location: Rumbeke,Belgium
Contact:

Re: Pass2PHP

Post by ropske »

ok, problem solved; for the people who have the same issue:

i had nginx and apache both installed,

so i now deinstalled nginx by doing this:

sudo apt-get remove nginx nginx-common
sudo apt-get purge nginx nginx-common
sudo apt-get autoremove

then i restarted apache server:
sudo systemctl start apache2

and by checking the status again:
sudo systemctl status apache2

i had this result now:
apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2020-05-19 00:02:50 CEST; 2min 41s ago
Docs: https://httpd.apache.org/docs/2.4/
Process: 2686 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)
Main PID: 2690 (apache2)
Tasks: 11 (limit: 4689)
Memory: 49.8M
CGroup: /system.slice/apache2.service
├─2690 /usr/sbin/apache2 -k start
├─2692 /usr/sbin/apache2 -k start
├─2693 /usr/sbin/apache2 -k start
├─2695 /usr/sbin/apache2 -k start
├─2699 /usr/sbin/apache2 -k start
├─2700 /usr/sbin/apache2 -k start
├─2701 /usr/sbin/apache2 -k start
├─2702 /usr/sbin/apache2 -k start
├─2703 /usr/sbin/apache2 -k start
├─2704 /usr/sbin/apache2 -k start
└─2705 /usr/sbin/apache2 -k start

so running again :)
User avatar
Egregius
Posts: 2592
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: v2024.7
Location: Beitem, BE
Contact:

Re: Pass2PHP

Post by Egregius »

Omg, how did you even manage to install both?
apt should remove nginx if you try to install Apache2 and reverse.

As always: look in the logfiles. In 99% of the problems it’s in there.
ropske
Posts: 483
Joined: Tuesday 12 August 2014 5:37
Target OS: Raspberry Pi / ODroid
Domoticz version: V3_8394
Location: Rumbeke,Belgium
Contact:

Re: Pass2PHP

Post by ropske »

i first followed the guide from Trigun where it installs nginx

then my fault:
to install phpmyadmin, i followed also the latest guide from trigun to install phpmyadmin on buster, but it did not work, then i google'ed and found a website from linuxbabe where it also shows step by step how to install phpmyadmin on debian buster.

But there where 2 site; one for LEMP and one for LAMP, so i choose the wrong one and it was LAMP (apache)


then yesterday evening, for some reason, my domoticz was not responding, so i rebooted my VM and then all problems started

gladly its all solved, but yeah, i dont know that much of linux, so i don't know why i was able to install nginx and apache together :lol: :lol:
gladly we have some free days now here in belgium starting from tomorrow evening so i can begin to reprogram my house again

one more question, i see some directorys in domoticz have owner '2000' instead of root or me, so for now i cant copy the file: 'script_device_pass2php.lua' to the scripts directory.

Any idea how this was possible?
Thank you!
Trigun
Posts: 390
Joined: Wednesday 30 November 2016 11:58
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.10717
Contact:

Re: Pass2PHP

Post by Trigun »

ropske wrote:i first followed the guide from Trigun where it installs nginx

then my fault:
to install phpmyadmin, i followed also the latest guide from trigun to install phpmyadmin on buster, but it did not work, then i google'ed and found a website from linuxbabe where it also shows step by step how to install phpmyadmin on debian buster.

But there where 2 site; one for LEMP and one for LAMP, so i choose the wrong one and it was LAMP (apache)


then yesterday evening, for some reason, my domoticz was not responding, so i rebooted my VM and then all problems started

gladly its all solved, but yeah, i dont know that much of linux, so i don't know why i was able to install nginx and apache together :lol: :lol:
gladly we have some free days now here in belgium starting from tomorrow evening so i can begin to reprogram my house again

one more question, i see some directorys in domoticz have owner '2000' instead of root or me, so for now i cant copy the file: 'script_device_pass2php.lua' to the scripts directory.

Any idea how this was possible?
Thank you!
It’s a common issue. When you install phpmyadmin it also installs apache2. Had the same issue a while back. Somehow it’s in a package or something.Therefore I added the deletion of apache2 in the how to. Only if you use Nginx ofcourse. Good stuff you found it!


Sent from my iPhone using Tapatalk
ropske
Posts: 483
Joined: Tuesday 12 August 2014 5:37
Target OS: Raspberry Pi / ODroid
Domoticz version: V3_8394
Location: Rumbeke,Belgium
Contact:

Re: Pass2PHP

Post by ropske »

Sorry i'm here again :(

i want to copy the file: script_device_pass2php.lua to the scripts/lua directory in domoticz, but it fails:
2020-05-19 12_41_37-Window.jpg
2020-05-19 12_41_37-Window.jpg (109.37 KiB) Viewed 1494 times
anyone knows why?

thank you!

Running domoticz on a VM on proxmox
Trigun
Posts: 390
Joined: Wednesday 30 November 2016 11:58
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.10717
Contact:

Re: Pass2PHP

Post by Trigun »

ropske wrote:Sorry i'm here again :(

i want to copy the file: script_device_pass2php.lua to the scripts/lua directory in domoticz, but it fails:
2020-05-19 12_41_37-Window.jpg
anyone knows why?

thank you!

Running domoticz on a VM on proxmox
Yes, there is a permission issue. Just set your permissions to 777 -R on the scripts folder. The “-R” will help you to set the permissions recursively. Hope this helps


Sent from my iPhone using Tapatalk
ropske
Posts: 483
Joined: Tuesday 12 August 2014 5:37
Target OS: Raspberry Pi / ODroid
Domoticz version: V3_8394
Location: Rumbeke,Belgium
Contact:

Re: Pass2PHP

Post by ropske »

Trigun wrote: Tuesday 19 May 2020 12:46
ropske wrote:Sorry i'm here again :(

i want to copy the file: script_device_pass2php.lua to the scripts/lua directory in domoticz, but it fails:

2020-05-19 12_41_37-Window.jpg

anyone knows why?

thank you!

Running domoticz on a VM on proxmox
Yes, there is a permission issue. Just set your permissions to 777 -R on the scripts folder. The “-R” will help you to set the permissions recursively. Hope this helps


Sent from my iPhone using Tapatalk
Correct mate, its working.
I'm just gonna write down everything i've done :D
Just in case i need to reinstall it again lol

Is there any reason why the scripts folder has not the correct rights? or has it allways been like this?

@Egrerius, you backup your complete VM to a nas then?
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest