Symmetry of Soul:Technical Notes

From Symmetry of Soul

MySQL Stuff

  • CREATE USER 'foouser'@'localhost' IDENTIFIED BY '<password>';
  • CREATE DATABASE 'foo'
  • GRANT ALL PRIVILEGES ON foo.* TO 'foouser'@'localhost';

Make /var/www stuff accessible to APACHE

  • chown -R www-data /path/to/directory

Apache Things

sudo systemctl restart apache2 sudo a2ensite your_domain_1.conf

Persimmons

  • Add user to apache group:
    • usermod -a -G www-data [username]
  • Add a new user
    • Log in as root
    • adduser [username]
    • Make this user a sudoer: usermod -aG sudo [username]
    • Add root's public key to that new user so you can SSH there:
      • rsync --archive --chown=[username]:[username] ~/.ssh /home/[username]

Optimize Apache for low-memory VPS

from here

Under Ubuntu Open this file in editor:
nano /etc/apache2/apache2.conf
Find and add/change this configs under apache2.conf file :
<IfModule mpm_prefork_module>
 StartServers        3
 MinSpareServers     5
 MaxSpareServers     15
 ServerLimit         256
 MaxClients          256
 MaxRequestsPerChild 3000
</IfModule>
</nowiki>

Optimize MySQL for low-memory VPS

from here

  • This is mainly about disabling performance schema
[mysqld]
# Disable performance schema to hugely reduce RAM usage
performance_schema = OFF
# I'm not sure if these two commands make any difference, but they don't seem to hurt
innodb_buffer_pool_size=30M
innodb_log_buffer_size=256K
[mysqld_safe]
# Settings to reduce RAM
innodb_buffer_pool_size=25M
innodb_log_buffer_size=256K
query_cache_size=10000
max_connections=30
key_buffer_size=80
innodb_ft_cache_size=1600000
innoinnodb_ft_total_cache_size=32000000
table_definition_cache=150
# Settings to reduce RAM: per thread or per operation settings
thread_stack=131072
sort_buffer_size=32K
read_buffer_size=8200
read_rnd_buffer_size=8200
max_heap_table_size=16K
tmp_table_size=50K
bulk_insert_buffer_size=100
join_buffer_size=128
net_buffer_length=1K
innodb_sort_buffer_size=64K
# Settings to reduce RAM: settings that relate to the binary log (if enabled)
binlog_cache_size=4K
binlog_stmt_cache_size=4K