Installing Ubuntu As A Development Web Server
Mar 26, 2009Recently I've been noticing lots and lots of error messages on my home development server. So, last weekend in between painting the shutters and scraping the porch, I reinstalled Ubuntu on an old IBM NetVista 6578-LAU that was given to me years ago. (NetVista... right, this thing still has a "Designed for Windows 98" sticker on it). The server's specs are unimpressive, 700 MHz Pentium III processor, 512 MB of RAM, and I added a 160 GB HDD to it, but, it's enough for me to play with Moodle, Joomla, and VTCalendar that I use in the websites I work with.
My requirements were fairly simple, I wanted to be able to manage the server primarily from my school-issued Windows XP laptop. I don't mind using the Ubuntu interface, but, I primarily run this "server" without a monitor and access it via Firefox, VNC, and Samba. This led me to install Ubuntu Desktop Edition, the LAMP stack and Webmin on my little server I called Tux. The notes below are how I did it. This configuration provides the most efficient tools for me, your mileage may vary. :-)
So, first, I installed Ubuntu 8.10 (Intrepid Ibex). I had recently requested a free set of CDs for my Networking classes, and I just really like how simple Ubuntu is to use and install.
After your first boot, go ahead and do the recommended system updates. This will take quite a while, so, I use the time wisely by doing the following steps:
Note: many of my notes use the domain tux.edu. This is an intranet domain that I set up on my Smoothwall firewall for in-house testing. I don't own this domain, but, it's appropriate since my machine's hostname is Tux and I learn on it. ;-)
Create a root password
I know it's not the "Ubuntu" way, but I started using Linux with early versions of Mandriva, Red Hat, and even Gentoo. I'll admit it... I'm used to having root access, I just don't like sudo, so, to actually have a root password and use su again type the command:
sudo passwd
Note: by issuing this command you can issue su - one time and avoid having to use sudo anywhere below.
Allow Others to View Your Desktop (Remote Desktop for VNC)
I connect to my server when I want to look at a Linux desktop via VNC (I like UltraVNC) at tux.edu:0. Just enable remote desktop and all is well... see the screenshot below:
System > Preferences > Remote Desktop
After rebooting the fun begins... I add new services and programs to allow me to use this as a development server:
Add SFTP and SSH support
Allows access to sftp and ssh into the server (this is disabled by default in Ubuntu)
sudo apt-get install openssh-server openssh-clientI like SSH Secure Shell Client v 3.2.9 as my Windows SSH (and SFTP) client. It's been discontinued by SSH Secure Shell , but, it's free and available for use for education.
Add LAMP (Apache, MySQL, and PHP)
This is almost too easy to install LAMP in Ubuntu. I found https://help.ubuntu.com/community/ApacheMySQLPHP which mentions the following command:
sudo tasksel install lamp-serverAdd Moodle-specific php extensions
I do a lot of work with Moodle, these extensions are used in current and future versions of Moodle. They are a must-have for me...
sudo apt-get install php5-curl php5-xmlrpcAdd Webmin for easy remote management
I used Webmin on my very first Linux server, and I've recently "rediscovered" it. From http://www.ubuntugeek.com/ubuntu-serverinstall-gui-and-webmin-in-ubuntu-810-intrepid-ibex-guide.html, issue the following commands:
sudo aptitude install perl libnet-ssleay-perl openssl libauthen-pam-perl libpam-runtime libio-pty-perl libmd5-perlLatest version of Webmin as of 3/20/09 is 1.470 so.. enter the following:
wget http://prdownloads.sourceforge.net/webadmin/webmin_1.470_all.deb
sudo dpkg -i webmin_1.470_all.debI can then login to webmin at https://tux.edu:10000
Add user to www-data group
So that I can easily add files to the web server directory, I like to add my local user to the www-data group. To do that:
Click on System > Users and groups
Locate and click on local user - geof
In Secondary Groups - scroll down to locate www-data group
Press -> to add as a group
Create html directory
Red Hat and most of my web hosts have an html directory (or httpdocs, etc). I like to create one in Ubuntu too... so, using Webmin or my SSH Client:
cd /var/www/
sudo mkdir html
sudo chown geof:www-data htmlThis allows my local user - geof - to be able to write to my html directory without having to worry about changing permissions, etc later. Quick and easy...
Use html directory as the location of all documents in web server
In Webmin...
Servers > Apache Webserver
Click on Existing virtual hosts tab
Click on Virtual Server icon (see pic)

