Archive for Web Apps

Drupal 5.x on Ubuntu LAMP

The quick and dirty dev install of Drupal on Ubuntu

USE THIS INFORMATION AT YOUR OWN RISK. Any information found on this website is offered only as informational and includes no warranty, guarantees or support. The author claims no authority on any subject whatsoever.

Why Drupal, Why Ubuntu?

For me it's all about community. I've always enjoyed apache web development in part because of the active and helpful user groups, forums, irc channels, etc. I use Ubuntu as the operating system for my LAMP because it's really popular right now - it has a very active forum and pretty good documentation. Drupal is an open-source content management system, or you could look at it as a framework since it was built to make it easy for coders to override almost anything it does without hacking the core. This means you could make it do anything you want if you happen to be good enough at PHP and still take advantage of core development and security updates no matter how much you modify the product.

Why write installation instructions?

Good question? Well, the installation instructions at Drupal.org are good but they cover all sorts of environments (who wants to slog through all that?) and those in the Ubuntu Community Docs are great and pretty specific but cover Drupal 4.6.7 and 5.1. I probably should update the docs at Ubuntu, perhaps I will after I hash it out here and after a few people let me know they worked or what to change. Also, I like to search for instructions specific to my situation whenever I approach a new installation. It's good to see what other people in similar circumstances have encountered, I call it due diligence. I would suggest any user doing this install review the documentation mentioned above thoroughly. Also see related links at the end of this article.

Environment

These instructions don't cover the setup of your server environment. Mine happens to be:
  • Ubuntu 6.06 LTS server
  • Apache 2.0.5.5
  • PHP 5.1.2
  • MySQL 5.0.22

Get Drupal

wget http://ftp.drupal.org/files/projects/drupal-5.7.tar.gz
tar -zxvf drupal-5.7.tar.gz

I'm a big fan of apt-get but there were a lot of issues in the forum started by people having problems with Drupal in the repositories. Community Docs recommend getting the latest package from Drupal.org, right now that happens to be Drupal 5.7. (Drupal 6 is out now as well, and is very cool, but CCK/Views aren't ready for prime-time and I'm installing for the purposes of following tutorials written for 5.x.)

Move Drupal

