• Skip to main content
  • Skip to secondary menu
  • Skip to primary sidebar
  • Skip to footer
  • Home
  • Contact Us
  • Archive
  • Sitemap
  • GoHalalVietnam!
  • Matsunaga’s Odyssey

西贡鼠 SAIGONNEZUMI

Perused, Opinionated Expat Living in Saigon

Connect with @saigonnezumi

  • Facebook
  • Instagram
  • LinkedIn
  • RSS
  • Twitter
  • YouTube
  • Home
  • Food & Drink
    • Vegan
    • Vegetarian
    • Halal
  • Tech News
  • Daily Life
    • Laws and Regulations
    • Motorcyclists
    • Shopping
  • Fitness
    • Weightlifting
    • Crossfit
    • Powerlifting
  • Clean Tech
    • Clean Air
    • Clean Water
  • Social Media
    • Saigon Bloggers
    • Saigon Vloggers
    • Video
  • Travel
You are here: Home / Setting up LAMP server and Laconica 0.5.0 in Ubuntu Hardy Heron

Setting up LAMP server and Laconica 0.5.0 in Ubuntu Hardy Heron

Saturday, August 9, 2008 By kevmille

Just a writing a post for my students.  I want them to set up LAMP and Laconica on their Ubuntu desktops for their projects.

LAMP is a software bundle that includes Linux, Apache, MySQL and PHP.  In Ubuntu, it is quite simple to set up LAMP.  Laconica is an open source microblogging application similar to Twitter.  For beginners and even intermediate Linux users, installing Laconica can be frustrating but it need not be.  I have successfully installed the basic Laconica package two times already so I will jot down how I did it below for my students.

1. Install LAMP

Install LAMP using this excellent guide from the MAKETECHEASIER blog:

http://maketecheasier.com/setting-up-a-lamp-server-in-ubuntu-hardy-heron/2008/08/06

This blog does a very good job in helping the user seting up a root MySQL password with a graphic user interface.  When this is done through the command line, most of us, umm, end up setting our root passwords as password by mistake 🙂  If that happened to any of you, go to this link to recover your root password.

As per the LAMP install guide, test out LAMP with WordPress or just do nano -w /var/www/test.php then write ‘This works with PHP!’ in the file.  Go to localhost/test.php to see if it works.  If you see ‘This works in PHP!’ then everything is okay.  If not, start over, seriously 🙂

2. Install Laconica

I am going to use and edit 0xDECAFBAD‘s guide to getting Laconica running.  First, you need to install darcs as follows with apt-get:

$ sudo apt-get install darcs
$ darcs get --partial http://laconi.ca/darcs/

This should create a darcs directory in /home/YOURUSERNAME/darcs. Of course YOURUSERNAME should be replaced with your actual username (type whoami in command line if you forgot).  Change directory into darcs right now before continuing:

$ cd /home/YOURUSERNAME/darcs

Now you will install all the PHP and PEAR based prerequisites and libraries. I also included curl and unzip since some of you may not have already installed it with apt-get yet:

$ sudo apt-get install libapache2-mod-php5 php5-cgi php5-cli php-pear php5-gd php5-mysql unzip curl


$ sudo pear channel-update pear.php.net
$ sudo pear install channel://pear.php.net/Validate-0.8.1
$ sudo pear install DB_DataObject
$ sudo pear install Mail
$ sudo pear install Net_SMTP


