Leak Society
/
General Discussion
/
Technology and Devices
/
Mechanicus | How to set up your RPi as a Web Server





Mechanicus | How to set up your RPi as a Web Server
Thead Owner : Slash1644926389,
Category : Technology and Devices,
6 Comment,
109 Read
Viewers:
1 Guest(s)
03-24-2014, 12:31 PM
![[Image: 2vDnbDC.gif]](http://i.imgur.com/2vDnbDC.gif)
To see how to set your RPi up as a CCTV Circuit check here
To see how to set your RPi up as a BitTorrent Server check here
Raspberry Pi Web Server
Step 1(Optional if already done - Setting up the Pi) :
In order for the RPi to boot up, you need to have a OS installed onto it, I personally use
Raspbian which is debian-based OS that is specially tailored towards the RPi and its
hardware. But to install the OS I recommend looking at this
Because once you have set the stream up you will not need a monitor, I recommend looking
into setting up SSH (Secure Shell) on your RPi, this is so you can remote control the RPi from another node.
Step 2 (Getting the I.P of the Pi) :
This will be needed so you can access the Web Server, to do this you have to look into the config. In the CLI type:
Code:
ifconfig
Make a note somewhere about the following information :
Code:
inet addr - 192.168.1.5 (pi's IP Address)
inet addr : <SOMETHING> should be the address.
Take note of that.
Step 3 (Installing the web server);
Well you cant really have a Web Server without actually having the files and its packages on your system.
To install PHP & Apache, type in the prompt :
Code:
sudo apt-get install apache2 php5 libapache2-mod-php5
Let that install, once it has been installed restart the apache service :
Code:
sudo service apache2 restart
Once this is done, type the IP of your RPi into your Web Browser, then a default page should be displayed like so:
![[Image: LWafGqz.png]](http://i.imgur.com/LWafGqz.png)
Step 4 (Optional - MySQL)
MySQL Is simple to install, but can be useful if you intend your webserver to incorporate databases. In the CLI Write :
Code:
sudo apt-get install mysql-server mysql-client php5-mysql
Wait for it to install, then its done.
Step 5 (Optional, highly recommended - FTP)
Because you wont actually be using your Pi having an FTP to transfer files to and from the webserver is smart.
Firstly you must take the web root permissions. In the CLI Write :
Code:
sudo chown -R pi /var/www
Next install vsftpd
Code:
sudo apt-get install vsftpd
Edit your vsftpd.conf file:
Code:
sudo nano /etc/vsftpd.conf
Then change the following :
Code:
anonymous_enable=YES to anonymous_enable=NO
Uncomment local_enable=YES and write_enable=YES
then go to the bottom of the file and add force_dot_files=YES
Restart the vsftpd
Code:
sudo service vsftpd restart
Create a shortcut from the user home folder to the WWW folder:
Code:
ln -s /war/www/ ~/www
You can now FTP using the pi user access the /var/www folder.
Meaning when using an FTP Client use your Pi's username and password,
For IP use the Pi IP and use the default port : 21
Example :
Code:
Username : Pi
Password : Raspberry
IP : 192.168.1.5
Port : 21
You now have a fully functioning Web Server on your RPi.
03-24-2014, 12:46 PM
Very well written tutorial slash. But, I do believe that there is a RPi tutorial on PF
for this same thing!
Please correct me if I am wrong, but either way very lovely tutorial.
for this same thing!
Please correct me if I am wrong, but either way very lovely tutorial.
Guest
Unregistered
4 Years of Service
03-24-2014, 12:58 PM
Why would you want a Raspberry Pi in the first place? Let alone host a fucking website on such a small and insufficient device?
This tutorial was written with very good grammar, quality, and all that. Just what the tutorial is teaching itself is bad in my opinion.
When you think of hosting a site, you think of dedicated servers, VPS's, real big servers that can handle it. Not little mini computers >.<
Just my opinion though, maybe an RPi is great for hosting web servers...?
This tutorial was written with very good grammar, quality, and all that. Just what the tutorial is teaching itself is bad in my opinion.
When you think of hosting a site, you think of dedicated servers, VPS's, real big servers that can handle it. Not little mini computers >.<
Just my opinion though, maybe an RPi is great for hosting web servers...?
03-24-2014, 01:22 PM
(03-24-2014, 12:58 PM)Meh Wrote: Why would you want a Raspberry Pi in the first place? Let alone host a fucking website on such a small and insufficient device?
This tutorial was written with very good grammar, quality, and all that. Just what the tutorial is teaching itself is bad in my opinion.
When you think of hosting a site, you think of dedicated servers, VPS's, real big servers that can handle it. Not little mini computers >.<
Just my opinion though, maybe an RPi is great for hosting web servers...?
1. RPi's are awesome for small projects like so. Im not going to host the fucking BBC on here am I? its for home projects like hosting a self made company.
2. The tutorial is not bad, because its teaching something.
3. Not really
Guest
Unregistered
4 Years of Service
03-24-2014, 02:19 PM
(03-24-2014, 12:58 PM)Meh Wrote: This tutorial was written with very good grammar, quality, and all that.
I agree completely, great layout and easy to understand.
(03-24-2014, 12:58 PM)Meh Wrote: Just what the tutorial is teaching itself is bad in my opinion.
Uhm, regardless of your opinion, I have to disagree. It is pretty interesting and there is enough demand:
![[Image: FpiD8SY.png]](http://i.imgur.com/FpiD8SY.png)
(03-24-2014, 12:46 PM)DeLiLa Wrote: Please correct me if I am wrong
I'd love to do that, here we go:
BitTorrent-Server != Web-Server
03-24-2014, 05:39 PM
(03-24-2014, 02:19 PM)Kavalix Wrote:(03-24-2014, 12:58 PM)Meh Wrote: This tutorial was written with very good grammar, quality, and all that.
I agree completely, great layout and easy to understand.
(03-24-2014, 12:58 PM)Meh Wrote: Just what the tutorial is teaching itself is bad in my opinion.
Uhm, regardless of your opinion, I have to disagree. It is pretty interesting and there is enough demand:
(03-24-2014, 12:46 PM)DeLiLa Wrote: Please correct me if I am wrong
I'd love to do that, here we go:
BitTorrent-Server != Web-Server
I second everything that Kavalix has said.
Guest
Unregistered
4 Years of Service
03-24-2014, 05:52 PM
(03-24-2014, 12:58 PM)Meh Wrote: Why would you want a Raspberry Pi in the first place? Let alone host a fucking website on such a small and insufficient device?
This tutorial was written with very good grammar, quality, and all that. Just what the tutorial is teaching itself is bad in my opinion.
When you think of hosting a site, you think of dedicated servers, VPS's, real big servers that can handle it. Not little mini computers >.<
Just my opinion though, maybe an RPi is great for hosting web servers...?
I have ran some lite sites (no flash, java etc) on rpi's in school. They have no issue at all handling our whole class mashing f5 on it. So they are actually acceptable web servers if you run a low traffic site.
OT
Great tutorial Slash. You are making me very motivated to pickup a rpi :D