Wednesday, August 15, 2012

Raspberry Pi Running Apache and FTP

I started with this site, http://tinkernut.com/wiki/page/Episode_320 very easy to understand and started walking threw the steps.  About the 3rd time, locking my self out of the pi, or not being able to use the web page, I started to learn more of what I was typing. And the link above was a few months ago, I want to post How I got mine working, as of today, 8-14-2012.

I'm using Raspbin "wheezy" build  of debian, available here http://www.raspberrypi.org/downloads


After Installing the OS on an SD card, during the first set up, I select to 224Mb to ram, and enable SSH on boot.


I set the time by typing sudo dpkg-reconfigure tzdata


I check for any new updates for this Debian build, By typing sudo apt-get update 


Then install them by typing sudo apt-get upgrade



I skip the part where he upgrades the firmware, because as I read up on it, with the new build of "Wheezy" it breaks any updates and in some cases, freezes the OS so you would have to re-install it on your sd card.

Next I change the default password of the 'pi' user by issuing this command, and then type your new password twice to save sudo passwd pi

Now in the next part of his blog, he gives you a couple of options of what type of server to install. In my case, I went with Apache.

To install Apache with php, tyoe sudo apt-get install apache2 php5 libapache2-mod-php5

At this point, I haven't had any errors, so i skip the next steps telling how to fix, said problem.

Now  restart the Apache service with sudo service apache2 restart

Just type in your ip address, of your Raspberry Pi, into your web browser, and if everything went right, you should se a "IT WORKS!" page.

To install the FTP server you need haver permission to edit a file, so enter sudo chown -R pi /var/www

Now install FTP by typing sudo apt-get install vsftpd

Then you will be modifying a file in nano, to bring it up, type sudo nano /etc/vsftpd.conf

To take a direct quote from tinkernut.com "Hit ctrl+W and search for anonymous_enable=YES, and change it to anonymous_enable=NO Remove the # from in front of local_enable=YES Remove the # from in front of write_enable=YES Skip to the bottom of the file and addforce_dot_files=YES Hit ctrl+X to exit, y to save and enter to confirm"

Follow those closely and you'll be fine,

Time to restart the FTP service by typing sudo service vsftpd restart

Try logging into your pi's FTP by logging in with your username of : pi and what ever your password it.

The last thing I do is change the password for the 'root' user, type sudo passwd root  enter your password twice and your good to go!

When I tried to give permissions to root and pi in the section that follows his FTP instructions, that's when I got locked out, 3 different times and re-installs. When i skipped it, everything seams to work fine. 

Hope this helps, have a great night!