Showing posts with label ubuntu. Show all posts
Showing posts with label ubuntu. Show all posts

Saturday, March 28, 2009

shindig on local ubuntu server

I installed shindig on a server running locally. It would have went as smoothly as my install on our virtual server (shindig on godaddy virtual dedicated server) but for a few small oops.

I want to have a way to play with OpenSocial and gadgets on a local machine. I have a small Ubuntu 8.04 server that is not visible to the world that I use for that sort of thing. I thought it would be easy to install and I was mostly correct.

Shindig is an open source implementation of the OpenSocial specification and gadgets specification. http://incubator.apache.org/shindig/ It comes in Java and PHP flavors. I went for the PHP version for now http://incubator.apache.org/shindig/#php.

My server is a pretty much out of the box Ubuntu Server Edition (8.04). I checked if PHP was PHP 5.2.x and added the extensions I was missing.

Check if the web server has a current PHP with phpinfo (PHP: phpinfo - Manual )
  http://test.jsoft.com/phpinfo.php
  returned that I had PHP 5.2.4 - good

I did not have the command line for PHP installed, so I installed that and checked the version again.
  $ sudo apt-get install php5-cli
  $ php -version
and no surprise it gave me the same answer. I then added curl and mcrypt.

  $ sudo apt-get install php5-curl
  $ sudo apt-get install php5-mcrypt
  $ sudo /etc/init.d/apache2 restart

I downloaded shindig, set up a new virtual host and was up and running (almost).

in /etc/apache2/sites-available
  $ sudo cp default shindig
to get a new virtual site and
  $ sudo vi shindig

Here are the important parts:

<virtualhost *>
ServerName shindig.jsoft.com
DocumentRoot /home/gary/public_html/shindig/php/
<directory>
Order Deny,Allow
Deny from All
</directory>
<directory>
Allow from All
AllowOverride All
</directory>
... other settings for vhosts
</virtualhost>

I installed into a public_html directory. You may want to install into the directory suggested in the shindig installation instructions.

I then enabled the site and reloaded apache

  $ sudo a2ensite shindig
  $ sudo /etc/init.d/apache2 reload

and found I did not have mod_rewrite enabled
  $ sudo a2enmod rewrite
  $ sudo /etc/init.d/apache2 force-reload

and then updated the file /home/gary/public_html/shindig/php/config/container.php

----- my copy -----
// The URL Prefix under which shindig lives ie if you have http://myhost.com/shindig/php set web_prefix to /shindig/php
'web_prefix' => '/shindig/php',
// If you changed the web prefix, add the prefix to these too
'default_js_prefix' => '/shindig/php/gadgets/js/',
'default_iframe_prefix' => '/shindig/php/gadgets/ifr?',
-----

tested and it was all good!

-----
It took me a while to decide to update container.php. I was lost till I read Chris Chabot's article PHP Shindig and mod_rewrite at chabotc.com. It has some great info on how things are set up and was what I needed to get shindig running.

I was looking at Google Friend Connect and the GFC demo The Chow Down when I decided to install shindig locally. We have tested a simple gadget or two with GFC on one of our sites and I look forward to getting more social.

Gary

Monday, December 29, 2008

ubuntu print server

I'm setting up a print server for a friend. I want something that is easy to use, has some security and has the potential to also be a media or file server. He uses Windows. Here is how I set things up.

He had a PC that could not boot XP because it was missing some important files and he did not have a restore CD. It is not the latest PC but it has plenty of horsepower to run Linux. I installed Ubuntu 8.04 workstation. I decided to go with the workstation version rather than a server version so it would have a user interface that is somewhat like the Windows XP that he was used to using. I intend to show him the desktop and then unplug the monitor/keyboard and mouse and use it headless. If running headless turns out to be less than a good idea we can always go back to using the workstation.

One benefit of installing the workstation version is I can do some of the initial configuration using the nice gui tools. That may make it a bit easier to understand what I set up. I did add ssh so it can be managed from a terminal from his Windows laptop.

I had ubuntu do most of the hard work, installing the printer took the following:
  1. plug the printer into the PCs usb port.
:-) 

I was lucky, my test printer was one of the many printers ubuntu/CUPS knows about.

I did turn on most of the server settings. 
Go to System->Administration->Printers to set the server settings. Here is what I set up to get going, I'll tweak later...

I printed a test page locally to make sure that was working and then set up a Vista computer to test printing from another computer.






I floundered a bit before finding a web page that got me pointed down a path that worked for me. Vista has an option that takes a url for the printer AND! CUPS provides a web interface to the print server that makes it very easy to get the URL. This is the Howto that showed me howto :-)  HOWTO: Setup A Headless Ubunutu CUPS Print-Server - Page 3 - Ubuntu Forums and here is the home for CUPS CUPS - Print Server and some ubuntu specific info Printing and SettingUpSamba - Community Ubuntu Documentation.

I entered http://192.168.0.5:631/ (use the ip/host name of your server and got this CUPS page
















I clicked on manage printers and selected the printer I wanted to use from Vista


click on the name of the printer, psc_1300_series in this example, and you will be on a page that has the exact url you use to tell Vista where to get the printer.








On your Vista machine, click Start-> Network and then click Add a printer. I ended up here














No printer found - no problems I clicked 'The printer that I want is not listed' and then got this














I clicked Add a network...














and entered the url from the CUPS web page














I was then able to use the printer on the ubuntu print server as easily as a local printer.