Archive for the ‘javascript’ Category

SELinux, Apache and Postgres SQL Connectivity

Recently, I decided to migrate the work from Apache windows to the Apache running on my Vmware fedora machine. Everything was supposed to work like a charm. Unfortunately, it did not. The perl in the cgi-bin directory was throwing internal server error 500. The apache error log indicated ‘permission denied to create a socket’, ‘premature end of the script headers’. The stuff was supposed to be retrieved from postgres sql database by the perl thingy. It appeared to me that database server is not allowing my IP address to establish a connection, as recomended by pgadmin as well. After a successful entry of my IP in the conf file of postgres database server, problem still persisted. I tried almost everything, changing the file owner to apache, suexec in apache and hell lots of other possibilities. Then in the trial process I noticed a small pop up in the corner of the window, SELinux denial. SELinux is an enhanced feature in Linux, that can put restrictions on your applications in apache making database connection, nmap, access to network filesystem and lots and lots more. After giving apache persmission to make database connections, the error was resolved and application ran smoothly.

Vaccum kills us, space kills javascript

I was exporting certain attributes viz roadname, ids, ways etc which were of alphanumeric type by appending them with a ‘+’ charachter from my server side perl program to the javascript program at the client. The firebug popped up, unterminated string literal, lets see whats that …. Googling did not turned out to be of much help. I tried making the string short, taking into an array etc. Sometimes it worked, sometimes it did not. Amazed, I came to a stupid conclusion on the size of the arguments that need to be passed. Perhaps, that was not the cause.On of my appended field was having a space, and string thereafter was considered as a different argument by javascript. Due to mismatch in the number of arguments for that js function, it was breaking. Such a silly mistake !!! :) .
Hence, Vaccum kills us, space kills javascript or rather any function in any damn
language.