Linux for the layman.
Friday, 28 June 2013
Introduction
Try it out
What can you do with a headless server in 35 minutes?
8 comments:
Feel free to comment on any of the blog posts. Please try to be constructive.
Offensive messages will be removed as will blatant adverts for misleading products and sites.
Thanks for visiting my blog
Tuesday, 25 June 2013
To view the article visit http://myubuntublog.com/?p=17.
A Whistlestop Tour Of Ubuntu 13.04
To view the article visit http://myubuntublog.com/?p=17.
0 comments:
Feel free to comment on any of the blog posts. Please try to be constructive.
Offensive messages will be removed as will blatant adverts for misleading products and sites.
Thanks for visiting my blog
My Ubuntu Blog
0 comments:
Feel free to comment on any of the blog posts. Please try to be constructive.
Offensive messages will be removed as will blatant adverts for misleading products and sites.
Thanks for visiting my blog
Sunday, 16 June 2013
If I get a chance to post during the next 6 weeks then I will but I will ramp back up nearer the autumn.
Taking a break
If I get a chance to post during the next 6 weeks then I will but I will ramp back up nearer the autumn.
0 comments:
Feel free to comment on any of the blog posts. Please try to be constructive.
Offensive messages will be removed as will blatant adverts for misleading products and sites.
Thanks for visiting my blog
Wednesday, 5 June 2013
Introduction
Yesterday I wrote an article showing how to set up the Raspberry PI as a personal web server.
The concept of setting up the personal web server on the Raspberry PI really was for a hobby project and shouldn't really be used for hosting an external website. There are various reasons for this such as security, the power of the Raspberry PI, bandwidth and the fact that your external IP address will change at regular intervals.
This article goes some way to addressing some of the things you will need to do to connect to the website on your Raspberry PI from the outside world.
This is a proof of concept and just ideas on paper (or screen) and should not be seen as a gospel guide.
I will warn you now that I have never been that good with the networking side of things so I will try and explain as best I can. I may or may not be wrong in places and I am relying on people to correct me in the comments section.
I will warn you now that I have never been that good with the networking side of things so I will try and explain as best I can. I may or may not be wrong in places and I am relying on people to correct me in the comments section.
Get your External IP address
There are basically 2 IP addresses that are important. There is the internal IP address which you can get by running IFCONFIG in a terminal.
When you connect to the internet you will actually be using an external IP address.
I followed this guide (http://www.if-not-true-then-false.com/2010/linux-get-ip-address/) to get an external IP address.
I installed lynx first by running the following in the command line:
sudo apt-get install lynx
Then I ran the following command to get the external IP address.
lynx --dump http://ipecho.net/plain
Another way to get your external IP address is to log onto http://www.whatismyip.com/ but I will explain later why I bothered to install lynx.
Port Forwarding
- name
- wan port
- lan ip address
- lan port
- protocol
- status
Testing it out
Troubleshooting
Static IP address
Remote access to the Raspberry PI
sudo apt-get install ssmtpNext I edited the ssmtp.conf file by running the following command:
sudo nano /etc/ssmtp/ssmtp.confI then added the following to the end of the file:
root=postmaster
mailhub=smtp.gmail.com:587
hostname=raspberrypiAuthUser=myemailaddressAuthPass=myemailpasswordUseSTARTTLS=YESI pressed CTRL O to save the file and CTRL X to exit nano.
Next I edited the revaliases file by typing the following command.
sudo nano /etc/ssmtp/revaliasesWithin the file I added the following line
pi:pi@everydaylinuxuser.com:smtp.gmail.com:587
I then saved the file by pressing CTRL O and exited the file by pressing CTRL and X
Finally I set the permissions to 774 by running the following command:
sudo chmod 774 /etc/ssmtp/ssmtp.confAll of this basically enables me to send an email.
To send an email all I have to do is run a command and output it to the mail command. For example:
lynx --dump http://ipecho.net/plain | mail -s "Your PI IP" me@myemailaddress.comThis emails my IP address to my email address
Obviously this only does it once and so it would be better if it sent me an email at regular intervals so that I can see if there has been a change.
To do this I added the above command to a script called sendmemyIP.sh. I opened the script by typing the following:
sudo nano sendmemyIP.shI then copied the lynx command into the script and pressed CTRL O to save and CTRL X to exit nano.
To get the script to run regularly I added it as a cron job by copying sendmemyIP.sh to /etc/cron.hourly.
sudo cp sendmemyIP.sh /etc/cron.hourly/sendmemyIP.shNow when my Raspberry PI is turned on it will send the IP address to my email inbox once an hour.
I can then use this IP address within putty or ssh to access my Raspberry PI from anywhere.
Summary
Connecting to the Raspberry PI from the outside world
Introduction
Yesterday I wrote an article showing how to set up the Raspberry PI as a personal web server.
The concept of setting up the personal web server on the Raspberry PI really was for a hobby project and shouldn't really be used for hosting an external website. There are various reasons for this such as security, the power of the Raspberry PI, bandwidth and the fact that your external IP address will change at regular intervals.
This article goes some way to addressing some of the things you will need to do to connect to the website on your Raspberry PI from the outside world.
This is a proof of concept and just ideas on paper (or screen) and should not be seen as a gospel guide.
I will warn you now that I have never been that good with the networking side of things so I will try and explain as best I can. I may or may not be wrong in places and I am relying on people to correct me in the comments section.
I will warn you now that I have never been that good with the networking side of things so I will try and explain as best I can. I may or may not be wrong in places and I am relying on people to correct me in the comments section.
Get your External IP address
There are basically 2 IP addresses that are important. There is the internal IP address which you can get by running IFCONFIG in a terminal.
When you connect to the internet you will actually be using an external IP address.
I followed this guide (http://www.if-not-true-then-false.com/2010/linux-get-ip-address/) to get an external IP address.
I installed lynx first by running the following in the command line:
sudo apt-get install lynx
Then I ran the following command to get the external IP address.
lynx --dump http://ipecho.net/plain
Another way to get your external IP address is to log onto http://www.whatismyip.com/ but I will explain later why I bothered to install lynx.
Port Forwarding
- name
- wan port
- lan ip address
- lan port
- protocol
- status
Testing it out
Troubleshooting
Static IP address
Remote access to the Raspberry PI
sudo apt-get install ssmtpNext I edited the ssmtp.conf file by running the following command:
sudo nano /etc/ssmtp/ssmtp.confI then added the following to the end of the file:
root=postmaster
mailhub=smtp.gmail.com:587
hostname=raspberrypiAuthUser=myemailaddressAuthPass=myemailpasswordUseSTARTTLS=YESI pressed CTRL O to save the file and CTRL X to exit nano.
Next I edited the revaliases file by typing the following command.
sudo nano /etc/ssmtp/revaliasesWithin the file I added the following line
pi:pi@everydaylinuxuser.com:smtp.gmail.com:587
I then saved the file by pressing CTRL O and exited the file by pressing CTRL and X
Finally I set the permissions to 774 by running the following command:
sudo chmod 774 /etc/ssmtp/ssmtp.confAll of this basically enables me to send an email.
To send an email all I have to do is run a command and output it to the mail command. For example:
lynx --dump http://ipecho.net/plain | mail -s "Your PI IP" me@myemailaddress.comThis emails my IP address to my email address
Obviously this only does it once and so it would be better if it sent me an email at regular intervals so that I can see if there has been a change.
To do this I added the above command to a script called sendmemyIP.sh. I opened the script by typing the following:
sudo nano sendmemyIP.shI then copied the lynx command into the script and pressed CTRL O to save and CTRL X to exit nano.
To get the script to run regularly I added it as a cron job by copying sendmemyIP.sh to /etc/cron.hourly.
sudo cp sendmemyIP.sh /etc/cron.hourly/sendmemyIP.shNow when my Raspberry PI is turned on it will send the IP address to my email inbox once an hour.
I can then use this IP address within putty or ssh to access my Raspberry PI from anywhere.
Summary
3 comments:
Feel free to comment on any of the blog posts. Please try to be constructive.
Offensive messages will be removed as will blatant adverts for misleading products and sites.
Thanks for visiting my blog
Monday, 3 June 2013
Introduction
Why set up a Web Server on the Raspberry PI?
Assumptions
MySQL will be installed as the database server.
Get your IP Address
ifconfigThis will return an IP address in the form of 192.168.1.x where x is the 4th number. (For example 30).
If you follow this guide direct from the PI then you can get away with using localhost instead of the IP address when specified later on in the guide and you can skip the SSH step below.
SSH
If you plan to SSH onto the Raspberry PI from within Linux open a terminal window and type SSH 192.168.1.x (where x is the last number).
Whether you are running from within Windows or Linux you will be asked for the username and password. You should enter "pi" as the user and the password you set up for the "pi" user when you installed Raspbian.
You should now be logged in via SSH.
Update your repositories
sudo apt-get update
Installing Lighttpd
sudo apt-get install lighttpd
To test whether the web server is installed correctly type the following into the web browser address bar:
http://192.168.1.xReplace x with the last number of your IP address. If you are running directly on the Raspberry PI then you can just enter the following:
http://localhostYou should see a placeholder page as shown above.
Installing PHP
sudo apt-get install php5-cgi
Now you need to add a line to the php.ini file. To do this there is a file called php.ini in /etc/php5/cgi.
Type the following:
sudo nano /etc/php5/cgi/php.iniNavigate to the bottom of the file and add the following line.
cgi.fix_pathinfo = 1To save the file press CTRL and O on the keyboard and to exit nano press CTRL and X.
sudo lighty-enable-mod fastcgi(PLEASE NOTE THIS WAS MISSING FROM THE ORIGINAL VERSION)
Now type the following:
sudo lighty-enable-mod fastcgi-phpNow the web server needs to be restarted.
sudo /etc/init.d/lighttpd restart
Create a test PHP script
sudo nano /var/www/phpinfo.phpNow within nano enter the following script:
<?php phpinfo();?>Press CTRL and O to save the file and CTRL and X to exit nano.
Within a web browser type the following into the address bar:
http://192.168.1.x/phpinfo.phpReplace x with the last number of your IP address. If you are running directly on the Raspberry PI then you can just enter the following:
http://localhost/phpinfo.php
Install MySQL
There are three applications that will be installed for MySQL:- MySQL-Server
- MySQL-Client
- PHPMyAdmin
MySQL-Server is the actual database server.
MySQL-Client enables you to interact with the server from the command line.
PHPMyAdmin enables you to interact with the server from within a web browser.
To install all three applications at once type the following into the terminal window:
sudo apt-get install mysql-server mysql-client phpmyadmin
sudo /etc/init.d/lighttpd restart
http://192.168.1.x/phpmyadminReplace x with the last number of your IP address. If you are running directly on the Raspberry PI then you can just enter the following:
http://localhost/phpmyadmin
Summary
Setting up a personal web server on the Raspberry PI
Introduction
Why set up a Web Server on the Raspberry PI?
Assumptions
MySQL will be installed as the database server.
Get your IP Address
ifconfigThis will return an IP address in the form of 192.168.1.x where x is the 4th number. (For example 30).
If you follow this guide direct from the PI then you can get away with using localhost instead of the IP address when specified later on in the guide and you can skip the SSH step below.
SSH
If you plan to SSH onto the Raspberry PI from within Linux open a terminal window and type SSH 192.168.1.x (where x is the last number).
Whether you are running from within Windows or Linux you will be asked for the username and password. You should enter "pi" as the user and the password you set up for the "pi" user when you installed Raspbian.
You should now be logged in via SSH.
Update your repositories
sudo apt-get update
Installing Lighttpd
sudo apt-get install lighttpd
To test whether the web server is installed correctly type the following into the web browser address bar:
http://192.168.1.xReplace x with the last number of your IP address. If you are running directly on the Raspberry PI then you can just enter the following:
http://localhostYou should see a placeholder page as shown above.
Installing PHP
sudo apt-get install php5-cgi
Now you need to add a line to the php.ini file. To do this there is a file called php.ini in /etc/php5/cgi.
Type the following:
sudo nano /etc/php5/cgi/php.iniNavigate to the bottom of the file and add the following line.
cgi.fix_pathinfo = 1To save the file press CTRL and O on the keyboard and to exit nano press CTRL and X.
sudo lighty-enable-mod fastcgi(PLEASE NOTE THIS WAS MISSING FROM THE ORIGINAL VERSION)
Now type the following:
sudo lighty-enable-mod fastcgi-phpNow the web server needs to be restarted.
sudo /etc/init.d/lighttpd restart
Create a test PHP script
sudo nano /var/www/phpinfo.phpNow within nano enter the following script:
<?php phpinfo();?>Press CTRL and O to save the file and CTRL and X to exit nano.
Within a web browser type the following into the address bar:
http://192.168.1.x/phpinfo.phpReplace x with the last number of your IP address. If you are running directly on the Raspberry PI then you can just enter the following:
http://localhost/phpinfo.php
Install MySQL
There are three applications that will be installed for MySQL:- MySQL-Server
- MySQL-Client
- PHPMyAdmin
MySQL-Server is the actual database server.
MySQL-Client enables you to interact with the server from the command line.
PHPMyAdmin enables you to interact with the server from within a web browser.
To install all three applications at once type the following into the terminal window:
sudo apt-get install mysql-server mysql-client phpmyadmin
sudo /etc/init.d/lighttpd restart
http://192.168.1.x/phpmyadminReplace x with the last number of your IP address. If you are running directly on the Raspberry PI then you can just enter the following:
http://localhost/phpmyadmin
Summary
27 comments:
Feel free to comment on any of the blog posts. Please try to be constructive.
Offensive messages will be removed as will blatant adverts for misleading products and sites.
Thanks for visiting my blog
-
Introduction One of the most talked about topics of the last year has been the Windows 8 debacle and how it is now much more difficult to...
-
Introduction One of the most common questions asked on the Linux based sub-reddits at Reddit.com is "Which Linux distribution wou...
-
Introduction The “Everyday Linux User” website is dedicated to the average, ordinary, everyday, computer user who has a basic working kn...
-
Introduction A short while ago I wrote an article called 12 great linux operating systems for netbooks . That article has been a huge suc...
-
Introduction I have recently written a series of articles showing How to install PCLinuxOS alongside Windows XP . There are a number of...
Popular Posts
Subscribe
Popular This Month
What are other people buying?
Lubuntu |
PCLinuxOS |
Linux Mint |
Manjaro |
Knoppix |
- Android netbook review
- antiX
- Apache
- Arch Linux
- Backup
- Bodhi Review
- book review
- buy linux dvd
- buy linux laptops
- contest
- Crunchbang Linux
- cryptolocker
- Debian
- dual boot
- dual boot ubuntu
- Elementary OS
- Emmabuntus
- Fedora Linux
- Fuduntu
- GadgetShowLive
- Games Emulation LINUX
- google nexus
- Great little tools
- Guest Post
- how to
- install ubuntu
- Installing MySQL
- interview
- Knoppix
- Knoppix Review
- korora
- kubuntu
- LAMP Stack
- Libre Office
- Lighttpd
- Lightweight LINUX Distro
- linux
- linux applications
- linux blogs
- LINUX Championship Manager
- linux cheat sheet
- Linux clothing
- LINUX Editorial
- LINUX Gaming
- Linux Interview
- Linux Lite
- linux magazines
- LINUX MINT 12
- LINUX MINT Review
- linux music
- linux podcasts
- LINUX Review
- LINUX Review|
- LINUX Story
- LINUX Tools
- lubuntu
- Lucid Puppy
- Lucid Puppy 528
- Lucid Puppy Review
- MacPup
- MacPup 528
- MacPup LINUX
- MacPup Review
- Mageia
- Manjaro Linux
- Minecraft
- MIR
- Mozillux
- multiboot usb
- my ubuntu blog
- MySQL
- netbook
- OpenSUSE review
- OPML
- OS4 Linux
- PCLinuxOS
- Peppermint Linux
- Peppermint LINUX 2
- Peppermint LINUX Review
- PHP
- podcast
- Point Linux Review
- poll
- polls
- portable apps
- Puppy LINUX
- Puppy LINUX Review
- Puppy LINUX Tips
- PupSnap
- Raspberry PI
- Retro gaming LINUX
- Review
- reviews
- ripping music
- Screen Capture Tool
- Slacko Puppy
- Slacko Review
- SLAX
- Snowlinux review
- Solus OS Review
- sparkylinux
- streamripper
- survey
- Thunderbird
- Thunderbird Email Tips
- tutorial
- tutorials
- UBUNTU
- ubuntu 13.10
- ubuntu review
- Ubuntu Vs PCLinuxOS
- upgrade ubuntu
- video editing
- Videos
- Wary
- Wary Review
- What is Linux
- which distro
- Windows
- Windows 8
- windows vista
- Windows xp
- XFCE
- xubuntu
- xubuntu review
- Zorin
- Zorin 6
- Zorin 6 Review
- Zorin 6 Tips
- Zorin LINUX
- Zorin Screenshots