Archive for the ‘Website administration’ Category

Web server monitoring: Munin

Sunday, February 8th, 2009

A usefull tool to monitor your server(s): Munin
Gives you provision to easily monitor memory, proc, processes, apache, mysql and much more; and provides you a web interface to see all that at a glance.

And a usefull tutorial, in French: http://www.crashdump.fr/tutoriels/munin-le-top-du-monitoring-3/
(But I am sure there are plenty around in English!)

SEO

Friday, February 6th, 2009

Various resources on SEO (Search Engine Optimisation).
Any additional (valuable) suggestion welcome!

Online tools: start your SEO

  • Website Grader
    Providing a url, returns a grade for the site, and a decent amount of tips to improve your SEO.
  • Google Keyword Tool
    From either a URL or keywords, generate a list of popular search requests.
    As Google does not use much the <meta> keywords, I guess those are rather to be smartly integrated in the site content.
  • Sitemap builder
    Generate your sitemap from a url
  • AddThis
    a toolbar to let your users bookmark/share your site in plenty of social bookmark sites, and more.

Online tools: follow up your SEO

  • Website Grader
    Can also be used to follow up your SEO progress.
  • xinureturns
    Quite complete tool, “Check PageRank, Backlinks, Indexed Pages, Rankings and more”
  • Popuri.us
    Check the rank/popularity of your website against several search engines / social bookmarks / subscribers
  • Link checker
    Check the inbound links to your site
  • Backtags
    Check your site in 20 social bookmark sites

Directories

Resources

Web analytics: piwik

Friday, February 6th, 2009

A short one tonight, as it’s getting late:

A good alternative to Google Analytics, but with which you own your data (and much more):

piwik

Emails received in spam folder in hotmail

Tuesday, February 3rd, 2009

I faced recently a common problem I already had some time back: the mails I send from the website I am working on end up in the spam folder if the recipient uses Hotmail. The first time I met with this issue,  the same went for Gmail users – but not this time; either Google improved their filtering, or my messages content are more relevant.

Anyway: as per Microsoft website, a solution to that is to implement the SenderId protocole.

It simply consists in adding to the DNS entry for your website a Text entry (called SPF Record), as per a format defined by the SenderId protocole. This record specifies which IP address is authorized to send mails for a specific domain name. It prevents an illigitimate mail server to send emails from a domainname it does not own.

Microsoft even provides a wizard to generate the SPF Record.

postfix / sendmail

Monday, January 5th, 2009

I have got a php web application needing to be able to send mail. My hosted Debian server came naked tool-wise, so I first installed sendmail as a MTA.

I first run in the issue that sending a mail was taking ages (that is, one minute for each mail). Googling the problem with my log details (in /var/log/mail.log), I found that my /etc/hosts file was not properly configured: the entry for 127.0.0.1 was set to my (not fully qualified) machine hostname, so sendmail was waiting 1 min till using some default working setting as hostname. I changed it to

127.0.0.1 localhost locahost.localdomain

and it worked.
I guess it would better be changed to some propel fully-qualified name – but I did not have time to dig much in the details at the moment.
Then I could send a mail from command line – but not from the web application, for some wrongly-set permissions reasons.

Searching again on the web, I got the feeling that postfix was a bit better than sendmail – so I just used it instead – and it worked straight away – so I reckon I’ll stick to that.

I now need to get more in details in the configuration (I had quite some spam issue in a previous project, which I’d rather avoid this time…)

Automated backup via subversion

Tuesday, October 14th, 2008

[EDIT: this script was not fully working, now corrected. see details in this post]
We are using Subversion as resource control for our (flash) projects, and we recently though we could use it to automate our backups.

The subversion server is in our local network, and the backup machine outside.

To make things easy, we ve got two ISPs, that we switch every 2 weeks (the ISPs being not terrible reliable here in New Zealand)

So I had to:

- configure the router in our local network so that the subversion server get always attributed the same ip
- configure the router in our local network so that incoming request on the svn port get redirected to the subversion server (identified by its IP, hence the first step)
- checkout all our projects in the backup server
- install a command-line subversion client on the backup server
- write a dos script on the backup server (a windows machine) to update all projects

As I did not know much about dos scripting, it took me a little while.
I had to
- check what is the current IP of our local router from outside (depeding on which ISP we’re plug at the moment of the update)
- if required, relocate the subversion url of all projects
- update all projects
- log some error in case of failure

So below is the corresponding script.

@echo off
REM set the two possible urls for fracture
SET URL1=https://1.2.3.4:8443/svn/
SET URL2=https://5.6.7.8:8443/svn/

REM get the current location: parse the file currentUrl.txt (which contains only one line) and set CURRENT_LOCATION
FOR /f %%a IN (currentUrl.txt) DO SET CURRENT_LOCATION=%%a
REM Current location set to... %CURRENT_LOCATION%
REM try updating a project
CD project1
svn update
REM ERRORLEVEL is changed by most of the commands upon execution, usually to 0 if success, 1 or more if failure
IF ERRORLEVEL 1 (
 cd ..
 REM Update the log file
 echo %DATE% Notice: changing url to %CURRENT_LOCATION% >> error.log
 REM Reset CURRENT_LOCATION
 SET OLD_LOCATION=%CURRENT_LOCATION%
 IF %CURRENT_LOCATION%==%URL1% (
  SET CURRENT_LOCATION=%URL2%
 ) ELSE (
  SET CURRENT_LOCATION=%URL1%
 )
 REM Update currentUrl file
 echo %CURRENT_LOCATION%> currentUrl.txt
 REM Relocate all folders
 FOR /D %%b in (*) DO (
  cd %%b svn switch --relocate %OLD_LOCATION%/%%b/trunk %CURRENT_LOCATION%/%%b/trunk
  IF ERRORLEVEL 1 echo %DATE% WARNING: project %%b could not be relocated >> ../error.log
  cd ..
 )
) ELSE (
 cd ..
)

REM Update all projects
FOR /D %%b in (*) DO (
 cd %%b
 svn update
 IF ERRORLEVEL 1 echo %DATE% ERROR: project %%b could not be updated >> ../error.log
 cd ..
)

@echo off
Setlocal ENABLEDELAYEDEXPANSION
REM set the two possible urls for fracture
Set URL1=https://125.236.208.239:8443/svn/
Set URL2=https://203.109.198.29:8443/svn/

REM get the current location
For /f %%a IN (currentUrl.txt) DO Set CURRENT_LOCATION=%%a

REM Current location set to... %CURRENT_LOCATION%

REM try updating a project
CD Debug
svn update
If ERRORLEVEL 1 (
CD ..
echo %DATE% Notice: changing url from %CURRENT_LOCATION% >> error.log
REM Reset CURRENT_LOCATION
Set OLD_LOCATION=%CURRENT_LOCATION%

If %CURRENT_LOCATION%==%URL1% (
Set CURRENT_LOCATION=%URL2%
) ELSE (
Set CURRENT_LOCATION=%URL1%
)

REM Update currentUrl file
echo !CURRENT_LOCATION! > currentUrl.txt
REM Relocate all folders

For /D %%b IN (*) DO (
CD %%b
svn switch --relocate !OLD_LOCATION!/%%b/trunk !CURRENT_LOCATION!/%%b/trunk
If ERRORLEVEL 1 echo %DATE% WARNING: project %%b could not be relocated >> ../error.log
CD ..
)
) ELSE (
CD ..
)

REM Update all

For /D %%b IN (*) DO (
CD %%b
svn update
If ERRORLEVEL 1 echo %DATE% ERROR: project %%b could not be updated >> ../error.log
CD ..
)