How to Add Services to Chkservd

Posted by Nessa | Posted in uncategorized | Posted on 28-06-2008

4

.!.
.!.

Chkservd is the service in cPanel that checks to make sure that services are running, then restarts them if necessary. It’s also responsible for the ‘Service Manager’ section in cPanel, which is an interface where added services can be easily checked on and off.
To add a new service, create a line in /etc/chkserv.d/chkservd.conf in the same format as the others:

service:1

1 means the service should be enabled, 0 means it’s off.
In /etc/chkserv.d each service has its own file. Create a file called as the name of the service you are monitoring. The contents of the file are in the format of:

#SERVICE = PORT, SEND, RESPONSE, RE-START COMMAND

There are two ways that cPanel checks services with chkservd:

  • Connection-based monitoring – By default, cPanel will try to connect to the service’s specified port, issue a command, and if a response is received within 10 seconds it will consider the service to be online. For instance, FTP:
service[ftpd]=21,QUIT,220,/scripts/restartsrv_ftpserver
  • Process-based monitoring – cPanel will check for a specific process to determine whether it is online. For instance, named:
service[named]=x,x,x,/scripts/restartsrvr_bind,named,named|bind

If you have more than one restart command, you can separate them with semicolons in order of preference that they should be run. Output of these commands will be logged to the chkservd.log
After you’ve created the service’s configuration file, restart chkservd:

/etc/init.d/chkservd restart

You should then see the service listed in WebHost Manager in the ‘service manager section’
Chkservd logs are in /var/log/chkservd.log. Checks are done every 8 minutes, and everyone online service gets a +, offline services get a -. If the service is determined to be offline, the restart command(s) specified in that service’s chkservd configuration file is issued and the output is logged.

If you don’t even have chkservd installed, it’s probably missing and you need to install it.

Alternative PHP Caching FTW

Posted by Nessa | Posted in uncategorized | Posted on 27-06-2008

4

.!.

We get a TON of requests for the PHP APC pecl module because after having adopted suPHP into our configuration, eAccelerator is worthless. It’s quick to install, and especially if you’re running suPHP or phpsuexec, each user can maintain their own settings within their local php.ini without me having to do anything — basically the best thing that a lazy system admin can ask for.

Soooo, here’s how you install it:


wget http://pecl.php.net/get/APC-3.0.17.tgz
tar -xvzf APC-3.0.17.tgz

phpize
./configure && make && make install

Then just add “extension=/apc.so” to your php.ini and you’re done. With PHP under Apache this will load the APC module for everyone, but for suPHP users you’ll need to add it to their php.ini which will also allow them to modify their own APC settings. These are the ones I recommend using:

apc.enabled = 1
apc.shm_segments = 1
apc.shm_size = 30
apc.optimization = 0
apc.ttl = 7200
apc.user_ttl = 7200
apc.num_files_hint = 1000
apc.mmap_file_mask = /tmp/apc.XXXXXX

Now, if you want to get even sexier with it I came across this little tool that monitors the performance of APC on your server.

Santa (kind of) Brings Nessa a Brother

Posted by Nessa | Posted in uncategorized | Posted on 24-06-2008

0

.!.

For Christmas this year my sisters and I bought my mom a Pomeranian that she named Teddy (though my sisters and dad subsequently named him Simon, Maverick, Titus, and Leo). Side note: here’s documented evidence that my Dad does indeed like dogs:

Now ask me why it took me 17 years to beg my dad for a dog, and I still didn’t get one until I was 20 when I was already out of the house. Anyways, we in the Vasile household believe that pets are as much part of a family as people are, which is why I animately insist that my son, Capone, and my niece, Harley, are the only grandkids that my parents are getting anytime soon. Well, this concept kept in mind, the addition of Teddy means that I have a new 4-year-old half brother. I’ve always been the youngest in the family but I’ve so far completely my sisterly duty of taking my little bro to see Santa clause with his uncle Capone:

Merry Christmas!!!

DreamTemplate.com FTW

Posted by Nessa | Posted in uncategorized | Posted on 22-06-2008

3

One of my blog sponsors gave me the opportunity to write an unbiased review about DreamTemplate.com. You’ll have to forgive me for my lack of ‘reviewing’ experience, because I don’t do these very often.

