I want to run a command "chmod -R 777 foldername" every time when apache restarts on my linux server.
How can I do that?
I have Linux CentOs 7.1 64 bit installed on my server with VestaCp.
I want to run a command "chmod -R 777 foldername" every time when apache restarts on my linux server.
How can I do that?
I have Linux CentOs 7.1 64 bit installed on my server with VestaCp.
You can edit /etc/init.d/apache2
and add your command in start & restart
start)
[..]
CHMOD -R 77 foldername &
;;
restart)
[..]
CHMOD -R 77 foldername &
;;
But don't forget that thoose informations will be reset if there is an Apache update
Not sure about Redhat-style distros, but in Debian-likes there's /etc/default/apache2, a shell file included on every run of /etc/init.d/apache2.