sudo mkdir /var/www/drupaltest
sudo mv drupal-5.3/* drupal-5.3/.htaccess /var/www/drupaltest
sudo mkdir /var/www/drupaltest/files

My apache install is pretty much setup to default config. /var/www is my web root, yours may vary. Because I'm just using this particular install as a test which I plan on destroying later I'm going to put it in the boring old subdirectory 'drupaltest', actually I named mine d57_test_01 but thought drupaltest would be more comprehendable in the example.

In the mv command we explicitly move .htaccess because it's a hidden file.

Database Setup

mysqladmin -u root -p create db_drupaltest
mysql -u root -p

Create the database for Drupal to use - you can replace 'db_drupaltest' with whatever you'd like to call the database. You'll need to enter your mySQL root password. If you get an access denied error make sure you're using the mySQL root password and not your login or Ubuntu root password. The second command puts you in mySQL monitor, the command line interface for managing your MySQL server. The commands in the next code section are SQL. You could also run this in phpMyAdmin if you'd rather have a GUI.

GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES ON drupaltest.* TO 'drupal_usr'@'localhost' IDENTIFIED BY 'secretpassword';
FLUSH PRIVILEGES; \q

Change the datebase name, the username 'drupal_usr' and 'secretpassword' to whatever you like. Just don't forget to write it down somewhere safe because you'll need to know it later.

Edit Settings.php

sudo vi /var/www/drupaltest/sites/default/settings.php

Using vi (or whatevs) change the $db_url line. Note: If you use a fancy charcters or dashes in your user, password or database names replace them URI hex encodings, this is detailed in database settings comments section in the settings.php file.

$db_url="mysql://drupal_usr:secretpassword@localhost/drupaltest";

Up Your PHP Memory Allocation

If you have a new LAMP install the default memory setting for scripts is 8M. This is redonkulous and Drupal will suck. Look for the 'Resource Limits' section and change memory_limit to 32M and then restart apache.

sudo vi /etc/php5/apache2/php.ini sudo /etc/init.d/apache2 restart

Final Steps

Go to http://localhost/drupaltest/install.php (or your servername instead of localhost if DNS is setup). You should see this:

Screenshot of Drupal Installationb Message

One last thing, if you click Administer you will probably get a 'one or more problems were detected' error message. Two things: your files directory isn't writable and you cron job hasn't run. The first one is easy - just make the files area writable by all:

sudo chmod 777 /var/www/drupaltest/files

As for cron, you can just click 'run cron manually' on the Status report page - but you'll need to do this anytime you want to update the index. For a quick dev install you're likely to trash soon it may not be necessary but for a production or long-term dev install you'll want to set up a cron job to hit http://localhost/drupaltest/admin/logs/status/run-cron every few minutes depending upon your site's traffic and requirements. See Configuring cron jobs in Drupal's Getting Started guide for more.

That's it. Good luck folks, now enjoy surfing the Drupal learning curve...heheh.

Related Links

Comments

Installing Plone 3.0 on Ubuntu 6.06

Plone on Ubuntu
Plone 3.0.2 on an 32-bit Ubuntu 6.06 LTS ‘Dapper Drake’ LAMP

What is Plone? - Plone is a pretty cool content management system (CMS). Well, I think it’s cool based on some videos and documentation on their site. After comparing a lot of CMS options (including some really expensive closed-source stuff and 2 weeks of developer training on Sharepoint) I’m trying out Plone because a) open source is cool. b) Google people are smart, c) it supports LDAP authentication which I need for my all-M$ work enviro, d) there’s training/conferences/books/commercial support!? available and d) I’ve read some great reviews and CMS comparisons that rated it #1.

That was the good, now the most common complaint: hellish learning curve. Well, if you’re a developer and you’re going to customize beyond the existing system and available plugins. Why? Well, you’ll have to learn some python and the database is the rather obscure Zope instead of MySQL or SQL. In fact, I just read this on 456 Berea St (one of my fav dev blogs) and it gave me the shivers:

And the inital learning curve, even though I was a fairly good python programmer, was insane.

Then again, people told me Perl was insane too and I loved working with Perl. Besides, we’re just playing right now, right?

What is Ubuntu? - Ubuntu is a community developed, linux-based operating system that I use for a web server. ‘Dapper Drake’ is the release name for 6.06 LTS. (Keyword: LTS - long term support). It’s surprisingly easy to install. If you’re bored, geeky and/or have extra VMs or boxes lying around you should try a LAMP install and get your web server up in 15 minutes!

There’s already a Plone From Scratch HOWTO on the Ubuntu Forums, however it is for a previous version of Plone (2.0.5) and uses the apt-get method which I’ve noticed a lot of people in the forums having trouble with. Disclaimer: I do not provide ‘undo/uninstall’ instructions, other than, whip up a a LAMP on VMware and test it first or backup your system. I would welcome uninstall directions if someone who knows what they are doing could provide them.

Doesn’t Plone provide installation instructions? Well, yes. But when I started to read them I got real nervous. What the heck is gcc? libssl? TLS? etc. Those poor geeks at Plone don’t realize how noob noob can be! I tried to find better instructions (for me) at the Ubuntu Forums and instead I found a lot of people having problems trying to install Plone via Synaptic or apt-get instead of using Plone’s instructions. So here ya go.

You should already have gcc, g++, make and tar installed by default, but if you want to be anal do this:

sudo apt-get update
sudo apt-get install gcc g++ make tar

Sidetrack > (Possibly totally unnecessary step!) If you’re a fair server noob like me you have no idea what libssl and readline libraries and development headers are and what the heck is TLS? Google suggests it has something to do with mail encryption. I read some confusing stuff on Ubuntu Forums about RPM and a program called Alien that converts RPMs to DEB packages seemed probably unrelated but like a handy utility to have and so:

sudo apt-get install alien

Download the Plone Installer Package. I saved it in my home folder - it doesn’t really matter where you put it so long as you can find it.

wget -c http://plone.googlecode.com/files/Plone-3.0.2-UnifiedInstaller-Rev2.tar.gz
tar zxf Plone-3.0.2-UnifiedInstaller-Rev2.tar.gz
cd Plone-3.0.2-UnifiedInstaller

Here’s where you have to pay attention. You can do a ZEO or Stand-Alone install. “WTF?” you say? Yeah, well just pick your poison after reading all about it. Me, I’m doing a Stand-Alone as root install.

According to the README.TXT in the installation package my choice of standalone instance installed as root will result in Plone being installed to /opt/Plone-3.0.2 and libz and libjpeg libraries getting built in /user/local. A “plone” user will be added and Zope will be configured to run under that user id. You need to start Zope as root user (via sudo).

sudo ./install.sh standalone

Then a whole bunch of stuff happens. Lots of gcc (compiling) and checking for things (lots of yes and a few no-s in my case). Just wait, watch, hail Mary and knock on wood. This is a good time to read about the rest of this tutorial or creating new Zope/Plone instances if you want to do that. Or just catch up on your RSS feeds and I’ll hold your hand some more ;o)

If you’re real lucky, this is what you’ll see when it’s all said and done:


#####################################################################
###################### Installation Complete ######################
Use the account information below to log into the Zope Management Interface
The account has full ‘Manager’ privileges.
Username: admin
Password: XXXXXXX
Before you start Plone, you should review the settings in:
/opt/Plone-3.0.2/zinstance/etc/zope.conf
Adjust the ports Plone uses before starting the site, if necessary
To start Plone, issue the following command in a Terminal window:
sudo /opt/Plone-3.0.2/zinstance/bin/zopectl start
To stop Plone, issue the following command in a Terminal window:
sudo /opt/Plone-3.0.2/zinstance/bin/zopectl stop
Plone successfully installed at /opt/Plone-3.0.2
See /opt/Plone-3.0.2/zinstance/adminPassword.txt
for password and startup instructions
Ask for help on plone-users list or #plone
Submit feedback and report errors at http://dev.plone.org/plone
This installer was created by Kamal Gill (kamalgill at mac.com)
Maintainers for Plone 3 are Kamal Gill and Steve McMahon (steve at dcn.org)

First, write down your admin password!! Then, check zope.conf to ‘review settings’. I’m not familiar with them, so I just scanned for the port. Found it on line 969 (YMMV), set to the default Zope/Plone standalone install grabs, port 8080.

sudo vi /opt/Plone-3.0.2/zinstance/etc/zope.conf

Use :q! to quit vi without messing anything up

Use netcat to see what ports you have open already. (Netcat comes with Ubuntu install)

nc -z -v -w2 localhost 1-65535

After confirming that 8080 is avail (or changing it in zope.conf if it is not available) continue following directions.

sudo /opt/Plone-3.0.2/zinstance/bin/zopectl start #that last part is an L not a 1, took me a while...

Then go to: http://localhost:8080 (or sub servername for localhost to test from other computer). If you’re lucky AGAIN you’ll see the Zope Quick Start page!! Wahoo! Hii Fiiiiveh to self! Then look at the example site: http://localhost:8080/Plone, and then check out the management interface at http://localhost:8080/manage. Have fun. I hope it was as good for you as it was for me!

BTW: I suggest the Ubuntu Support Forum and Plone Support Forum for help. I am totally new at server administration, I prolly shouldn’t even publish this and I definitely can’t support your lazy arse!

Comments (8)

DRAFT: How To Make Your MediaWiki Private

THIS ARTICLE IS A DRAFT. I still need to smooth out some bumps, and even then any instructions found here are for your information and include no warranty or support. Use at your own risk and all that...

I've been using an amalgamation of hacks to track all the information I want to be able to recall later: del.icio.us for bookmarks, gmail for contacts and random notes, private blog entries for some organized content, and tracks for tracking projects. Blech. It's just too much. My memory is too weak. What I really want is a comprehensive PIM (Personal Informatio Manager). And so I installed MediaWiki because that's what Wikipedia uses and that's what Dreamhost offers as a One-Click Install (e.g. the path of least resistance).

I thought I'd share with you all the the process of customizing the default install to create a private wiki. Following are the specifics to my install but this will probably be helpful to many with a different host or newer version.

  • Create a subdomain for your MediaWiki install, such as, wiki.yourdomain.com. Select PHP 5.x (not 4.4.2) and leave Extra Web Security.
  • Install MediaWiki. Dreamhost walks you through this and it's also covered at the Dreamhost Wiki so I'm not going to go into detail here. But be sure to move the newly generated LocalSettings.php to the parent directory, and delete the config directory with its content.
  • Chmod LocalSettings.php to 600
  • Create a backup copy of LocalSettings.php, rename it something like .BAK instead of .PHP or something. Put it back in your Wiki install directory right away so it's safe and available if you need it later.

Restrict Wiki Access

Before bothering to put up our own cute logo or other fun stuff like enabling image linking and using clean urls, we're going to lock down our install. I didn't find a lot for this particular intent on the official MediaWiki Docs or the Dreamhost Wiki, but I did find this old Meta Wiki Article

  • Prevent new user registrations. Add the following line to the bottom of LocalSettings.PHP:
    # This snippet prevents new registrations from anonymous users
    # (Sysops can still create user accounts)
    $wgGroupPermissions['*']['createaccount'] = false;
  • Make sure it's working by trying to create an account. You should receive an error message that says username not found, please create an account. To change the message login as yourself (you should have set up a Sysop login when you configured your wiki) and point your browser to wiki.yourdomain.com/index.php?title=MediaWiki:Nosuchuser&action=edit.
    I changed my message to:
    There is no user by the name "$1". This wiki is private and therefore closed to new accounts. Please contact Mahalie if you have any questions.
    I intentionally failed to provide contact information. If a user doesn't even know how to contact me, they really don't need an account on my private wiki!
  • Prevent anonymous users from reading by adding the following to LocalSettings.php: # Disable reading line, for anonymous (not-logged-in => * ) :
    $wgGroupPermissions['*']['read'] = false;

    # ... and enable anonymous to read the followings pages :
    $wgWhitelistRead = array( "Main Page", "Special:Userlogin", "-", "MediaWiki:Monobook.css" );

    # ... same in an other language (French, with one UTF-8 special characteres) :
    # $wgWhitelistRead = array( "Page Principale", "Special:Userlogin", utf8_encode('Aide en français'));
  • Verify setting by logging out of your wiki and attempting to browse. You should get a 'Login Required. You must login to view other pages.' when clicking on any local link and the page should redirect to the main page after a few seconds.
  • If you want to hide the side navigation if the user isn't logged in (because, perhaps you have private project names or something) edit includes/Skin.php and change the function buildSidebar(). Add these lines near the very top, after the globals.: global $wgUser; if (! $wgUser->isLoggedIn()) { return array(); } This will hide the navigation on sup-pages (not the default main page)

p.s. WebWorkerDaily just published 15 Productive Uses for a Wiki in case you're wondering why someone would want to do this!

Comments (22)

Web 2.0 - When is enough enough?

Ong Bak fan site on FanPop
Screenshot of the Ong Bak fan portal on FanPop!

I have internet ADD. I try every new web 2.0 app out there - I have a good spam filter (gmail) and I always use the same password and the my username of choice is never taken so I don’t hesitate to try out a new website. I recently stumbled upon the Ong Bak spot I started on FanPop! when they were first accepting beta memberships. FanPop! is a site where you can find existing ’spots’ for things you are interested in or start your own if it doesn’t exist. Each spot is a user community dedicated to a specific topic where people can go to find and share related information. Because the site offers RSS feeds you can subscribe to the content and always be in the know when someone posts something about what interests you.
I’d totally forgotten about my ’spot’ and the site altogether, but a few users had posted some interesting Ong Bak related links so I decided to subscribe to the feed and look up a few more topics.
We’ll see how many of these sites earn a permanent spot on my feed list. The problem with all of these user-contributed social sites (much like 43things/people/places) is that there are so many sites like them vying for attention and not enough aggregation.  Studies have shown that for all the Web 2.0 community-driven sites out there, the vast majority of traffic is comprised of non-participators/spectators and the content is contributed and driven by a tiny percentage.  These sorts of people are also likely to have blogs and as the author of three blogs and frequent user of web applications flickr, digg and 43places, I can personally attest to how spread thin I am with my time and attention.

While each of these and hundreds of other sites have amazing potential that I could explore more deeply, there’s just too darn many. For instance, if I really like a restaurant and want to share my enthusiasm there are scores of places I could post a review - so how do I choose? Well, personally I choose my own blog first because I know the content will always be there and I can find it later, but because only my friends read my personal blog, I might post it on 43places because I like and use that site. But I kind of want to post it to CitySearch so non-geeks can find it, what about Yelp?, Epinions? Oh, I could post the review with a photo on Flickr, a lot of people are using Flickr as a blog these days. The list goes on and on, and on!

At what point are there too many user-contributed websites and not enough contributers? Too many content receptacles and not enough content?
What’s Web 3.0 going to look like? Web-based office…maybe. Productivity, I believe, and relevancy are definitely going to be major themes as we all struggle with the information overlap and overload.

Something I’d like to see is an easy way for people to customize display of, input and then push out content. I’d love to be able to just open up my Wordpress admin panel, through it, upload my photos to Flickr, have them all link back to the post they originated from, push out the post as a comment or review of various sites like 43places or Epinions, etc. Because, like I said, I have internet ADD, I don’t necessarily want to pick my battles, but these days I have to!

Comments

Top 10 Web 2.0 Apps

Seth Godin posted a great list of 937 Web 2.0 applications ranked by traffic (according to Alexa). I compared it to my top 10 (most used and most loved):

  1. Flickr - photo site, browse photos and store your own
  2. Wordpress - blogging platform either on your own server or theirs
  3. Gmail - Google’s web based email client
  4. Wikipedia - free community-written encyclopedia
  5. Google Reader - I started with Bloglines, then Rojo, but Reader is the best!
  6. Del.icio.us - Find your bookmarks no matter what computer you’re using, it’s a great discover tool as well as you can search other people’s bookmarks. I love the Firefox plugin as it works better than their default web interface.
  7. JetEye Jetpacks - I use this as a Firefox add on as well, although there’s a regular web interface so you can access your ‘packs’ any time. It’s like del.icio.us but you can save just an image, an excerpt of text, a movie and your own notes and package them into packs which can be shared with others - see my ‘Shoes I love‘ collection.
  8. 43Places - read and write reviews of places from Fremont to Dhaka, India. I use 43people and 43things too, but not as much.
  9. Google Maps
  10. Myspace

I use everything on this list daily, except for myspace. I hate myspace, but I must acknowledge it’s extreme power. The UI is horrible. Everything requires multiple clicks, I constantly run into error messages, what they allow their users to do to their pages is almost as bad as the ads that do anything but grace the screen. Myspace is not a site you want to be seen looking at at any respectable workplace. Yet I also love Myspace - because so many people use it. I have three friends including my 11-year old neighbor (*ahem* I mean 14 yo) who I’ve communicated with more in the last 4 months than in the last year, easily. It’s cheesy, it’s silly, it’s scary, but it’s also infectious. I actually don’t use it very often, but if I want to get a hold of certain people, it’s the surest way.
Related:Web 2.0 for designers.

Comments

Google, Are You Listening?

Dear Google,

Please make it so that I can have reminders sent to my cell phone for some events and not others.  Afterall, I could use the help getting up in time to get over to Arboretum on Saturday for Earth Day but I really don’t need my phone to beep for all my staff meetings!

Thanks,

Mahalie (a big fan)

Comments

100 Percent Web Based Office

Lifehacker asserts that it’s possible to run your office using only existing web applications, citing some great resources at IT|Redux including the blogger’s own Office 2.0 setup. Especially exciting to me is the Office 2.0 Database, a rather succinct collection of the most commonly needed business applications offering at least one online alternative for your calculator, calendar, contacts, desktop, email, fax, file manager, instant messenger, mind mapper, personal organizer, photo editing, presentation, project managmer, spreadsheets and of course word processor. And for the geekier mobile business person 2.0…command prompt, RSS feed aggregator, database (!?), and weblog.

ITRedux.com Office 2.0 Database

I find the idea of web-based everything quite tantalizing, and have pontificated the emergence of Google as a provider of web-based software solutions that will replace a need for anything but a RAM-packed high-speed internet conneced dumb terminal. I’m all for it, imagine no more grueling software installs, upgrades and licensing issues. Of course, if a web service goes down, too bad for you! But would the uptime be comprable, better even, than your private network?

The real beauty of Google’s method is their sharing of source code, APIs and use of open standards…let the savant, the prolific, the prodigious programming hobbyists of the world create all these next generation web-apps - then hire/aquire/adapt away. Talk about agile development…

Comments

Gmail & Google Calendar Integration is Here

Ryan, accused of photoshopping the event form fields when he posted the Gmail screenshot at Cybernet on Saturday, later commented:

Yes, [Gmail officials] said that they will be rolling out the feature which I didn’t initially realize because everyone I talked to already had it.

At the time, I didn’t have this feature…but I do now. Gmail and Google Calendar integration is here…for the rest of us.

And it looks like this: Add Event Info Icon in Gmail

This is not a hoax, it's Gmail - Calendar integration.

Comments

Google Calendar Round-Up

A view of my Google CalendarThere has been a lot of buzz in the blogosphere since Google Calendar (beta, of course!) launched last Thursday night. There are already development articles such as how to integrate Google Calendar in Your Website Using AJAX and ruminations on how this fits into Google’s big plan. Here’s my summary of what’s important for the average user - e.g. you’re not a programmer, security-paranoid or an internet noob, you’re just interested in using the dang thing. Here’s the skinny:

The Good

  • Web Based. If you already use a web-based RSS Feed Reader, Journal and/or Email client, you know well why this is an advantage. It’s always there, always available, so long as you have an accessible internet connection.
  • Calendar Sharing. Your calendar can be totally public or not; if public, you can share all your info or just your free/busy status. If you don’t make it public, you can still share it with specific people like friend, family or collegues.]
  • Calendar Import. It’s easy to import Calendar info from common calendar apps such as iCal and Outlook.
  • Multiple Calendars. You can keep more than one, and you can ’subscribe’ to publicly availbale calendars which can be searched for within the Google Calendar interfac such as Greek National and Orthodox holidays. A quick searchfor ‘Seattle’ provided me with Local Events, Seattle Mariners Schedule, ToST Lounge Music Calendar, Allstar Gym Schedule and many, many more.
  • Gmail Integration. If you use Gmail. And integration should become better soon, for now it’s rather dodgy.
  • Phone notifications. Self explanatory.

The Bad

  • Pop-up Problems. Make sure Google.com is listed in sites allowed to create pop-ups in your browser and your firewall and/or other internet security programs.
  • Doesn’t Work on Safari. Oops. I expect this will soon change.
  • UnSyncable. Nope, no PDA or Blackberry support as of yet. I wish there was some kind of utility you could download to make Outlook auto-publish a CSV to my Google Calendar as I have to use Outlook for work and that is not going to change. Fortunately “Google Calendar will be able to synchronize with Outlook and mobile devices [in the coming months]”, said Product Manager Carl Sjogreen (via CNet).
  • Searchability. It’s not terribly accessible, for a Google product…ways it could be greatly improved are summed up here.

The Tutorials

Comments