Month: November 2013

Restarting Mysql and Apache Using Cron Job

Have you notice that your RAM usage on your server is very close to your memory installed? It’s possible because of memory leaking and resource hogging web application. You can free your RAM by restarting Apache and MySQL.

I will give you step by step adding cron jobs into your system:

  1. Login to your server with SSH
  2. Type crontab -l to display list of cron jobs,
  3. Type crontab -e to edit your crontab,
  4. Add * 4 * * * /etc/init.d/mysqld restart to restart Mysql everyday at 4 AM,
  5. Add * 5 * * * /etc/init.d/httpd restart to restart Apache everyday at 5 AM,
  6. Save your file,
  7. Recheck with crontab -l

Step by Step Installing Composer

Since Composer works with the current working directory it is possible to install it in a system wide way.

  1. Change into a directory in your path like cd /usr/local/bin
  2. Get Composer curl -sS https://getcomposer.org/installer | php
  3. Make the phar executable chmod a+x composer.phar
  4. Change into a project directory cd /path/to/my/project
  5. Use Composer as you normally would composer.phar install

Original Source: http://stackoverflow.com/questions/11333230/how-to-run-composer-from-anywhere