Go to advanced search

by WebPi
Mon Jun 22, 2015 11:38 am
Forum: Beginners
Topic: how to make two websites with lighttpd and duckdns?
Replies: 21
Views: 3705

Re: how to make two websites with lighttpd and duckdns?

You just need one line, but it must include both domain names seperated by a comma: exampledomain,mynewdomain
by WebPi
Mon Jun 22, 2015 9:20 am
Forum: Beginners
Topic: how to make two websites with lighttpd and duckdns?
Replies: 21
Views: 3705

Re: how to make two websites with lighttpd and duckdns?

In the instructions for setting up cron, it tells you to save this code in a script: echo url="https://www.duckdns.org/update?domains=exampledomain&token=a7c4d0ad-114e-40ef-ba1d-d217904a50f2&ip=" | curl -k -o ~/duckdns/duck.log -K - If you followed this step and changed exampledomain to your domain ...
by WebPi
Sun Jun 21, 2015 6:21 pm
Forum: Beginners
Topic: how to make two websites with lighttpd and duckdns?
Replies: 21
Views: 3705

Re: how to make two websites with lighttpd and duckdns?

i need to edit the file of the duck dns and add more things to it? I've never used duckdns, so I'm not sure how it works. Is there a configuration file? If so, please post it here, and maybe we can see where to add the other domain. I think you need to add the include_shell line in lighttpd.conf. C...
by WebPi
Sun Jun 21, 2015 11:54 am
Forum: Beginners
Topic: how to make two websites with lighttpd and duckdns?
Replies: 21
Views: 3705

Re: how to make two websites with lighttpd and duckdns?

Use your router's external IP address for both of your duck dns domains. HTTP forwarding in the router will send all HTTP traffic to your Pi. Next you need to set up a Lighttpd virtual host file for each web site: http://tecadmin.net/setup-virtualhosts-in-lighttpd-server/ Alternatively, you can put ...
by WebPi
Wed May 20, 2015 2:00 am
Forum: Beginners
Topic: store web files on external hdd
Replies: 3
Views: 567

Re: store web files on external hdd

If you're using Apache, the web content should be stored in /var/www. One solution is to copy the contents of /var/www to the USB drive, and then mount the USB drive on /var/www. You can set this up by editing a file called fstab and adding this line: /dev/sda1 /var/www ntfs-3g uid=pi,gid=pi 0 0 Thi...
by WebPi
Mon May 18, 2015 8:50 am
Forum: General discussion
Topic: Run a Python script automatically after powering the Pi.
Replies: 7
Views: 1028

Re: Run a Python script automatically after powering the Pi.

Fair enough. I just assumed it was a web app because it was a php script.
by WebPi
Mon May 18, 2015 8:33 am
Forum: General discussion
Topic: Run a Python script automatically after powering the Pi.
Replies: 7
Views: 1028

Re: Run a Python script automatically after powering the Pi.

For a php script, you need to install a web server and some php packages. Leave the script in your web server's content directory. When your Pi boots up, the web server will start automatically, and your php script should be accessible. To install Apache with PHP support: sudo apt-get install apache...
by WebPi
Sun May 17, 2015 2:30 am
Forum: General discussion
Topic: Run a Python script automatically after powering the Pi.
Replies: 7
Views: 1028

Re: Run a Python script automatically after powering the Pi.

You'll probably need to use the complete path to your script like this:

Code: Select all

@reboot python /home/pi/led.py
by WebPi
Sat May 02, 2015 4:24 pm
Forum: Automation, sensing and robotics
Topic: php, python, cgi, apache
Replies: 19
Views: 4567

Re: php, python, cgi, apache

This is a problem with the permission of the SPI interface. I think it's owned by root, but your script is running as Apache's user name, www-data. You need to give www-data access to SPI. According to this thread, you need to add www-data to the spi group: https://www.raspberrypi.org/forums/viewtop...
by WebPi
Tue Apr 28, 2015 4:19 pm
Forum: Automation, sensing and robotics
Topic: php, python, cgi, apache
Replies: 19
Views: 4567

Re: php, python, cgi, apache

Are there any error messages in /var/log/apache2/error.log?
by WebPi
Tue Apr 28, 2015 12:46 am
Forum: Automation, sensing and robotics
Topic: php, python, cgi, apache
Replies: 19
Views: 4567

Re: php, python, cgi, apache

