Skip to main content

back to perlistan..

Well, I just realized i have lost touch and almost forgotten whatever little programming/scripting i knew and did. Visiting back my perl lessons and trying to script something up on ubuntu with perl and dancer! Just noting the steps here as ive been setting this on multiple machines due to vm crashes or whatever..

Installed
sudo aptitude install apache2 libapache2-mod-perl2

modify the default conf to the below:


<VirtualHost *:80>

        ServerAdmin webmaster@localhost
        DocumentRoot /var/www
        SetEnv DANCER_ENVIRONMENT "development"
<Directory /var/www>
        AllowOverride None
        Order allow,deny
        Allow from all
</Directory>
<Location />
        SetHandler perl-script
        PerlHandler Plack::Handler::Apache2
        PerlSetVar psgi_app /var/www/bin/app.pl
</Location>

ErrorLog /var/log/apache2/error_log
CustomLog /var/log/apache2/access_log common

</VirtualHost>

I was getting a 500 error, which is when i realised(from earlier) that i did not install the perl modules.
cpanm -i Plack::Handler::Apache2


This is pretty much it to get to apache loading the dancer page.

Next is to get some useful things on there..

Comments

Popular posts from this blog

best educational experiences..

The best educational experiences are when we work hard for it, when we apply ourselves and think over solutions/possibilities and try to infer things if we are not sure. In college, there were friends with whom we discussed topics, debated possible approaches to problems. Today, I attend interviews! What better ways to know your weaknesses, strengths and different perspectives on technology or implementation!

ubuntu 12, dns and some releated stuff..

In ubuntu 12.04 dig and nslookup work differently, dig and nslookup are dns server checking tools and they connect directly to DNS servers, but the internal applications like puppet do not work like dig / nslookup they use a different linux /unix function (gethostname) which can be executed using "getent ahosts", you can also verify if your entry is working by executing the below mentioned commands. getent ahosts => will list all host output using gethostname()

mount points with space in fstab

Just something i came across recently. I had a space in the filesystem mount point, something like "New Volume" which was a windows filesystem detected and auto-mounted by ubuntu. So how do you add this to fstab? Lookup on the fstab man page says: The second field (fs_file). This field describes the mount point for the filesystem. For swap partitions, this field should be specified as `none'. If the name of the mount point contains spaces these can be escaped as `\040'. Ex: /dev/sda5     /media/New\040Volume     ntfs     defaults     0     2