We are running CentOS 5.6 on a dedicated server. I am planning on deploying our Magento store changes using BeanstalkApp (www.beanstalkapp.com) which offers pre and post deploy hooks.
My username for the server is (in this example) USER123 but the files need to be owned by APACHE for Magento to run correctly. This is the advice of my server host.
What I am trying to achieve is to automatically run the following command on the server before a deploy:
sudo chown -r USER123: /var/www/vhosts/domainname.com/httpdocs/store/
followed by the following after the deploy:
sudo chown -r APACHE: /var/www/vhosts/domainname.com/httpdocs/store/
So I have two questions:
1) Will the above commands work, or do I need to switch into the directory shown and then use ././ instead of the exact route shown above?
2) How do I make this into a 'script' that can be touched by BeanstalkApp pre and post deploy?
Any pointers would be appreciated!