Overview:

DreamTemplate.com is a service that offers thousands of “exclusive premium web content solutions” for webmasters that are created by professional artists and design experts, with a focus of delivering top-quality website templates without the hefty pricing of hiring a programmer/designer.

First Impression:

The layout of the site itself is very clean and organized, and the extensive template category list shows in detail what kinds of templates are offered, unlike other template services that make you guess and use a nasty search box only to not find what you’re looking for. The design of the site, however, could be a little more creative considering the impressive level of design and artisic-ness shown in the templates they produce.

The Templates:

A lot of design sites resell templates from other services, so you tend to see the same templates on dozens of distributor sites all taking credit for them. I’ve seen a lot of template sites, but so far how not seen any repeats on DreamTemplate.com…this leads me to the impression that their templates are truly original, which in my opinion makes their service more reliable. What I also found interesting is that while there are a few similarities between the different templates, they are all unique in their design and no two look entirely alike.

The service:

At the time of my writing, they offer over 300 FREE templates and well over a few thousand paid website templates starting at under $60. Considering what you’d normally expect from free or cheap templates, I’m surprised they aren’t charging more for them. Their info page claims that the designers spend up to 15 hours (or more) on the design, so you’re definitely getting a deal. Subscriptions are also available for users to have access to thousands of templates without paying for each individually.

Negatives:

I don’t really see many pitfalls, but one thing I didn’t see is an emphases on support. You assume responsibility for downloading pre-made website templates, but one thing I would like to see is a maintenance or customization service for inexperienced users to be able to pay to have the template customized to their website, including the addition of content, graphics, etc. They may already offer this service but I didn’t see it mentioned on the site, so if it’s available it needs to be made a little more obvious.

The Big 21

Posted by Nessa | Posted in uncategorized | Posted on 21-06-2008

6

.!.

Well, my 21st birthday is finally here…yay! Of course, all that means to me is that I can now do everything I’ve already been doing for the last four years, only now I’d be doing it legally. So happy birthday to me, I’m getting plastered tonight.

FYI, no pics yet — the party is this Friday the 25th so I’ll have plenty then and I’ll post ‘em here.

Fedora Chokes on Firefox

Posted by Nessa | Posted in uncategorized | Posted on 17-06-2008

2

.!.

We use Fedora in my Linux classes at school, so I was equally pissed off of when I found out that the stock firefox installation doesn’t support ssl…in other words you can’t get to secure pages. Since the entire schooli ntranet is on a secure connection it pretty much sucks when you can’t access your email and assignments. I was the only person in the class who was able to fix this and be able to finish my shit during class instead of doing it for homework.

The error you get when accessing secure pages in Firefox on Fedora is:

Unexpected response from server
Firefox doesn’t know how to communicate with the server.

You can fix this in three commands:

yum update nss (or yum install nss, if it’s not installed)
yum remove firefox
yum install firefox

The Super-Duper Way to Run Backups

Posted by Nessa | Posted in uncategorized | Posted on 15-06-2008

1

.!.

I often worry about my PC at work — it’s about 3 or 4 years old now and I’ve already crashed it twice by running Ubuntu updates and not letting them finish. Luckily I have my home drive mounted as a separate partition so reinstalling the OS isn’t a huge inconvenience aside from having to reinstall all my apps.

After doing some googling I came across SBackup, which is a simple backup program to back up whatever on your system to wherever you want to keep your backups — without having to configure a script.

First, install sbackup via apt-get, yum, or whatever other package manager you use:

$ sudo apt-get install sbackup

Then open the backup manager under System > Administration > Simple Backup Config

Now, I used the custom backup settings because I didn’t want to back up everything on my system — all I’m concerned about is everything in my home directory, such as my Documents, email, and porn browser settings. To select what you want backed up, go to the Include tab and Add Directory or Add File to include files and folders in your backups.

Naturally there are some files within your selected folders that you don’t want to back up, like your trash and cache. You can add those under the Exclude tab.

Next set your timing — I did ‘precisely’ every day at 5pm when I won’t be here to experience the extreme lag of my 14G home directory being tarred up. As for the Purging options, I chose Logarithmic so that I don’t have old backups that I don’t need — I only need the backups in case my PC crashes and I lose everything, so I don’t care about backups from two weeks ago.

