So you’ve made changes to your Apache config, but there are hundreds of uses currently online. To reload the config changes without restarting the service or server, you can run the following command to reload the config:
sudo /etc/init.d/apache2 reload
It should refresh most of the settings. Helpful to know.
So you want to stop MySQL, or restart it?
sudo /usr/local/mysql/support-files/mysql.server start
sudo /usr/local/mysql/support-files/mysql.server stop
sudo /usr/local/mysql/support-files/mysql.server restart
To install MySQL on Centos is a little different from Ubuntu – as I found out. Obviously APT is replaced with yum on this flavour of Linux, but not only that, yum doesn’t appear to set it up for you after installing it (with root account, etc).
Step 1, Install MySQL
> yum install mysql-server mysql
This will download the files and install them in the correct folders, as apptitude would. Step 2 shows you how to prepare the MySQL service.
Step 2, Configure the service
Tell the system to start the MySQL Daemon upon startup:
chkconfig --levels 235 mysqld on
service mysqld start
Now MySQL is installed and running, but the root account will have no password, so we need to ensure there is a strong one. (Or not if you are a crazy one) – You will get some message when the service starts for the first time related to security measures, I would suggest you do read it.
Step 3, Set up Root user
> mysql -u root
> SET PASSWORD FOR 'root'@'%' = PASSWORD(<password>);
Replace <password> with your desired password.
Obviously change the root user details based on your particular set up. I.e. where the root account can connect from, which servers, ips, etc.
I often set up mysql query logging when I am diagnosing a problem.
In the my.cnf file, enter (or update the log parameter)
Remember to restart the mysql service:
sudo service mysql restart (ubuntu)
sudo service mysqld restart (centos)
And, ensure that the log file has the correct permissions for mysql to write to it.
After that you can tail the file to see what’s going on:
tail -f /path/to/logfile.log