Fght
Posts: 319
Joined: Thu Feb 05, 2015 10:26 pm

how to make two websites with lighttpd and duckdns?

Sun Jun 21, 2015 11:20 am

currently i'm having only one www folder... how can i make two websites with two different duckdns domains?

thanks

WebPi
Posts: 262
Joined: Wed Apr 10, 2013 6:47 pm
Location: Birmingham, UK
Contact: Website

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

Sun Jun 21, 2015 11:54 am

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- ... pd-server/

Alternatively, you can put the configuration code for both sites in the same configuration file: http://www.cyberciti.biz/tips/howto-lig ... sting.html
raspberrywebserver.com - Raspberry Pi tutorials
LinuxWebServers.net - Linux Web Server tutorials and examples
pyplate.com - Python web publishing tool

Fght
Posts: 319
Joined: Thu Feb 05, 2015 10:26 pm

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

Sun Jun 21, 2015 12:01 pm

i'll need to dig these ideas out because i'm not a linux savvy or routers savvy...
if i'll have questions i will try to ask you

thanks for helping me...

Fght
Posts: 319
Joined: Thu Feb 05, 2015 10:26 pm

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

Sun Jun 21, 2015 5:52 pm

"Use your router's external IP address for both of your duck dns domains"

how to do that? i need to edit the file of the duck dns and add more things to it?

also, i'm at step 2 in here http://tecadmin.net/setup-virtualhosts- ... pd-server/
but can't find a line like that using the nano text editor
include_shell "cat /etc/lighttpd/vhosts.d/*.conf"
http://postimg.org/image/774m2ojdn/b3e7ac1e/

thanks for any help

WebPi
Posts: 262
Joined: Wed Apr 10, 2013 6:47 pm
Location: Birmingham, UK
Contact: Website

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

Sun Jun 21, 2015 6:21 pm

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. Check that directory /etc/lighttpd/vhosts.d already exists.
raspberrywebserver.com - Raspberry Pi tutorials
LinuxWebServers.net - Linux Web Server tutorials and examples
pyplate.com - Python web publishing tool

Fght
Posts: 319
Joined: Thu Feb 05, 2015 10:26 pm

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

Sun Jun 21, 2015 6:45 pm