The destination part is where you want your backups to go. The default is /var/backup, but if your PC crashes, that isn’t going to be very convenient for you. Therefore one of the two options should be the one you go with:

- Custom local directory: If you have a floppy disk (which I pray you do not) or a USB drive, you can usually find those in the /media directory and have those mounted to copy your backups

- Remote directory: If you have FTP or SSH access to a remote server, you can have your backups uploaded. The syntax is simple:

ssh://user:password@serverip:/remote/dir

After you have everything configured, save your settings and hit Backup Now! to run a test and make sure everything is working.

An Investigation of Sexual Chocolate

Posted by Nessa | Posted in uncategorized | Posted on 14-06-2008

3

.!.

My phrase last week was “sexual chocolate” — I have no idea where I heard it from or why I had such an urge to repeat it and linger on the laughter and dirty looks. I though it was something like chocolate that you use during, um, relations, but it appears that I was sooooo wrong as there are many meanings:

Meaning 1: A band in the movie “Coming to America”

Sexual Chocolate is the name of a Melbourne, AU cover band that performs in night clubs, not to be confused with the name of Eddie Murphy’s band in the 1988 movie “Coming to America” that performed Whitney Houston’s single “Greatest Love of All.”

Meaning 2: A song by Cee-lo with the following chorus:

They call it the – sexual chocolate
Eh, good God y’all – sexual chocolate
Ho, take it easy now – sexual chocolate
Hey, eh-eyyyy now now – sexual chocolate
Oooh, and they call it the – sexual chocolate
Ho, good God y’all – sexual chocolate
Huh, take it easy now – sexual chocolate
Ahhhh-hah hah-ahhhh-ahhhh – sexual chocolate

Meaning 3: A 60′s and 70′s term used to describe gay, black men.

Meaning 4: What this guy from Sparrows Point, Maryland calls himself on MySpace

Meaning 5: Something like 2girls1cup.com  (sorry, no link because it’s against our TOS)

Meaning 6: A sexy person dipped in chocolate

“Give me a piece of that sexual chocolate!”

However, The definition that won the prize was given quite bluntly on urbandictionary.com as  “chocolate that happens to be sexual

Thank you, urbandictionary.com, for being so politically correct in a time of crisis.

Dual Monitor Setup in Ubuntu 7.10, ATI Radeon

Posted by Nessa | Posted in uncategorized | Posted on 12-06-2008

4

The company just bought our department brand hooked up PC’s that include ATI Radeon dual output graphics cards with massive monitors.  This is probably the only time I’d willingly admit that Windows came out ahead, as I spent a good 2 days trying to get my dual monitors to work with Ubuntu.  I finally got it figured out and I’m embarrassed to say that the answer was in front of my the whole time — a fucking GUI!  Anywho, those of you who are having trouble with this as well, here’s what I did to make it work:

My setup:

  • Dell Vostro 200, Dual Core Intel CPUs, 2 Gb RAM
  • ATI Radeon HD 2400 dual output graphics card (both monitors plugged into card)
  • Two Dell 17” monitors

So first, shimmy over to http://ati.amd.com/support/driver.html and select your distro and card model, and download the file to your desktop.

In Terminal, chmod +x ati-driver-installer-<version>.run

Select Linux x86 installation, automatic

After the installation is complete, run:

sudo aticonfig –initial

Reboot.

After reboot, run fglrxinfo and you should get something like this describing your card:

OpenGL vendor string: ATI Technologies Inc.
OpenGL renderer string: ATI Radeon HD 2400 PRO
OpenGL version string: 2.1.7537 Release

At this point you probably see that both monitors are enabled, but are mirroring each other.  If you don’t, you might need to manually active the second:

sudo aticonfig –query-monitor

Use the output of that command and run:

sudo ati-config –enable-monitor=<result1>,<result2>

Replace result1 and result2 with the output of the first command.  Possible results are: none, crt1, crt2, lvds, tv, fmds1, tmds2

If the enable works, make it permanent:

sudo aticonfig –force-monitor=<result1>,<result2>

When both your monitors are up (whether they look how you want or not), in your GNOME gui, go to Applications > ATI Catalyst Control Center. This is where you configure how you want your dual monitors to act.

