Posted in Linux, Tutorials/Tips

Raspberry Pi – FTP and Web server

Raspberry Pi is cheap and small computer which can be used for various stuff, it is not powerful computer for 3D gaming, however it can be used to have basic FTP and Web servers for personal use.
Things we will need:
– Raspberry Pi with internet connection (you also will need IP of Raspberry Pi, for that I would recommend to set permanent static IP in your router)
– ArchArm installed in Raspberry Pi (basic steps and download link is in here)
PuTTY (or any other similar client)
– Other computer

Things you will NOT need:

– HDMI cable or monitor or even keyboard attached to Raspberry Pi

 

Let’s begin. Now you should have running Raspberry Pi with ArchArm installed in it and nothing more altered. Firstly run PuTTY client and input IP address of your Raspberry Pi device.

PuTTY

Then click “Open” and agree to security warning after which you will be asked to login in command line interface. Default login and password is root

After you login you should update your system via this command:

pacman -Syyu

I have used image from 2014.06 and had 18 packages of updates, total 40.25 MiB. Once updates are installed reboot device with reboot command. Then re-connect to Raspberry Pi with PuTTY again, you might need to wait few minutes for device to boot fully again.

Now let’s start with web server, for that we need apache

pacman -S apache
Default configuration will work, but if you want to configure them to your needs they are located in /etc/httpd/conf

Now you can launch web server with httpd command and then use your Raspberry Pi IP address on local computer to access it. Currently it will look like this:

web_server

Now if you would reboot your Raspberry Pi you again would need to type httpd command to start web server, you might want to automatize it. Type this command to automatically start web server with system:

systemctl enable httpd

Some info about server. By default it reads info from /srv/http  but you can change it in apache config file, at DocumentRoot section. 

Now you have basic web server running and we can continue to FTP server which we will use to upload files to web server. To your surprise we already should have it installed and running.

Launch your FTP client and fill in info, 192.168.0.105 is IP of my Raspberry Pi username and password is same as login info of Raspberry Pi, use port 22 :

FTP

Now let’s try to upload something so we could see it in our web server. Locate this directory in FTP client /srv/http and upload something. Once that is done visit your web servers IP in browser again.

WEB_1

For example if you open IP in your Android device you can even view video stream of some formats with VLC:

 

Stream1-640x1024

That is the end of post. Hope it will be useful for somebody.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s