WebPi wrote: 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. Check that directory /etc/lighttpd/vhosts.d already exists.
i did a 'linux cron' installation of the duck dns (with the help of another member here. maybe this can help you determine how do i need to act?

i'm not sure about what you are saying... do i need to add the line at the bottom of the file? or it doesn't actually matters?
not really sure...

i've google hangouts for chatting about it...

WebPi
Posts: 262
Joined: Wed Apr 10, 2013 6:47 pm
Location: Birmingham, UK
Contact: Website

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

Mon Jun 22, 2015 9:20 am

In the instructions for setting up cron, it tells you to save this code in a script:

Code: Select all

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 name, then you just need to add the second domain name to this line:

Code: Select all

echo url="https://www.duckdns.org/update?domains=exampledomain,mynewdomain&token=a7c4d0ad-114e-40ef-ba1d-d217904a50f2&ip=" | curl -k -o ~/duckdns/duck.log -K -
This will tell duck dns to direct both domain names to your router's IP address.
raspberrywebserver.com - Raspberry Pi tutorials
LinuxWebServers.net - Linux Web Server tutorials and examples
pyplate.com - Python web publishing tool

Fght
Posts: 319
Joined: Thu Feb 05, 2015 10:26 pm

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

Mon Jun 22, 2015 10:55 am

WebPi wrote:then you just need to add the second domain name to this line:

Code: Select all

echo url="https://www.duckdns.org/update?domains=exampledomain,mynewdomain&token=a7c4d0ad-114e-40ef-ba1d-d217904a50f2&ip=" | curl -k -o ~/duckdns/duck.log -K -
This will tell duck dns to direct both domain names to your router's IP address.
so i need to write two lines like that for each domain?
like that:

Code: Select all

echo url="https://www.duckdns.org/update?domains=exampledomain,mynewdomain&token=a7c4d0ad-114e-40ef-ba1d-d217904a50f2&ip=" | curl -k -o ~/duckdns/duck.log -K -
[code]echo url="https://www.duckdns.org/update?domains=exampledomain,mynewdomain&token=a7c4d0ad-114e-40ef-ba1d-d217904a50f2&ip=" | curl -k -o ~/duckdns/duck.log -K -
[/code]

adding the relevant missing domain name?

WebPi
Posts: 262
Joined: Wed Apr 10, 2013 6:47 pm
Location: Birmingham, UK
Contact: Website

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

Mon Jun 22, 2015 11:38 am

You just need one line, but it must include both domain names seperated by a comma: exampledomain,mynewdomain
raspberrywebserver.com - Raspberry Pi tutorials
LinuxWebServers.net - Linux Web Server tutorials and examples
pyplate.com - Python web publishing tool

Fght
Posts: 319
Joined: Thu Feb 05, 2015 10:26 pm

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

Mon Jun 22, 2015 6:10 pm

i see, thanks!

User avatar
DougieLawson
Posts: 37134
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

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

Mon Jun 22, 2015 7:04 pm

I use https://www.dnsomatic.com/ to update all of my dynamic services (and my HE IPv6 tunnel). That only needs a single call from a script running on my Raspberry Pi.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

Fght
Posts: 319
Joined: Thu Feb 05, 2015 10:26 pm

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

Tue Jun 23, 2015 6:53 pm

DougieLawson wrote:I use https://www.dnsomatic.com/ to update all of my dynamic services (and my HE IPv6 tunnel). That only needs a single call from a script running on my Raspberry Pi.
i'm not sure how does it work and what it does!

User avatar
DougieLawson
Posts: 37134
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

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

Tue Jun 23, 2015 8:14 pm

DNS-o-Matic has a list of all the dynamic IP services. You give your dyndns, NoIP, tunnelbroker, afraid credentials to DNS-o-Matic.

When your public IP address changes you curl or wget ONE URL at https://updates.dnsomatic.com/nic/update and it goes round all of the dynamic IP services that it knows and gives them an update. So instead of your Raspberry Pi (or your home router) having to make six or seven calls to six or seven services you make ONE call to DNS-o-Matic and it does the magic for you.

Code: Select all

  curl -s -o - --user myDNS-o-MaticID:myDNS-o-MaticPassword  https://updates.dnsomatic.com/nic/update
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

Fght
Posts: 319
Joined: Thu Feb 05, 2015 10:26 pm

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

Wed Jun 24, 2015 3:37 pm

i need to know more about it...

i will later try to look up what are curl and wget...

you are saying the service is a traffic shortcut if i understand it right...!?
Last edited by Fght on Wed Jun 24, 2015 5:52 pm, edited 1 time in total.

User avatar
DougieLawson
Posts: 37134
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

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

Wed Jun 24, 2015 3:49 pm

It's just a convenient tool to get all of my dynamic services updated with a new IP address in one shot.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

Fght
Posts: 319
Joined: Thu Feb 05, 2015 10:26 pm

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

Wed Jun 24, 2015 5:53 pm

i see
does it includes a domain like in duck dns?

you know what?
i'm better off reading the website description first before further questions......

User avatar
DougieLawson
Posts: 37134
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

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

Wed Jun 24, 2015 10:21 pm

Fght wrote:i see
does it includes a domain like in duck dns?
I'm using it for my four DuckDNS domains.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

Fght
Posts: 319
Joined: Thu Feb 05, 2015 10:26 pm

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

Thu Jun 25, 2015 11:44 am

i see

so i will be good with dnsomatic

but do i need to do this too as first step?:
http://tecadmin.net/setup-virtualhosts- ... pd-server/

if yes i'm not sure how to precede because in the middle of the guide i got stuck as i said earlier.....

Fght
Posts: 319
Joined: Thu Feb 05, 2015 10:26 pm

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

Sat Jun 27, 2015 11:06 am

so doing this is the first thing? http://tecadmin.net/setup-virtualhosts- ... pd-server/

if yes what can i do at the step i got stuck at... (see above)

User avatar
pluggy
Posts: 3635
Joined: Thu May 31, 2012 3:52 pm
Location: Barnoldswick, Lancashire,UK
Contact: Website

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

Sat Jun 27, 2015 1:01 pm

I'm confused as to what benefit dns-o-matic gives you if you have multiple domains pointing to the same IP.

In my world it would be 1 bash script with 1 line per domain in it and it updates them all with one pass of the script....

It probably a lot quicker to do than signing up to another service (and another learning curve) and giving it all the credentials (or tokens in duckdns) for each domain. Once you've done one duckdns domain, all the others are exactly the same format but with different tokens and domains.

My wife's old boss used to like "playing offices" with redirecting calls to her phone instead of just passing her the handset across the desk.....
Don't judge Linux by the Pi.......
I must not tread on too many sacred cows......

Fght
Posts: 319
Joined: Thu Feb 05, 2015 10:26 pm

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

Sat Jun 27, 2015 2:35 pm

hi pluggy, how are you?
so you are saying it's much simpler? let me know the exact steps if you can and also i would appreciate for instructions to delete the folders and undo the rest of the actions of the guide you guys linked me to. because i want my pi to be neat and tidy.

:)

User avatar
pluggy
Posts: 3635
Joined: Thu May 31, 2012 3:52 pm
Location: Barnoldswick, Lancashire,UK
Contact: Website

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

Sun Jun 28, 2015 12:34 pm

It isn't much simpler, it only changes 1 small aspect of the whole process. You still need to set up lighttpd to serve multiple, sites and you still need the tokens and hostnames from duckdns setting up. It just takes dougies extra service out of it and you get the Pi to do the updating of the multiple domains in one script rather than getting another service to do it. As far as duckdns goes you just need the Pi to periodically run a script that contains the 'magic' line involving curl, Duckdns's token and hostname. You just need to put 2 lines in the same script, one for each domain if you're running 2 sites. Other than Dougies dns-o-matic advice, all the rest of the stuff still stands.

It makes it a hell of a lot easier if you understand what the steps you undertake actually do rather than parroting a list of instructions. I'd put the chances of of success when you're following a list rather than usnderstanding what you're doing on something as complex as this as pretty slim. A whole ot of seperate processes need to come together to make it work. There is no simple way of doing it.
Don't judge Linux by the Pi.......
I must not tread on too many sacred cows......

Return to “Beginners”