tomgravell
Posts: 15
Joined: Mon Oct 01, 2012 3:29 pm

New user looking for webserver help

Mon Oct 01, 2012 3:35 pm

Hi all, had my Pi for a couple of weeks and I've just got around to having a proper mess about with it.

I currently have my own domain, and hosting from a company, but what I'd like to do is host my own small server (I don't really receive any visitors to my website, it's more of a personal thing I use to learn etc).

Before I spend lots of time looking around, I'd just like a thumbs up from someone more experienced that I'll be able to get all this working.


I'd like my Pi set up at home acting as a webserver

I'd like to be able to upload pages and edit pages from my own computer/work computer (FTP)

For SSH I will be using PuTTy (which I assume you can use from an external connection? I've only ever used it on an internal network)


If anyone can point me to any guides to do the above, including which OS to use, that would be greeeat, although I'm off to start looking now :)

scorp
Posts: 96
Joined: Tue May 29, 2012 6:21 pm

Re: New user looking for webserver help

Mon Oct 01, 2012 8:47 pm

I would take latest Raspbian as OS http://downloads.raspberrypi.org/images ... spbian.zip.
For web server, I used this page:
http://fusionstrike.com/2012/setting-ph ... -pi-debian
look at the bottom for other pages. So you need only PHP and Apache2. SSH already installed, you need to enable it on start up config menu.
To have it accessible from outside of your network you need to open port 80 on your rooter. If your ISP doesn't provide static IP for you then you need to organise one of the DNS services. I used http://dyn.com/dns/. Register your name there and setup your rooter to periodically update your account.
One thing i had to modify which was not mentioned on tutorials, in /etc/apache2/apache2.conf I added line
DirectoryIndex index.html index.php
at the end of the file to enable index.php to be opened by default on port 80 if exists(and no index.html)

ShuttleMunky
Posts: 9
Joined: Sat Sep 29, 2012 12:03 am

Re: New user looking for webserver help

Mon Oct 01, 2012 8:58 pm

i choose at the startup boot to automatically start the desktop ui...

how can i reaccess to boot menu ?

scorp
Posts: 96
Joined: Tue May 29, 2012 6:21 pm

Re: New user looking for webserver help

Mon Oct 01, 2012 9:16 pm

ShuttleMunky wrote:i choose at the startup boot to automatically start the desktop ui...

how can i reaccess to boot menu ?
hmmm, I'm not very good expert in Desktop, never started it. You will need to find out how to start
sudo raspi-config

JustPat
Posts: 35
Joined: Fri Jul 27, 2012 1:47 am

Re: New user looking for webserver help

Tue Oct 02, 2012 12:54 am

ShuttleMunky wrote:i choose at the startup boot to automatically start the desktop ui...

how can i reaccess to boot menu ?
All you have to do to get to that command line is open up the LXTerminal application. This will take you to a command line just like the one on startup, just in GUI. If you want to turn boot to GUI default off, just type 'sudo raspi-config' in the terminal, and follow the prompts. Hope I helped!

tomgravell
Posts: 15
Joined: Mon Oct 01, 2012 3:29 pm

Re: New user looking for webserver help

Tue Oct 02, 2012 10:25 am

Thanks for your reply, last night I installed Raspbian OS but didn't get around to doing much else as it took longer to install than expected! I managed to set a static IP using SSH and nano before I turned it off, so I don't have to deal with changing inputs on my monitor every time I want to change something.

Tonight I'll have a look through your post and do what I need to do.
I'm hoping to run a mumble server (never more than 3-5 users on there) and my webserver which gets little to no traffic so I'm sure it will be able to cope.

Also, I'd rather not use the GUI on the PI, will I be able to do everything using SSH from my main machine into the PI? Sounds like a bit of a stupid question but I guess that's why I'm in this section! Thanks :)

User avatar
penguintutor
Posts: 390
Joined: Tue May 08, 2012 9:11 am
Location: UK
Contact: Website

Re: New user looking for webserver help

Tue Oct 02, 2012 2:39 pm

I've written a couple of tutorials on using a Raspberry Pi as a webserver.

I'd suggest running a lightweight webserver such as lighttp which is at http://www.penguintutor.com/linux/light-webserver, although if you are not expecting much traffic and would instead look to learn how most servers are configured you could do the full LAMP server instead http://www.penguintutor.com/linux/raspberrypi-webserver

tomgravell
Posts: 15
Joined: Mon Oct 01, 2012 3:29 pm

Re: New user looking for webserver help

Tue Oct 02, 2012 3:31 pm

penguintutor wrote:I've written a couple of tutorials on using a Raspberry Pi as a webserver.

I'd suggest running a lightweight webserver such as lighttp which is at http://www.penguintutor.com/linux/light-webserver, although if you are not expecting much traffic and would instead look to learn how most servers are configured you could do the full LAMP server instead http://www.penguintutor.com/linux/raspberrypi-webserver

Thanks penguin, that's actually the guide I used to set the static IP last night, found through Google.
I've been reading through yours and the guide posted earlier, I'm pretty certain I'll be able to set this up myself tonight now, thank you! The only thing I'm not sure about is pointing my domain to the PI, but I'm sure I'll be able to Google a guide for that :)

tomgravell
Posts: 15
Joined: Mon Oct 01, 2012 3:29 pm

Re: New user looking for webserver help

Tue Oct 02, 2012 6:48 pm

Hi all, I managed to get it all working, mumble server is working great, I can see my website on the LAN, but I'm having a problem seeing it from the ip.


I have ports 80 and 22 forwarded on my routers firewall rules to the LAN IP of the Pi, but putting my external IP into a browser just throws up 'Oops! Google Chrome could not connect to 90.222.210.194'. I'm sure I've probably missed something though I just can't find what it is :(

User avatar
penguintutor
Posts: 390
Joined: Tue May 08, 2012 9:11 am
Location: UK
Contact: Website

Re: New user looking for webserver help

Wed Oct 03, 2012 10:47 am

mumble server is working great,
Do you have a problem with a normal webserver - or with Mumble?

I'm not familiar with Mumble, but it uses port 64738 by default so you will need to foward that through your router. You will have to add it as a custom as it won't be on the standard services list on your router.

If you are referring to a standard web server then that should be all you need to do. Have you checked your router has those rules enabled? Sounds silly, but I had that problem when I first moved to my VirginMedia router, which is by netgear and probably similar to your Sky router (but cable instead of ADSL). On my Belkin router the entries were added straight away, but on the netgear I had to click "add rule", "enable" and then "apply".

tomgravell
Posts: 15
Joined: Mon Oct 01, 2012 3:29 pm

Re: New user looking for webserver help

Wed Oct 03, 2012 11:03 am

penguintutor wrote:
mumble server is working great,
Do you have a problem with a normal webserver - or with Mumble?

I'm not familiar with Mumble, but it uses port 64738 by default so you will need to foward that through your router. You will have to add it as a custom as it won't be on the standard services list on your router.

If you are referring to a standard web server then that should be all you need to do. Have you checked your router has those rules enabled? Sounds silly, but I had that problem when I first moved to my VirginMedia router, which is by netgear and probably similar to your Sky router (but cable instead of ADSL). On my Belkin router the entries were added straight away, but on the netgear I had to click "add rule", "enable" and then "apply".

The mumble server is working great, can access it externally. The rule was already set up for my old server so I just had to change the internal IP from my old server to the Pi.

The webserver however, I can access internally with 192.168.0.14 but externally it just times out. I thought I had solved it as my Sky router already had rules for HTTP/FTP/SSH set in place, which I didn't realise so I created new rules for the same ports, I removed these a minute ago and used the rules set by Sky but it still doesn't seem to be working.

I can't work out what its going on at all!

User avatar
penguintutor
Posts: 390
Joined: Tue May 08, 2012 9:11 am
Location: UK
Contact: Website

Re: New user looking for webserver help

Wed Oct 03, 2012 11:18 am

Sounds like a problem with the router. May be worth rebooting the router to clear it's arp cache and make sure there are no firewall rules blocking it but it sounds like it's all configured correctly.

tomgravell
Posts: 15
Joined: Mon Oct 01, 2012 3:29 pm

Re: New user looking for webserver help

Wed Oct 03, 2012 11:25 am

penguintutor wrote:Sounds like a problem with the router. May be worth rebooting the router to clear it's arp cache and make sure there are no firewall rules blocking it but it sounds like it's all configured correctly.

I don't know why I didn't think of that before, turn it off then turn it on again.. and it works! Thanks so much for your help penguin :mrgreen:

Return to “Beginners”