Leak Society - The Home Of Nulled Resources.
Forum Beta v1 Now Live!
Mechanicus | How to set up your RPi as a Web Server
Thead Owner : Slash1644926389, Category : Technology and Devices, 6 Comment, 102 Read
Viewers: 1 Guest(s)
Senior Member
****
281
Messages
32
Threads
0
Rep
4 Years of Service
03-24-2014, 12:31 PM
#1
[Image: 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
This will return some information about your router, If you have an ethernet connection to your Pi check the etho part, if you have a wireless adapter and therefore a wireless connection check out the wlano part.

Make a note somewhere about the following information :
Code:
inet addr - 192.168.1.5 (pi's IP Address)
That should be on the second line of Ifconfig,
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]


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
Save the editor by pressing CTRL+O , Then exit pressing CTRL+X

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.


Messages In This Thread
Mechanicus | How to set up your RPi as a Web Server - by Slash1644926389 - 03-24-2014, 12:31 PM
Mechanicus | How to set up your RPi as a Web Server - by Guest - 03-24-2014, 12:58 PM
Mechanicus | How to set up your RPi as a Web Server - by Guest - 03-24-2014, 02:19 PM
Mechanicus | How to set up your RPi as a Web Server - by Guest - 03-24-2014, 05:52 PM

Forum Jump: