Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

195
Views
How to get my smartThings python3 script working on apache webserver as a cgi file

My father and I are making a webserver so Grafana will be able to access a few python scripts; Grafana only allows you to add links to buttons. Earlier today we created the webserver. Then I started work on two python files, "smartThingy.py" and "printLight.cgi". After those were created I put them on the network hard drive and my dad moved them onto the centos 8 machine that was running apache. It worked after getting the files to not be in DOS format. Currently, we are getting a small error https://pastebin.com/TXhXFPwm . Can someone please help debug the code so we can turn on and off a light by going to http://PrivateIpOfTheServer/cgi-bin/printLight.cgi

Here is my code. Its only missing the bits that allows it to output text onto the page.

https://pastebin.com/qn2EMYhZ - smartThingy.py (a module so it will be easier to create more cgi files)

https://pastebin.com/9J8HMYS7 - printLight.cgi (controls light above 3d printers)

Edit: I am using https://pypi.org/project/pysmartthings/ for smartThings

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

SELinux is preventing /usr/libexec/platform-python3.6 from name_connect access on the tcp_socket port 443.

*****  Plugin catchall_boolean (47.5 confidence) suggests   ******************

If you want to allow httpd to can network connect
Then you must tell SELinux about this by enabling the 'httpd_can_network_connect' boolean.

Do
setsebool -P httpd_can_network_connect 1

SELinux was just being mean to us.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!