$ mkdir extlib xfers
$ cd xfers
$ curl -O http://openidenabled.com/files/php-openid/packages/php-openid-2.1.1.zip
$ curl -O http://michelf.com/docs/projets/php-markdown-1.0.1m.zip
$ curl -O http://oauth.googlecode.com/svn/code/php/OAuth.php
$ curl -O http://xmpphp.googlecode.com/files/xmpphp-0.1beta-r21.tar.gz
$ unzip php-markdown-1.0.1m.zip
$ cp 'PHP Markdown 1.0.1m/markdown.php' ../extlib/
$ unzip php-openid-2.1.1.zip
$ cp -r php-openid-2.1.1/Auth ../extlib/
$ cp OAuth.php ../extlib/
$ tar -zxf xmpphp-0.1beta-r21.tar.gz
$ cp xmpphp/*.php ../extlib/
$ cd ..
$ rm -rf xfers

Now, here is one edit from 0xDEFCAFBAD’s install guide. You will need to obtain the latest release of XMPP to avoid getting errors with your current Laconica install (I got the following from Nick’s comments on OxDECAFBAD’s blog):


$ cd extlib
$ curl -O https://saigonnezumi.com/XMPPHP.tar.gz
$ tar -zxf XMPPHP.tar.gz
$ cd ..

Now you will set up the Laconica database in MySQL. Make sure you are in /home/YOURUSERNAME/darcs to avoid getting a dataname not found error. Of course PASSWORD in capitals should be YOUR password:


$ mysql -uroot -p -e 'create database laconica';
$ mysql -uroot -p -e "grant all privileges on laconica.* to laconica@localhost identified by 'PASSWORD'";
$ mysql -uroot -p laconica < db/laconica.sql

Now for the configurations which I think can be the most toughest part in installing Laconica:


$ cp config.php.sample config.php
$ nano -w config.php

Add the following to line 6 (Control-C will tell you the line number in nano):

#If you have downloaded libraries in random little places, you
#can add the paths here
define(‘INSTALLDIR’, dirname(__FILE__));
set_include_path(get_include_path() . PATH_SEPARATOR . INSTALLDIR . ‘/extlib’);

Edit the rest of the settings, read my comments (followed by # to explanations).  (The author ASSUMES that you created a laconica database under root).

$config[‘site’][‘name’] = ‘Laconica Microblog’; #Your Microblog Name
$config[‘site’][‘server’] = ‘localhost’; #Your server name, I used localhost for now
$config[‘site’][‘path’] = ‘laconica’; #The directory name in /var/www/laconica
$config[‘site’][‘fancy’] = true; #See OxDECAFBAD for more explanation
$config[‘site’][‘theme’] = ‘default’; #You actually have two theme choices
$config[‘site’][’email’] = ‘[email protected]’; #Your Email
$config[‘site’][‘broughtby’] = ‘Laconica Microblog, Inc.’; #You of course 🙂
$config[‘site’][‘broughtbyurl’] = ‘http://yourdomain.com’; #Your website URL
$config[‘db’][‘database’] = ‘mysql://root:PASSWORD@localhost/laconica’; #Your ROOT MySQL password;
$config[‘db’][‘ini_laconica’] = $config[‘db’][‘schema_location’].’/stoica.ini’;

After you made your changes, press Control-X to exit and save.

Now we will edit dataobject.ini (The author ASSUMES that you created a laconica MySQL database under root):


$ nano -w dataobject.ini

database = mysql://root:PASSWORD@localhost/laconica #Your Laconica password, not root password
schema_location = /var/www/localhost/docs/laconica/classes
class_location = /var/www/localhost/docs/laconica/classes
require_prefix = /var/www/localhost/docs/laconica/classes/

Control-X to exit and save.

As you noticed, I selected the server name to be localhost instead of a domain name. You can add this later. I just wanted to write this tutorial for my students. You can also use your computers IP address to test Laconica locally in your home or classroom. I like to keep things simple with my students.

Be sure to change user and file permissions for the avatar folder:


$ sudo chown -R www-data avatar
$ sudo chmod -R ug+rw avatar/

Now, since this guide is for my students, I will make things easier for them to get Laconica running on their servers.

$ cd ..
$ sudo ln -s
darcs /var/www/laconica
$ cd /var/www/
$ ls

You should see laconica listed as one of the directories. I also changed the ownership and file permissions as well just to keep things simple for my students. We will make their projects live, then we will focus more on security.


$ sudo chown YOURUSERNAME laconica
$ sudo chmod 777 laconica

Now, to see if Laconica works, click the following link:

localhost/laconica

If you get any errors, they are normally with the configurations files in config.php and/or dataobject.ini.

That’s all for now. Now, I have not tested Jabber or the mail server features with the current install of Laconica yet. Hopefully I will get to it sometime this week. In the meantime, I hope my students can have fun with their own Twitter-like application 🙂

Any input and corrections to this guide are greatly appreciated.  Thanks to OxDECAFBAD for his excellent guide.

Edit 1: I got the original symlinks backwards, corrected now.  Thanks Tommy for bringing it up.

Edit 2: added cp config.php.sample config.php to make it easier for my students

Edit 3: added bold/strong tags so students would not forget to add two lines for config.php

Edit 4: You can download an edited version of config.php here in case you lost your copy (Yeah, this is for my students). I renamed it to config.txt so it would appear online so do the following: mv config.txt config.php

Edit 5: Forgot to add cd extlib so the XMPPHP ended being in the wrong director. Corrected.

Edit 6: For some, connecting the database to Laconica was difficult.  I edited both config.php and dataobject.ini and replaced the username laconica with root.  I have a hunch many new users created their MySQL database under root.

Edit 7: Added curl to apt-get install since some of you may not have installed it yet.

Share this:

  • Click to share on Facebook (Opens in new window) Facebook
  • Click to share on X (Opens in new window) X

Like this:

Like Loading...

Related

Filed Under: Uncategorized Tagged With: Technology

Reader Interactions

Comments

  1. mike pham says

    Saturday, August 9, 2008 at 11:20 pm

    why don’t u go ahead and show some screen-shots of the project? 🙂

  2. IT_V says

    Monday, August 11, 2008 at 7:24 pm

    i got it.. but i got some fartal error on Openid … and sreach tabs

  3. mike pham says

    Tuesday, August 12, 2008 at 12:39 pm

    can you bring your Live CD tomorrow?

  4. IT_V says

    Tuesday, August 12, 2008 at 11:38 pm

    DONE

  5. david says

    Wednesday, September 10, 2008 at 10:22 pm

    were you able to get jabber setup?

  6. andyswarbs says

    Wednesday, April 1, 2009 at 2:23 am

    Creating the symbolic link did not work for me. It came up with “bad link”. So I used
    sudo ln -s /home/andy/darcs /var/www/laconica
    instead and that seems (so far) to work fine.

  7. Andrew Abogado says

    Sunday, April 19, 2009 at 10:34 am

    Thank you very much for this tutorial. You are right. The hardest part was editing config.php. I’m now one of the satisfied students. 🙂

Primary Sidebar

Site Navigation

  • Home
  • Archive
  • Bloggers and Vloggers in Vietnam
  • Halal Restaurants in Saigon

External Sites

  • Baba’s Kitchen – Vietnam
  • hakata.io
  • GoHalalVietnam!
  • Kerim Nur Blog
  • Matsunaga’s Odyssey
  • OishiiEats.vn

Archives

Recent Posts

  • Malaysian Street (An Ninh Street) all shutdown in Saigon
  • US Peace Corps to enter Vietnam by mid-2022
  • How Effective Are Air Purifiers In Your Home? | Talking Point
  • Humans of Saigon
  • Online Groceries with Chopp.vn in Saigon

Footer

Site

  • Home
  • Contact Us
  • Saigon Bloggers & Vloggers
  • Halal Restaurants in Saigon
  • Vietnamese Adoptee Articles
  • Hawaiian Hapas
  • Privacy Policy
  • Sitemap

Tag Cloud

1999 2011 2012 2013 2014 2015 air astana Airlines Almaty almaty Amerasian Central Asia China Clean Technology district 1 District 1 district 4 Food and Coffee halal Halal Guide india In the News japan Japan Karatau kawasaki z300 Kazakhstan kazakhstan Kyrgyzstan open source pham ngu lao phu nhuan district PM 2.5 saigon Saigon saigon coffee shops Saigon Photos saigon restaurants Shanghai Technology Travels Uncategorized Videos vietnam Weightlifting
July 2025
M T W T F S S
 123456
78910111213
14151617181920
21222324252627
28293031  
« Feb    

© 2025 SaigonNezumi.com.

%d