In Display Manager, set the dropdown to two monitors and change the Display Mode to “Big Desktop” — this will enable both monitors as one long desktop that you can drag your mouse and windows between.  You can also go ahead and set your resolution.

And there you go — easy dual monitor setup for Ubuntu 7.10!

UPDATE: Major issues with graphics after I upgraded to 8.10 – I found these instructions which worked:

http://wiki.cchtml.com/index.php/Ubuntu_Intrepid_Installation_Guide#Installing_the_restricted_drivers_manually

Creating and Installing an SPF Record

Posted by Nessa | Posted in uncategorized | Posted on 09-06-2008

5

.!.

Have you ever received a bounce for spam that was sent by you…only it wasn’t sent by you? Email spoofing is one of the easiest concepts to understand for us, but the hardest to explain to end users who confuse spoofing with email hacking and hijacking. The way I explain it to our customers is that spoofing is simply when someone (usually spammers) sends an email that looks as if it came from one person, when it really came from someone else.

Regardless of what some email providers say, there is no honest and straight forward way to keep people from spoofing your email, unless you have access to the real sender’s mail system. However, there is a way to keep legitimate mail servers from accepting spoofed email by creating an SPF record for your domain.

An SPF record (sender policy framework) in short is a DNS record that you add to your domain’s zone file to specify which hosts are allowed to send mail on behalf of your domain. For the most part you would only want the server hosting your domain to be able to send mail, but hat most of our customers don’t realize is that they unknowingly spoof email all the time! Since ISP’s nowadays block SMTP port 25 for third-party mail servers, a lot of our customers use their ISP to send mail for their domain. This is basically how email is spoofed…you put an email address as the ‘from’ address in an email, and send it from a different mail server. Even though this is legitimate email, they are basically allowing their ISP’s mail servers to send their domain’s email, even though their ISP has no authority or management rights over that email, since the domain is hosted on another server.

We usually require our customers to generate their own SPF records so that they can specify what servers they want to be able to send mail from, that way our hands stay clean if the SPF record causes them to not be able to send email. If you go to www.openspf.org you can easily generate a custom SPF record to add to your DNS zone with little to no hassle. The questions can be a little confusing for newbies, so here’s a quick walkthrough on how to answer them.

Question 1: A-Record

v-nessa.net's IP address is 216.134.252.71 (vps71.inmotionhosting.com).
Does that server send mail for v-nessa.net?

The wizard will attempt to resolve the domain to an IP, then do a rDNS on the IP for a hostname. You usually want to say YES unless your mail is hosted on a different server.

Question 2: MX-Record

This wizard found 2 names for the MX servers for v-nessa.net:
vps71.inmotionhosting.com and v-nessa.net.
MX servers receive mail for v-nessa.net.
Do they also send mail from v-nessa.net?

In most cases, this will be true. Exceptions for this is if you have an irregular MX record modification, or are using another outgoing mail server or domain to send mail.

Question 3: PTR

Do you want to just approve any host whose name ends in v-nessa.net?

Typically, you do not want to enable this setting unless you have mail accounts set up for subdomains or domains that are similar in ending that need to relay through this domain. Or, if you use a subdomain as your sending host (like mail.domain.com, etc)

Question 4: A subs

Do any other servers send mail from v-nessa.net?

The answer is usually no. The only other server that would send on behalf of that domain would be the server name (you may need to ask your host for this), but this was already allowed in question 1. The next two fields can be left blank, unless you specifically have information to add to them.

Question 5: Include

Could mail from v-nessa.net originate through servers belonging to some other domain?

Fill in this field mainly if you are planning on using another mail server or domain (such as your ISP, gmail, etc.) to send mail. Otherwise say no.

Question 6: ~all

Do the above lines describe all the hosts that send mail from v-nessa.net?

Check your answers and hit yes.
At the bottom of the page you’ll see the nicely-generated SPF record that will look something like this:

"v=spf1 a mx ~all"

Adding the Zone Entry

You can add the SPF record either WHM (if you are on a cPanel server) or manually in the zone file of that domain.

The line will look something like this:

v-nessa.net. 14400 IN TXT "v=spf1 a mx ~all"

You can then verify the addition by doing a dig on the domain:

dig v-nessa.net TXT