I’ve used the instructions here to set up a script that emails my desktop’s IP address to me.
Their instructions are five years old, so I had to make some additions:
- In Gmail, you need to enable Access to Less Secure Apps.
- I had to add ‘touch ip.txt’ to their bash script right before ‘read ip1 < ip.txt’, otherwise the script just hung at that line forever.
- ifconfig.me sometimes returns nothing for IP. This makes the routine think your IP has changed (into nothing). To avoid this, I put the call to ifconfig.me inside a while loop that tries to call again until it gets a response.
I need to email myself my IP because, otherwise, my ISP might change my IP address (a la dynamic IP), and then I wouldn’t know where to find my website anymore.
Since now I will always be able to find my home IP, I can always access my website from anywhere in the world.
read ip1 < ip.txt
while [ “$ip2” = “” ]
ip2=$(wget -qO- ifconfig.me/ip)
if [ “$ip1” = “$ip2” ]
echo “$ip2” > ip.txt
echo “$ip2” | mail -s $SUBJ $EMAIL
I’m going to set up Apache on my desktop. It’s going to be a pain in the ass. I might as well document the experience here.
What is Apache?
Apache is a web server program. Following the butler-and-house metaphor from my post on website ownership, Apache is the hollow shell of the butler. When you write a program to control the butler (your website), you will store them on the Apache server.
If I understand correctly, installing and configuring Apache on my computer will allow me to use my desktop as a website server. I will still need to buy a domain name in order to make that website accessible from the Internet.
Andy’s instructions are about 12 years old, and it looks like the Apache website has evolved significantly since his heyday. The homepage is an extremely noisy mess of ‘Latest News’es and ‘Latest Activity’es and what-have-you-es.
Hidden away in the upper-right-hand corner is a promising button called Download. Eureka!
Not quite. Rather than the big shiny ‘Download’ button I was hoping to find, the Download page is a list of mirrors. Annoying… but at the top of the page they list a recommended mirror, so let’s click on that.
Uh oh. That takes you to a huge list of directories. The page explains that these “contain current software releases from the Apache Software Foundation projects.” All of them do? How many versions of Apache do you need?
This is getting too painful. Trying a different approach…
Getting Apache, Take 2
So instead of trying to be smart about things, I’ve decided to ask Google to do my thinking for me. Googling “how to set up ubuntu desktop as a web server” led me to a very promising guide.
Following their instructions exactly… works! It’s nice when things work. I ignored the section on phpMyAdmin because I want to learn to use MySQL.
I now have a working Apache server on my desktop. Stay tuned to see what I end up doing with it…
I found some more useful instructions. This describes some security measures that might be worth employing, as well as how to give you user account permission to write into the website without sudo-ing in every time.
I’m now running a website that is accessible over the Internet. Cool.
The only problem now is that I still don’t have a domain name. You can still find my website online, though, but only if you know that my IP address is 220.127.116.11 (and only as long as the remains my IP address – ISPs change your address periodically).
I’ll work on setting up some work-around for this. If I can manage it, then I’ll have a working and useful website for free!
We were shown this neat list in class today. It ranks programming languages by their popularity. If you’re wondering what languages to add to your resume, this might be a good place to start.