Cheat Sheet
Some quick codes for various admin tasks
Apache2
"sudo tail -f /var/log/apache2/error.log" - run inside your VM to watch the web server error logs
"sudo tail -f /var/log/apache2/access.log" - watch the incoming connection requests for the webserver
"sudo service apache2 restart" - restart the webserver. Usually used if we accidentally DDOS it and it's failing to return connections
Debian
Use "sudo" at the start of a command to act as super user. "su -switch developer"
CRON Examples
Use the following command to open the crontab editor. Make sure you SSH in as developer if setting this up on the live server.
* Development: php -f /vagrant/MyCMS2/bin/cli.php -- /vagrant/MyCMS2/bin/ServiceRunner.php -n ProcessJobs -e development -a /vagrant/MyCMS2 -s /vagrant/www/coremma.co.nz/
* Production: php -f /opt/mycms/bin/cli.php -- /opt/mycms/bin/ServiceRunner.php -n ProcessJobs -e production -a /opt/mycms -s /opt/www/coremma.co.nz/
* Example CRON
* 0 12 * * * php -f /vagrant/MyCMS2/bin/cli.php -- /vagrant/MyCMS2/bin/ServiceRunner.php -n ProcessJobs -e development -a /vagrant/MyCMS2 -s /vagrant/www/coremma.co.nz/
* MAILTO='info@coremma.co.nz'
* 0 23 * * * php -f /opt/mycms/bin/cli.php -- /opt/mycms/bin/ServiceRunner.php -n ProcessJobs -e production -a /opt/mycms -s /opt/www/coremma.co.nz/