Our application is hosted on Linux server Apache/2.4.6 (CentOS)
Whenever the system reboots we have to manually start Apache service.
We want to automate this process such that on every reboot these services start automatically.
Also we have to run few mysql queries manually to update SQL_MODE variable on system reboot. Please guide us to automate this as well.
2
Answers
In order to start automaticly apache/mysql on boot:
Otherwise with cron jobs :
then add:
For your mysql queries, you can use also “@reboot” and code your queries for example with pyhton:
In some Linux distros, you have to write “httpd” instead of “apache2”.
Considering you are trying to install apache on CENTOS 7, you can try to
enable
the service using below command :sudo systemctl enable httpd
This article from DigitalOcean is a good read in same regards :- https://www.digitalocean.com/community/tutorials/how-to-install-the-apache-web-server-on-centos-7
For MySQL issue, it would be worth checking below article where the author speaks on setting parameters in
/etc/mysql/my.cnf
in[mysqld]
section.setting global sql_mode in mysql