Yotta
Posts: 9
Joined: Fri May 20, 2016 9:31 pm

How could I host a website totally on my R pi ?

Fri May 20, 2016 9:48 pm

Hello guys! I am new here! I am happy for finding this awesome forum!
Sorry if my question is in the wrong section but i matches the section topic...anyway.

Well,at first I want for you to know that I haven't ever done this before.
I would like to host a website on my raspberry pi.I don't want to buy nothing else! Neither domain,web hosting,server,vps,ddns or whatever else!
I want to do everything with my raspberry pi !
The website wouldn't be something "big" and it will not be online 24/7 !
What's more it will not have that many visitors so it could "get down".
How the heck can I make it?
I also need an sql server name,user,pass etc...see here: http://prnt.sc/b6hsp3 and here: http://prnt.sc/b6hsro (example)
Everything should be hosted and created through my raspberry.
Which raspberry OS should I use for better performance?
Ohh and I want to tell you that my ISP is giving me an dynamic IP and not a static one :)

Thanks in advance! Hope somebody could help me and guide me :)

ghellquist
Posts: 68
Joined: Thu Aug 02, 2012 8:47 am
Location: Stockholm Sweden

Re: How could I host a website totally on my R pi ?

Sun May 22, 2016 8:08 am

You will need four things.

1) The OS
Raspbian will be fine (the supported "standard" for Pi)

2) Install the programs
Search for LAMP - Linux, Apache, Mysql and PHP
Apache is the web server
Mysql the database
PHP one common language used on web sites

3) Create your website
Writing html is one way to do it.
You might look at downloading and installing something like Wordpress (I´ve done it, works on the Pi)

4) Access the website from outside you local network
As dynamic IP-adresses generally only change now and then, in my experience often stays the same for months, you could simply use that.
Another alternative are services such as freedns. They work by having a small program in the Pi that now and the sends the actual IP address to a server. Users go to that server and will be directed to your IP. You will probably have to search a bit for a free one.

Have fun! Learn!

/Gunnar

drgeoff
Posts: 9926
Joined: Wed Jan 25, 2012 6:39 pm

Re: How could I host a website totally on my R pi ?

Sun May 22, 2016 10:57 am

1. (Essential) You will need to set up port forwarding on your router. How to do that varies from router to router.

2. (Optional) Many home routers support one or more Dynamic DNS services.

1 and 2 are independent but your router's documentation should cover both.

Yotta
Posts: 9
Joined: Fri May 20, 2016 9:31 pm

Re: How could I host a website totally on my R pi ?

Sun May 22, 2016 4:29 pm

ghellquist wrote:You will need four things.

1) The OS
Raspbian will be fine (the supported "standard" for Pi)

2) Install the programs
Search for LAMP - Linux, Apache, Mysql and PHP
Apache is the web server
Mysql the database
PHP one common language used on web sites

3) Create your website
Writing html is one way to do it.
You might look at downloading and installing something like Wordpress (I´ve done it, works on the Pi)

4) Access the website from outside you local network
As dynamic IP-adresses generally only change now and then, in my experience often stays the same for months, you could simply use that.
Another alternative are services such as freedns. They work by having a small program in the Pi that now and the sends the actual IP address to a server. Users go to that server and will be directed to your IP. You will probably have to search a bit for a free one.

Have fun! Learn!

/Gunnar

Hello! Thanks for your response!
The website is prepared! With the whole database! :)
Is there any other way to do it without actually using freedns? Without static IP,as I dont want to pay extra my ISP..
And what about the domain name?

ghans
Posts: 7878
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: How could I host a website totally on my R pi ?

Mon May 23, 2016 4:47 am

A domain name will have to involve the DNS (duh) , so why
don't you sign up with a free (!) dynamic DNS provider ? Of
course a "proper" domainname will cost money.


ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

Yotta
Posts: 9
Joined: Fri May 20, 2016 9:31 pm

Re: How could I host a website totally on my R pi ?

Tue May 24, 2016 6:51 pm

I think you are right. I explore the freedns and I found a lot of good subdomains.
But what about the information I need so as to <<build>> the website? See here: http://prntscr.com/b7yu2g and an example how it should be: http://prntscr.com/b7yubb

ghans
Posts: 7878
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: How could I host a website totally on my R pi ?

Wed May 25, 2016 7:28 am

Don't forget that you are the owner of a "Root Server" or
a "VPS" so to speak - any guide for setting up an "LAMP stack"
applies for your Raspberry Pi , too.

If you find a HOWTO on setting up a LAMP stack
on Debian or Ubuntu chances are that you can use the same
steps on Raspbian.

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

Return to “Networking and servers”