ShareWiz Ultra Secure Server Setup

PHP Security

mysql

MySQL Security

Install MySQL

Issue the following command:

sudo aptitude install mysql-server mysql-client php5-mysql

During the install process, a prompt for a root password will be shown. Choose a secure root password.

top

Secure the MySQL installation using the following and choose the defaults for all of the prompts

Issue the following command:

sudo mysql_secure_installation

top

Update the MySQL config file

Add the following to the [mysqld] section of the /etc/mysql/my.cnf file

Issue the following command:

sudo vi /etc/mysql/my.cnf

and add the following to the [mysqld] section:

[mysqld]

# Query Caching

query-cache-type = 1

# Default to InnoDB

default-storage-engine=innodb

top

Restart MySQL

To activate the modules, restart Apache

Issue the following command:

sudo service mysql restart

sudo /etc/init.d/apache restart

Restart Apache and MySQL to ensure that all of the configuration changes are actived.

top

Continue to the AppArmor Security...