Scroll down to Document Root and enter new directory /var/www/html
Press the Save button here, then go back up to the top right of the screen and click the Apply Changes link
Add phpMyAdmin
phpMyAdmin is the de facto standard for managing MySQL databases, it's the simplest way to manage databases for all of my LAMP scripts.
sudo apt-get install phpmyadmin** Note: I ran into an issue here, I couldn't get http://tux.edu/phpmyadmin/ to work... maybe because I added /var/www/html to the mix?? Entering the following commands "fixed" my issue, maybe it will yours.
cd /var/www/html
sudo ln -sf /usr/share/phpmyadmin/Extras
To have a "squiggle account" for quick tests (i.e. http://tux.edu/~geof). I used directions from: http://www.virtualmin.com/forums/help-home-for-newbies/preview-web-site-before-dns-propagation-.html#17477
In Webmin
Servers > Apache Web Server
Click on Global Configuration tab
Click on Configure Apache Modules
Place check beside userdir
Press the Enable Selected Modules button at the bottom of the page, then go back up to the top right of the screen and click the Apply Changes link
Samba (Windows File Sharing)
Must have for me to easily swap files between Windows laptop and server. Directions from: http://www.howtogeek.com/howto/ubuntu/install-samba-server-on-ubuntu/ helped me here.
sudo aptitude install samba smbfsUse Webmin to configure samba
I always hated configuring samba... how many times have I had to redit the smb.conf file to add new features. Webmin makes this so much easier. Directions from: http://www.webmin.com/samba-howto.html
In Webmin
Servers > Samba Windows File Sharing
Click on Windows Networking
Enter details... my screen is shown below:
Press the Save button on the bottom of the screen
Next click on the Authentication Icon next to the Windows Networking Icon. Enable encrypted passwords then save the changes.
Click on the File Share Defaults icon and then on the Security and Access icon.
Enter details... my screen is shown below: (note that my network is pretty secure, and I only use this at home)
By default your home directories are shared when you enable Samba, so, you should have no problems accessing the public_html files we added before (squiggle account), but, most of the stuff we need in in /var/www/html so, why not add that as a Windows share?
In Webmin at Servers > Samba Windows File Sharing
Click on the Create a new file share. link on the top of the page
Enter the details to create html as a Windows Share on your server
Be sure to check the Security and Access Control to ensure that your user is a valid user.
Once done, click on Restart Samba Server to activate all the changes you've made.
Issue the
smbpasswd command in a Terminal OR Webmin (Others > Command Shell)Well, that does it! This left me with a local server I could administer and/or use on my network via web browser, My Network Places and SFTP/SSH. Note that there is also a File Browser in Webmin as well (Others > File Manager) - so you can upload files and manage your server from anywhere you can access this server by IP address.
Moodle Admin Basics
Mar 19, 2009As the main administrator of several Moodle sites, I'm often asked by new Moodle admins how to begin this daunting process. The first recommendation is to join the forums at moodle.org, I seriously could not survive without them. Secondly, pick up a book (or two) on Moodle. Then, let me start by giving what I feel are the basics of Moodle. This should help to understand what you're dealing with. I'm going to start at the ground level here, so, forgive me if I seem to go over concepts that you already know...
The LAMP stack
Most of us have probably done some type of website hosting and/or development before. You may be very proficient in html and editing those files. The first thing to understand about Moodle is that this is NOT an html based website. Moodle is written using PHP and all of the pages are stored in a database, usually MySQL. This means that you cannot simply download Moodle from moodle.org, double-click on it, and expect it to work.
PHP is a scripting language and requires a server for it to operate, that server is usually the Apache HTTP Server. MySQL databases also require a server to operate. These "servers" are actually services that run inside of an operating system. These elements make up what is called the Linux, Apache, MySQL, and PHP (LAMP) stack, this stack refers to these core services running inside of a Linux operating system. That is not to be said that other alternatives to these do not exist, but, the LAMP stack is the normal development environment for moodle and is the most common installation.
Moodle structure
When Moodle is installed, four important things happen.
1 - The Moodle php files are copied into the web directory
2 - The MySQL database is populated with information that allows Moodle to run
3 - The moodledata folder is created and populated with data - this data consists of anything that your users save as well as any course data
4 - The config.php file is created and populated with information specific to the computer it is installed in
This means that before you can install Moodle you will need to make sure you have working Apache, MySQL and PHP servers. Once that is complete, you can copy the Moodle files into the web directory and start these services. Then you will need to create a MySQL database. From there you can initiate the Moodle installation script in your web browser. Next, you'll need to find a place to put your moodledata folder. This folder should be outside of the main web directory, but, writable by Apache. Note: This sometimes is not available on some web hosts, when all else fails place your moodledata folder in your main web directory. In spite of the dire warnings issued, your folder is still safe from prying eyes in most cases. Finally, the Moodle installation script will create the config.php file to make sure that Apache, MySQL, and PHP know where everything is located.
Your Moodle server
Installing Moodle in the LAMP stack is recommended, but, not always appropriate for all users. Installing LAMP and then Moodle is beyond the scope of this discussion, but, there are alternatives for those new moodle admins who want to get used to the moodle interface without having to learn Linux or want to create a testing environment on a local PC. The alternatives I am mentioning here will be geared mostly for Windows users, but understand that there are Mac OSX alternatives as well.
Moodle.org provides a Moodle package for Windows based on XAMPP. (Note that Moodle packages for Mac OSX are also available). Instructions for using the Moodle package for Windows are available from MoodleDocs.
In addition to this option, The Uniform Server (called UniServer for short) provides a Apache, MySQL, and PHP like the above package, but, at a much smaller file size. Instructions for installing Moodle in the latest version of UniServer are available at the Uniform Server Wiki.
Tools of the trade
Moodle administration actually requires very few tools. Since Moodle itself is browser based, a good web browser is recommended. Mozilla Firefox is highly recommended for Moodle administration and can be extended for other purposes as well. PHP files may require some modifications (especially config.php), so, a good text editor is also recommended. Windows Notepad is adequate for the job, but, often does not correctly render line breaks. Notepad2 and Notepad++ are my personal favorites for editing moodle files. Note that web design software like Dreamweaver will also correctly display php files, but, you will not be able to preview those files until they are running in a browser on the server.
Furthermore, once your moodle site is hosted elsewhere you will probably need a good FTP client like FileZilla or the FireFTP firefox extension. Depending on your web host's requirements you may also need a good SFTP and/or SSH client as well. I highly recommend SSH Secure Shell
New & Improved
Mar 17, 2009I've spent the past few days playing around with my TeachAGeek domain. I've enabled Google Apps for my domain, I've even moved my blog from my "free" GoDaddy blog to Blogger. This means that some of the old links and such may not work, but, I think I've ironed out most of those issues.
I have run in to problems with my "naked domain" i.e. http://teachageek.com working, but, hopefully the directions I've found here should remedy this situation. We'll see tomorrow how it all works out.
I am amazed that I am able to host a blog without a web host... I'm using Blogger (of course), Picasa Web Albums (this is actually part of Blogger) and photobucket for images. I've also discovered Dropbox for hosting files. If you'd like to sign up for Dropbox (shameless plug here), please use my Dropbox referral (https://www.getdropbox.com/referrals/NTc2NDU5MDk). This gets you an extra 256 MB of space, and me too.
I'm even using Dropbox for those large files that I want to share in Moodle, particularly when I have a limit on the amount of uploads. Give it a try!
The Uniform Server Revisited
Mar 5, 2009Today's RSS feeds brought me a surprise, though, Around the Corner - MGuhlin.org specifically mentioned this old article in his discussion of a Moodle "sandbox" for those new Moodle administrators - Set Up Your Own Moodle Server for Training. So, I went back to my old favorite and discovered that UniServer had recently been updated to version 4.0-Mona. This version isn't specificially mentioned on the Uniform Server website (yet), but, is the latest version available at their SourceForge project page.
I was impressed with the new "Unicontroller" that allows you to easily view and start your server. The "Apanel" is simple to use, and relatively self explanatory. I was also very happy to see that UniServer was able to install the latest weekly build of Moodle without any hiccups what so ever.
UniServer is not quite ready for Moodle 2.0, however - when I looked at http://localhost/moodle/admin/environment.php?version=2.0, it showed that the Zip PHP Extension is not available - all other components passed.

NOTE: This problem is actually VERY easy to overcome. According to Moodle Docs: admin/environment/php extension/zip all that needs to happen is to "uncomment the line extension=php_zip.dll in the php.ini file". After checking my Uniserver folder at F:\UniServer\udrive\usr\local\php, I noticed that the php_zip.dll file is missing from the extensions folder. So, I downloaded the Windows Binary zip file at www.php.net and then copied the php_zip.dll file from the ext folder into F:\UniServer\udrive\usr\local\php\extensions. I then opened up the php.ini file in Notepad and removed the ";" from the extension=php_zip.ini line (line 602 in my php.ini file). Restart Apache (Stop Apache and then Start Apache) and this restriction is gone!
The Installing Moodle on 4.0-Mona article on the UniServer Wiki has some really good tips here. I'd want to point out to portable (flash drive) users the section on Hard Coded Paths. The most amazing thing I've ever seen was their discussion on how to Automatically Run Cron. Honestly, I'd long ago given up on Cron in XAMPP or UniServer and just manually run Cron when I needed to. The steps here work - amazing....
It's also interesting to note that the steps that I originally mentioned in "How to enable The Uniform Server for public access" are still applicable in 4.0-Mona. Making those simple changes in the .htaccess file will enable external users to view your site hosted with UniServer.
One other thing that might be useful to add here is a small addition to the config.php file for those users who use UniServer on a laptop. Since the config.php file lists the wwwroot as "localhost" external users are unable to view your moodle site correctly. For that reason, I would recommend the following changes to config.php:
Locate the 'wwwroot' line in config.php
$CFG->wwwroot = 'http://localhost/moodle';Replace the above line with the following two lines, to let php figure out what your current IP address is and change it whenever your IP address changes. This can be very useful when moving from event to event.
$domain = GetHostByName($REMOTE_ADDR);
$CFG->wwwroot = 'http://'.$domain.'/moodle';In conclusion, The Uniform Server (UniServe) is an excellent alternative to XAMPP. It may actually be preferred over XAMPP due to it's simplicity and more obvious - it's size. A default XAMPP install is approximately 221 MB, XAMPPlite is approximately 116 MB. UniServer is only 43.4 MB. UniServer with a default Moodle install (including php_zip.dll) is approximately 94.5 MB.
The Uniform Server is one alternative to hosting a "sandbox" Moodle Server for Training. I will admit that I gave up on this powerful little WAMP server, but, I won't again. Give it a try, I think it should meet your needs and save you a little space too!
Open Source Education
Mar 1, 2009Through my perusal of my RSS feeds this afternoon, I caught the following article - Choices Abound - Google Moodle Microsoft and Blackboard. MGhulin mentioned (and I feel I must emphasize) the FREE series of Online Courses available from INGOTS that can be setup for use in a Moodle without problem. Using the link above, brought me to a series of courses that could be integrated into a school system's Moodle then modified to fit their own needs. Wow... amazing.
This thought of Open Source Education flooded my brain cells. Thinking of the Open Source Definition, I can only hope for a day when the teaching and learning process embraces these concepts. Imagine... it's easy if you try:
- Free Redistribution - schools (or school systems, or Departments of Public Instruction) create a course and freely trade it to other schools so that all students are learning the same concepts, using the same resources. The price (free) would help to redirect school budgets to quality curriculum development so that better courses are developed and better teachers are trained.
- Source Code - no more copyrights on educational material would ensure that material is updated frequently. Access to the source files would also make sure that factual errors don't exist for long, as many eyes catch many mistakes. Teachers are also amazingly resourceful with material. Give teachers the ability to update their own curriculum and new strategies and ideas would be sure to develop and spread.
- Derived Works - when new ideas and strategies do develop allowing existing materials to be modified using these concepts would only improve them. Creating new courses and improving them, only makes things stronger.
- Integrity of the Author's Source Code - educators are somewhat territorial, but, this clause might allow for some to release their "source" but still keep control over what is said. This idea of "forks" would encourage individuality and differences to be brought to the educational community and competition would still occur for the best idea.
- No Descrimination Against Persons or Groups - isn't equal education what we're all about?
- No Descrimination Against Fields of Endeavor - who's to say Math materials can't be used in Science classes, even English classes? Let's call this one interdisciplinary studies...
- Distribution of License - no "hidden clauses" make all teaching and learning transparent to all parties involved.
- License Must Not Be Specific to a Product - no curriculum or topic should be specifically designed for a certain school system or country. I'd also think that this might add a tie-in to allow some of the traditional education resources to be used in corporate training programs and vice versa.
- License Must Not Restrict Other Software - everything a school system does doesn't have to be "open source". Privacy and security needs must be recognized. But this should not be the ONLY consideration.
- License Must Be Technology-Neutral - focusing on one particular way of doing anything leads to serious problems if it ever comes to realization that we're doing the wrong thing. Whether this be in teaching Microsoft Office as a Computer Applications class, or emphisizing SAS or Cisco in IT courses. Vendor-neutral wherever possible can make things a lot more universal.
Curriculum (and Professional) Development
I've been involved in a curriculum writing weekend this weekend... wow, what "fun".
That is an unusual thing to those people who have never been involved, I'm sure. Imagine sitting together in a room for two days reviewing student handouts, test questions, and totally engrossing yourself into a course. For several of my students this would undoubtedly be some type of medieval torture, but, for a select few of us it is "fun".
You see, the course I help to develop is one of the QTL IT Courses. We attempt to keep the concept relatively simple. A group of individuals who have taught and played with these concepts for years sit down with CompTIA objectives and create materials that represent the objectives. Student Handouts, Worksheets, Activities, Tests, Quizzes, etc... everything that is presented to students is created by teachers for teachers. Every single word is compiled and / or created by a simple school teacher.
Not that "simple" would describe many of us, each of us come with our own individual areas of expertise and interests. Many of us have tinkered with computers since the days we first saw those mysterious machines. Some have initimate knowledge of concepts from actually installing networks in schools to working "behind the scenes" at businesses both large and small.
Yes, these curriculum weekends are unusual to say the least. I sit in a small room with a group of colleagues whom I've grown to call "friends" over the years, we dig through documents that each of us have presented to students. Each of us have had a hand at writing questions or handouts and friendly gibes and witty banter are swapped freely - the question of "What were you thinking?" is asked quite frequently. Questions are agonized over, documents are editing for grammar and brought up to date. It is often amazing to think how quickly something as simple as a hard drive can change over a period of 1-2 years. Our fearless leader - thanks, Robin - watches in amazement as a room full of knowledge is somehow boiled down to create documents and questions that will go on to challenge student minds (and a few DPI administrators) for yet another school year.
Anyway, these weekends always give me a chance to sharpen my professional skills, writing is not the least of these, but, I always leave more focused on trying to learn more about technology so that I can be sure to bring new topics and ideas to my students. I suppose that I have to say that this "professional development" stuff that I'm often asked forced to participate in seems to pale in comparison with this kind of development. The concept of a Professional Learning Community can be a powerful one, but, only where each individual is given the opportunity to participate and learn from everyone else. I'm happy to say that this weekend was a perfect example of that type of community.
I can only conclude in saying to each and every teacher, that if you're not a member of such a Community, then either join one or create one yourself. Find a group of individuals who are passionate about the subject you teach, discuss and share ideas. You'll be amazed at what you can learn from this....
Do you blog?
"Do you blog?" was a question asked of me... by a colleague who has come to respect my opinion and thoughts on things. Wow, what a question....
Yes, I bought the domain name, yes, I set up a "blog" thanks to a free setup from GoDaddy. Yes, I've even published a few entries, that some people have read and used. But, do I actually blog? Probably not. So, over the past few weeks, I've wondered "why not"?
I don't have time - I do a variety of things, both personal and professional that keep me from pounding away at a keyboard with my thoughts, but, is that a good enough reason?
Nah, I guess not... I'm usually willing enough to stop what I'm doing and help out someone who needs it. Lord only knows that my thoughts are random enough, but, I can usually help out with a decent enough effort.
So, I'll attempt again to pick up this blogging thing again. I'll attempt to note interesting items and thoughts as I go, who knows, maybe it will be helpful to others....
So, my answer to my initial question is... "yes, but, I'm only starting". I'll try to think of this as a new idea and a new effort.
Let's try this again, shall we?









