IdeaMonk

thoughts, ideas, code and other things...

Monday, April 06, 2009

Installing Mooshak on Ubuntu (finally)

By reading the older posts under this topic, you must've realized that I'm a total n00b at linux :P. But this n00b finally figured out the way to get Mooshak running over his Ubuntu...
Messing around with Artur's tutorial didn't help. Playing around with Mooshak-1.5a4 didn't help. What helped was setting up cgi-bin the Apache way and giving permissions to files under /home/mooshak . Thanks to myprasanna for some insights.
So, here's how you can too go about getting mooshak up over Ubuntu Desktop Edition -
  1. Install Apache2 and get it up and running, read this or just paste this into your terminal -
    $ sudo apt-get install apache2 apache2-suexec
  2. There are some Apache mods you need to enable -
    # a2enmod userdir
    # a2enmod suexec
  3. Configurations for suexec and userdir are available in mooshak-version/source/lib/apache/ , extract the source.tgz file to get it.
    $ cd mooshak-version
    $ tar xvf source.tgz
    $ cd source/lib/apache/
    $ sudo cp 67* /etc/apache2/mods-enabled/userdir.conf
    $ sudo cp 69* /etc/apache2/mods-enabled/suexec.conf
    $ sudo cp /etc/apache2/mods-enabled/userdir.conf /etc/apache2/mods-available/userdir.conf
    $ sudo cp /etc/apache2/mods-enabled/suexec.conf /etc/apache2/mods-available/suexec.conf
  4. Configure your httpd.conf, just hit your favorite editor under su, add these -
    <directory /home/*/cgi-bin>
    Options +ExecCGI
    </directory>

    AddHandler cgi-script cgi pl
    The last line is just to test cgi scripts. Get to your home folder, make a path - /home//public_html/cgi-bin
    Get into it and write a small hello.pl to test -
    #!/usr/bin/perl
    # hello.pl -- my first perl script!
    print "Content-type: text/html\n\n";
    print "Hello, world!\n";
    Do a chmod of 755 over it. and test it - http://127.0.0.1/~mooshak/cgi-bin/hello.pl , You should have a Hello World! in your browser by now.
  5. The Requirements - get these to setup the base for mooshak
    $ sudo apt-get install tcl xsltproc lpr rsync gcc libxml2-utils
  6. Get a stable copy of Mooshak, in my case I tried 1.4.3
  7. Edit the install script
    Line 148 of the 'install' script becomes -
    set fd [ open "| /usr/bin/lsof" ]

    from
    set fd [ open "| /usr/sbin/lsof" ]
  8. Extract you tarball and run the install script -
    $ tar xzf mooshak-*.tgz
    $ cd mooshak-*
    $ su
    # ./install --config-suexec
    # ./install
  9. Now wait for a few seconds till it finishes. On Ubuntu 8.10 this won't give you any errors at all if you're using the 1.4.3 version
  10. Smile :D
And that's all I guess. http://127.0.0.1/~mooshak/ would land you to the following -
Anything I missed, forgot to explain, do let me know. The system works fine, apart from tcl warnings on Balloons and Pending sections of judge's view.

Also, visit these links for more informantion -
.

Labels: , ,

34 Comments:

At August 6, 2009 at 11:41 AM , Blogger vivek said...

Hey!!

thanx for u info...
it helped me a lot...
vivek

 
At August 9, 2009 at 11:33 AM , Blogger kikku said...

still not working....
http://127.0.0.1/~mooshak this page results in an error like following

invalid command \n while executing\n"error "invalid command $command ""\n invoked from within\n"if [ has_session_hash ] {\n\n Session::init [ cgi::cookie mooshak:session "" ] [ cgi::cookie mooshak:authorization "" ] [ cgi::field contest ..." invalid command while executing "error "invalid command $command "" invoked from within "if [ has_session_hash ] { Session::init [ cgi::cookie mooshak:session "" ] [ cgi::cookie mooshak:authorization "" ] [ cgi::field contest ..."

 
At August 9, 2009 at 9:29 PM , Blogger IdeaMonk said...

Well kikku, you must've a proper environment for everything to work along. If you miss tcl or maybe have a misconfigured apache, these errors are common. I guess your cgi scripts are not working properly. check for file permissions. I could comment more if I had details of you setup. I hope this helps.

 
At August 10, 2009 at 8:50 PM , Blogger kikku said...

Following are my contents of cgi-bin...
and their access permissions..
can u tel me how should i configure access permissions for the whole mooshak directory...





root@mahe-laptop:/home/mooshak2/public_html/cgi-bin# ls -l
total 24
-rwxr-xr-x 1 mooshak2 mooshak2 235 2009-08-10 17:32 execute
-rw-r--r-- 1 mooshak2 mooshak2 235 2009-08-10 17:28 execute~
-rwxr-xr-x 1 root root 114 2009-08-10 12:36 hello.pl
-rwxr-xr-x 1 mooshak2 mooshak2 1351 2006-04-06 21:03 info
-rwxr-xr-x 1 mooshak2 mooshak2 492 2004-10-04 15:42 public-key
-rwxr-xr-x 1 mooshak2 mooshak2 308 2006-11-06 18:00 soapexecute
root@mahe-laptop:/home/mooshak2/public_html/cgi-bin#

 
At August 10, 2009 at 8:52 PM , Blogger kikku said...

root@mahe-laptop:/home/mooshak2/public_html# ls -l
total 20
drwxr-xr-x 2 mooshak2 mooshak2 4096 2009-08-10 17:32 cgi-bin
drwxr-xr-x 7 mooshak2 mooshak2 4096 2004-10-14 16:46 help
drwxr-xr-x 3 mooshak2 mooshak2 4096 2004-10-14 16:46 icons
-rw-r--r-- 1 mooshak2 mooshak2 518 2008-05-08 14:51 index.html
drwxr-xr-x 2 mooshak2 mooshak2 4096 2008-06-13 00:23 styles

 
At August 10, 2009 at 8:53 PM , Blogger kikku said...

-rw------- 1 mooshak2 mooshak2 6109 2006-03-06 18:12 artistic_license.txt
drwx--x--x 4 mooshak2 mooshak2 4096 2009-08-10 12:25 bin
drwx--x--x 2 mooshak2 mooshak2 4096 2009-08-10 12:25 clipboard
drwx--x--x 6 mooshak2 mooshak2 4096 2006-11-06 17:51 contrib
drwx--x--x 5 mooshak2 mooshak2 4096 2009-08-10 12:39 data
-rwx------ 1 mooshak2 mooshak2 17354 2008-03-28 21:10 install
drwx--x--x 5 mooshak2 mooshak2 4096 2008-03-26 20:58 lib
-rwx------ 1 mooshak2 mooshak2 1738 2004-10-04 15:42 network
drwx--x--x 9 mooshak2 mooshak2 4096 2008-05-14 14:47 packages
drwxr-xr-x 6 mooshak2 mooshak2 4096 2009-08-10 12:25 public_html
-rw------- 1 mooshak2 mooshak2 6287 2007-09-07 22:54 README.txt
-rwx------ 1 mooshak2 mooshak2 1073 2004-10-04 15:42 replicate
drwx--x--x 5 mooshak2 mooshak2 4096 2008-05-14 15:41 templates
-rw------- 1 mooshak2 mooshak2 6 2009-01-09 21:48 version.txt

 
At August 10, 2009 at 8:54 PM , Blogger kikku said...

drwxr-xr-x 10 mooshak2 mooshak2 4096 2009-08-10 12:25 mooshak2



pls reply to me..
i am waiting for ur reply.......

 
At August 10, 2009 at 10:39 PM , Blogger IdeaMonk said...

kikku did you spend more then 2 days to get mooshak working? I too spent a lot of time in my case, but the good part is, I asked the author whatever doubts I had, and got it working as mentioned. Maybe things are a little different on your setup, consider asking the author, he would give you a better explanation to everything.

all the best.

 
At August 11, 2009 at 8:50 AM , Blogger vivek said...

hey kikku,

just uninstall it and see..
even i have passed this problem..!!

 
At August 11, 2009 at 10:15 AM , Blogger vivek said...

do any body know how to solve dis..?

./replicate mooshak@192.168.100.210: replication error: Permission denied, please try again.
Permission denied, please try again.
Permission denied (publickey,password).
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: unexplained error (code 255) at io.c(454) [sender=2.6.9]

this error happend wen i connect server..
wat al r d steps to connect other server after mooshak installation...?

 
At August 11, 2009 at 4:11 PM , Blogger kikku said...

i had spend more than 4 days for getting mooshak installed..But till now i can't complete.
can any one solve this...


i had followed the same method above......
i cant get the "hello world" itself..

am using apache2 in ubuntu 8.10
reply me......


if anyone knows the author's contact, post me that too..
his email id..

 
At August 11, 2009 at 4:17 PM , Blogger kikku said...

hai vivek,

i had uninstalled mooshak and installed again.....

but no improvement.......
am stuck in that.....

can u send me the steps of installing mooshak from begining.......


I need the complete steps.
I cant proceed anymore without ur help....

 
At August 11, 2009 at 4:23 PM , Blogger IdeaMonk said...

@kikku
Try consulting the author - take a look at INSTALL section on Mooshak's page - http://mooshak.dcc.fc.up.pt/~zp/mooshak/
for his mail id, he is very helpful and would explain you a lot more in detail.

Also don't forget to read the README and installation instructions that come with the package for more help.

Do let me know once you get mooshak set right, and exactly what was the flaw.

 
At August 11, 2009 at 4:32 PM , Blogger IdeaMonk said...

kikku I'll forward you a mail where I've discussed my own issues while installing mooshak over ubuntu with the author, let me know you mail address.
tc

 
At August 11, 2009 at 6:07 PM , Blogger kikku said...

maheswarofmaheswaran@gmail.com

 
At August 11, 2009 at 6:48 PM , Blogger kikku said...

when i gives this command........
a2enmod suexec
ERROR: Config file suexec.conf not properly enabled: /etc/apache2/mods-enabled/suexec.conf is a real file, not touching it


hw can i solv this?

 
At August 11, 2009 at 7:00 PM , Blogger IdeaMonk said...

try reading more about suEXEC http://www.auburn.edu/docs/apache/suexec.html

and then maybe remove the /etc/apache2/mods-enabled/suexec.conf file and try running a2enmod again.

 
At September 3, 2009 at 11:17 PM , Blogger gopi said...

i completed installing mooshak
can any one help me to configure and run contest.
waiting for your reply

 
At September 4, 2009 at 3:45 PM , Blogger IdeaMonk said...

That's great, now read some documentation, readme etc to understand how to setup questions, contests, and how to judge. You're just a few steps away.

All the best.

 
At September 4, 2009 at 5:35 PM , Blogger gopi said...

while i'm trying the following url

http://127.0.0.1/~mooshak this page results in an error like following

invalid command \n while executing\n"error "invalid command $command ""\n invoked from within\n"if [ has_session_hash ] {\n\n Session::init [ cgi::cookie mooshak:session "" ] [ cgi::cookie mooshak:authorization "" ] [ cgi::field contest ..." invalid command while executing "error "invalid command $command "" invoked from within "if [ has_session_hash ] { Session::init [ cgi::cookie mooshak:session "" ] [ cgi::cookie mooshak:authorization "" ] [ cgi::field contest ..."


please help me
i restalled 3 times
i had spend 1 week for this still i'm not geting the working model

 
At September 4, 2009 at 5:43 PM , Blogger IdeaMonk said...

Hi Gopi,
There are some errors that we're supposed to ignore, here is what I got back then -
http://twitpic.com/gf4s0
http://twitpic.com/gf4sy

So I asked the author, what is that supposed to mean? because my installation log said -
connecting to host research. ... couldn't open socket: host is unreachable
connecting to host localhost ... connected!
Mooshak installation seems OK

... anyways so this is the authors response to it -

"" Hi Abhishek,


Yes, I think you can pretty much ignore those errors. I suggest you just remove the balloons folder that is causing those problems on the icpc_prototype contest because of a missing file. If you remove the folder using the admin interface then it is recreated with all needed files.

The install script was tested on Ubunto and Debian related distros by a student of mine a couple of years ago. Clearly it is not working well in the current versions in those distos. I am trying to install Ubunto on VMWare to test it ... ""

I guess you too are at that stage... try ignoring these errors for time.

 
At September 4, 2009 at 5:45 PM , Blogger IdeaMonk said...

btw I spent more than 2 weeks, how lame of me :/

 
At September 4, 2009 at 5:46 PM , Blogger IdeaMonk said...

Gopi, also try checking the current latest and stable versions on your machine - http://mooshak.dcc.fc.up.pt/

there have been few changes on the mooshak page too, have a look under requirements section.

 
At September 4, 2009 at 5:54 PM , Blogger gopi said...

if i change to fedora, whether it ll work fine, if so i l do that...
otherwise i will continue in this
thank you very much for your information
you are very great spent two weeks of time

 
At September 4, 2009 at 6:24 PM , Blogger IdeaMonk said...

Well atleast spend some time on these two links before you install another OS -
http://mooshak.dcc.fc.up.pt/
http://catb.org/~esr/faqs/smart-questions.html

All the best...

 
At September 4, 2009 at 6:28 PM , Blogger gopi said...

k i will refer those links
thank you for your kind replies

 
At September 16, 2009 at 9:56 PM , Anonymous Paul Crocker said...

Hi, I have had the same problem with installing mooshak on my new PC with ubuntu 9.04. I followed your advice but to no avail .. I had the same errors as posted by GOPI september 4 .. "invalid command etc etc".
However whilst installing some other software of mine I remembered I still had to install php on to the apache2 server.. I used the ubuntu synaptic packetmanager to install php5 .. here is the log

Commit Log for Wed Sep 16 17:08:41 2009

Removed the following packages:
apache2-mpm-worker

Installed the following packages:
apache2-mpm-prefork (2.2.11-2ubuntu2.3)
libapache2-mod-php5 (5.2.6.dfsg.1-3ubuntu4.2)
php5 (5.2.6.dfsg.1-3ubuntu4.2)

and lo and behold ..when I hit refresh on my Firefox one of the tabs it opened was my mooshak problem .. however ... Mooshak now works fine !! I hadn't even altered any of my apache config files.

I don't know why it's now ok .. maybe the preforking module is absolutely necessary.

Hope this helps !

 
At December 31, 2009 at 11:47 PM , Blogger JinN said...

Thanks Paul Crocker!!
I had been trying to install Mooshak for more than a week now...and had gone through too much trouble...
The error Gopi had told was solved when I installed all the three packages you have told :)

 
At February 5, 2010 at 10:29 PM , Blogger Saurav Mukherjee said...

send me the email too please.

to.saurav.mukherjee@gmail.com

 
At February 23, 2010 at 7:39 PM , Blogger Rahul G. said...

Thanks man, great article

 
At November 9, 2010 at 7:34 PM , Anonymous Anonymous said...

hey guys.i am hasitha from sri lanka i have alredy installed mooshak on my pc. i need help from you.

i want to execute PHP in /home/mooshak/public_html folder. but it does not works. i have already installed php on apache server and i am using ubuntu 10.04.
but PHP works in my localhost. but not in localhost/~mooshak/ .

what is the reason for this ?

 
At January 14, 2011 at 5:46 PM , Blogger Gama said...

hey guys. i wrote a new plug-in for Mooshak , that allows to change Mooshak's welcome page and CSS files . it is very easy to use. check it at : apps.hasitha.co.cc

 
At January 15, 2011 at 12:09 PM , Blogger Abhishek Mishra said...

Hey Gama, thats great! will add a link to it in my post soon.

 
At April 30, 2011 at 7:56 PM , Blogger Hasitha Aravinda said...

hi, Abhishek, I have hosted that Mooshak plug-in in google code. here its URL: code.google.com/p/mooshak-theme-manager/

 

Post a Comment

Subscribe to Post Comments [Atom]

<< Home