Entries Tagged as 'Web Servers / Unix'

Mental Note: Our Server Sucks

Geek alert: if you’re not a server geek, there’s nothing to see here… move along now… 

Sometimes it helps to read the fine print. When using PHP’s mail() function, some of us need to remember simple things, like not using \r:

Note: If messages are not received, try using a LF (\n) only. Some poor quality Unix mail transfer agents replace LF by CRLF automatically (which leads to doubling CR if CRLF is used). This should be a last resort, as it does not comply with RFC 2822.

Chown that file!

All you n00b server lords out there (like me):

Learn how to chown that file!
[user@localhost]$ chown theuser thefilemask

I recently came across a problem related to one of our custom CMS builds. For the browser user upload of images, the PHP application wrote an image file to the webserver with the owner set to ”apache” (I guess that’s because the PHP processes run as instances in the Apache server). So, when I tried to copy the apache-owned images via FTP to my local drive, it would not allow me ’cause I was logged on as the FTP user. That’s a problem if you’re migrating a site from a dev environment to a live environment on another server half way around the world.

So, rather than muck about with permissions, etc., I simply logged into our server via a shell, and changed the owner of all the images in question to the user account I’m using for FTP access. Done and done. FTP all good. Migration all good.

So far.