Apache will call the script, so you don't need to start it in advance. It looks like you're using the correct URL. Make sure the script is executable. Also, double check that you added the AddHandler directive to /etc/apache2/sites-enabled/000-default (see http://raspberrywebserver.com/cgiscripting/...
by WebPi
Thu Apr 23, 2015 12:30 pm
Forum: Automation, sensing and robotics
Topic: php, python, cgi, apache
Replies: 19
Views: 4567

Re: php, python, cgi, apache

You could try following this tutorial about Google Docs: https://learn.adafruit.com/dht-humidity ... cs-updated

Alternatively, you could store the data in an SQLite database: http://raspberrywebserver.com/sql-databases/
by WebPi
Wed Apr 22, 2015 3:53 pm
Forum: Automation, sensing and robotics
Topic: php, python, cgi, apache
Replies: 19
Views: 4567

Re: php, python

You need to save the script in /usr/lib/cgi-bin and make sure it has executable permissions. Next, add some code near the start of your script to print HTTP headers: print "Content-type: text/html\n\n" Add HTML formatting to the output: print "<bold>Light:</bold>" Here's a crash course in CGI script...
by WebPi
Wed Apr 22, 2015 3:43 pm
Forum: General discussion
Topic: Speeding up my website
Replies: 15
Views: 1579

Re: Speeding up my website

The files from g1.iggcdn.com and g3.iggcdn.com are associated with the Indiegogo iframe that you added. The iframe is embedding a small web page inside of your page. The content from served from g1.iggcdn.com and g3.iggcdn.com is a mixture of css and Javascript files used to style the Indiegogo page...
by WebPi
Sat Apr 18, 2015 6:12 pm
Forum: General discussion
Topic: Problem with Apache 2 Server
Replies: 29
Views: 3511

Re: Problem with Apache 2 Server

It looks like it's working - I just left a message.
by WebPi
Sat Apr 18, 2015 5:33 pm
Forum: General discussion
Topic: Problem with Apache 2 Server
Replies: 29
Views: 3511

Re: Problem with Apache 2 Server

The comments are stored on disqus's servers, but they get embedded in your pages when people visit your site. If you want comments to be hosted locally, you'll need a forum/CMS powered by some programming language, whether it's PHP, Javascript, Ruby or Python.
by WebPi
Sat Apr 18, 2015 5:21 pm
Forum: Networking and servers
Topic: Nginx and owncloud config help
Replies: 1
Views: 1242

Re: Nginx and owncloud config help

It looks like PHP isn't configured in nginx.conf. Take a look at this page to see how to set up PHP with Nginx: http://linuxwebservers.net/nginx/php/se ... erver.html
by WebPi
Sat Apr 18, 2015 5:14 pm
Forum: General discussion
Topic: Problem with Apache 2 Server
Replies: 29
Views: 3511

Re: Problem with Apache 2 Server

You can use http://disqus.com to add comments on your site. You need to get a few lines of HTML/Javascript code from their site, and add it to your blog template.
by WebPi
Tue Mar 03, 2015 6:33 pm
Forum: Networking and servers
Topic: External hard drives in a cluster server
Replies: 17
Views: 6269

Re: External hard drives in a cluster server

With that configuration, if you use a Pi as the load balancer, the USB chip would be a bottleneck. It might be worth using something more powerful for the load balancer. You could put owncloud on one Pi, your web sites on another Pi, and put them both behind the load balancer. I've heard that ownclo...
by WebPi
Tue Mar 03, 2015 5:25 pm
Forum: Networking and servers
Topic: External hard drives in a cluster server
Replies: 17
Views: 6269

Re: External hard drives in a cluster server

You can probably merge the load balancer with the NAS but you are 100% right that clustering RPis is pointless. Usually when people build a cluster of RPis, it's just because they want to learn how to build a cluster. Clearly a cluster of Pis isn't going to be powerful, but if you can build a clust...
by WebPi
Tue Mar 03, 2015 11:02 am
Forum: Networking and servers
Topic: External hard drives in a cluster server
Replies: 17
Views: 6269

Re: External hard drives in a cluster server

I wrote this article on setting up a load balancer: http://linuxwebservers.net/apache/mod-proxy/setting-up-a-reverse-proxy-on-ubuntu14-04-with-apache-2-4.html . I used a PC for this because my load balancer needs to handle traffic for several different sites and servers. I used the Ubuntu network ma...
by WebPi
Tue Mar 03, 2015 9:08 am
Forum: Networking and servers
Topic: External hard drives in a cluster server
Replies: 17
Views: 6269

Re: External hard drives in a cluster server

Personally, I would use one disk per worker Pi. On a more powerful server, it might be worth having two disks per worker node, but I don't think there's much benefit to using so many hard disks. You're going to need to synchronize the content on them. You could use rsync to copy the relevant directo...
by WebPi
Mon Feb 23, 2015 5:44 am
Forum: Other programming languages
Topic: HTML Questions
Replies: 6
Views: 1144

Re: HTML Questions

1.Is there a simple way to make buttons bigger? this is the way I wrote it. Use the style attribute on the button to add some padding: <button style="padding:30px;"><a style="text-decoration: none;" href="index.html"><FONT COLOR="#000000">Home</FONT></a></button> 2.Is there a simple way in html to ...
by WebPi
Fri Feb 20, 2015 3:00 am
Forum: Python
Topic: Autostart python script
Replies: 7
Views: 1569

Re: Autostart python script

Does the command you're running depends on any other services that might take a while to get started? If you think this could be a possibility, try adding a delay before you run the command:

Code: Select all

cd /home/pi/applications/ve2zaz; sleep 60
by WebPi
Fri Feb 06, 2015 3:17 pm
Forum: General discussion
Topic: Web Server on multiple pi's
Replies: 6
Views: 3323

Re: Web Server on multiple pi's

It would work, but a Pi load balancer would be a major bottleneck. It won't be very powerful, but if you just want to learn how to build a server cluster then go ahead.

Go to advanced search