More issues with IspCP [PostFix]

At this point I feel very confident with the inner workings of IspCP.  I have modified suexec, postfix, and other core stuff.  In the process I have started to learn Apache2′s inner workings as well.  Today I am going to talk about issues with Postfix.  The issue is that a Ubuntu installs PostFix with a LAMP install, and IspCP has some custom configs to make it work.  YesterdayI thought I was smart enough to make modifications to the master.cf and main.cf.  Wow was I wrong.  After the changes I made, when you would telnet to port 25 (587 too) it would give you a blank screen and would just hang.  When I looked at the logs all i got was:

Jan 30 06:34:56 [host]postfix/master[28195]: warning: process /usr/lib/postfix/smtpd pid 4838 exit status 1
Jan 30 06:34:56 [host]postfix/master[28195]: warning: /usr/lib/postfix/smtpd: bad command startup — throttling
Jan 30 06:35:56 [host]postfix/smtpd[4876]: fatal: dict_open: unsupported dictionary type: inet:  Is the postfix-inet package installed?

From the error, it would seem that I am missing a package for postfix.  Not the case, in-fact that package doesn’t exist.  Why would they reference a package that doesn’t exist?  I was able to bring the whole thing back up by restoring the master.cf and main.cf from the /etc/ispcp/postfix/working/ directory.  When in doubt, return to the default config file and start over.

Mike

Apache2 + IspCP Omega from Apache1.x = madness

For the issues I have been having with the above formula, I decided to write up my experience in hopes that I can either help someone or at least provide a few little details to make some sense of things.

First off, I just want to say, that if you, as a programmer, choose to use Perl, and then further choose to design a full web application with Perl, PLEASE, PLEASE use the CGI-BIN file so that for future programmers on your project may be able to move your project without an act of congress.  KEEP THINGS SIMPLE!!!

Ok, here is the preface of the situation, A company I have been working with for a few months has a large number of antiquated servers.  They purchased some new ones and then wanted to move everything to the new servers.  This seems like a not too difficult task, the source machines are Fedora.  I opted for the newest release of Ubuntu because of the many new features like integrated cloud control and the fact that it is built on Debian.  Don’t boo me since I am taking the easy road, there is a Sonic wall that will do the filtering and provide a very high level of security and IDS.  Since this is not a post on security I won’t get into the details of my security plan.

Once LAMP and IspCP was all setup, it was time for the copy.  After I had a complete copy of all the files, I began filling out the holes of the new, empty webserver.  For anyone who has messed with IspCP, you will know that it uses /var/www/virtual/[domain name]/htdocs to store the web accessible files.  The cgi-bin folder is stored at the same level as htdocs.

I began populating htdocs with the info from the previous server and everything starting going fine.  Even all of the PHP files worked and executed properly thanks to settings in IspCP.  The issue, Perl was sprinkled throughout much of the web applications.  Many database calls and functions were all written in Perl.  One would think that this isn’t a big deal and that with a few apt-get calls, everything would work out.

The major issue is that it was the intention of the “Elders of The Internet” to store executable files in the cgi-bin.  And from my research (which is many hours at this point), it seems Apache2 with Virtual Hosts is dedicated to following these directives.  After hours of messing with the apache2.conf, ispcp.con, and other config files, I finally have found a work around that is not convenient, but workable.

Inside the virtual host file ispcp.conf (in /etc/apache2/site-enabled/ispcp.conf) under the <VirtualHost> directive, you can place:

AddHandler cgi-script .pl .html
Options +ExecCGI

Inside the same file, inside the <Directory *> directive you can place the same information as above to have it apply only to the specific directory.  However, this only works with directories at the same level or deeper in the tree. (Eg. /here or /here/nowhere).  When I would try to use a directory outside the VirtualHost document root, I would get an Internal Error 500 with the suexec.log file saying that the directory had other write permissions enabled…. Very strange.

The things that don’t work, and guarantee Internal Error 500 are adding the <file ~ .pl> with the file handlers for perl scripts to apache2.conf.  If you try to add an ‘*’ to the directory in the above example, it causes a 500 error.

Finally, I found out the hard way that make changes to the ispcp.conf file don’t stay if someone adds a new website or addon.  Instead you must modify the following file to make it persistent.  /etc/ispcp/apache/working/ispcp.conf

Now back to adding the top directive to the subdirectories.

***UPDATE:  It seems that the previous practice I prescribed earlier has failed.  When I added all of the info to the ispcp.conf, it gave me another Internal Error 500.  This time it was saying a file was writeable by others.  To compound the issue, it looks like Firefox and IE were both reporting Cached pages.  I found a setting in IE to only pull fresh, new copies everytime.  I figured a CTRL+F5 would give me a fresh copy.  It looks like the solution was to add AddHandler cgi-script .pl .html Options +ExecCGI to the .htaccess file.  But now when I add it to a subdomain I am back to the stupid issue with the internal error 500.  I am going to bed.

Good Luck,

Mike

Where are you as a programmer

Thanks to a programming matrix sent to me by my friend Eric, I have decided to take my musings and thoughts to a blog.  Previously I have been putting them into a wiki.  I figured a wiki would be a nice library of information that would be easily accessible.  But as my journey toward a log(n) programmer continues, I must move to a blog and write everything that comes to my brain about code.

Here is the link to the matrix that will allow you to see where you are at and allow you to set your sights for the future:

Complete Programmer’s Matrix <- Click me

As far as programming goes, I have been working on a number of projects recently, but really haven’t had the time to complete anything.  I am in the process of creating a task and project management system.  I hope to take the ideas of management and information logging and make it easy and friendly.  Most project management software I have used is too complex or is missing some core features.  I will add more information about it as it develops.

This is it for my first post, cheers for now.

-Mike