README-server 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. $OpenBSD: README-server,v 1.4 2015/07/17 17:31:27 sthen Exp $
  2. +-----------------------------------------------------------------------
  3. | Running ${FULLPKGNAME} on OpenBSD
  4. +-----------------------------------------------------------------------
  5. Initial setup
  6. =============
  7. If you are installing MariaDB for the first time, you have to create
  8. a default database first. In order to create the database, please run
  9. ${TRUEPREFIX}/bin/mysql_install_db
  10. You will need to tune the values in the my.cnf file (examples
  11. available in ${TRUEPREFIX}/share/examples/mysql).
  12. By default, the _mysql user, and so the MariaDB processes run in the
  13. login(1) class of "daemon". On a busy server, it may be advisable
  14. to put the _mysql user and processes in their own login(1) class
  15. with tuned resources, such as more open file descriptors etc.
  16. For example, add this to the login.conf(5) file:
  17. mysqld:\
  18. :openfiles-cur=1024:\
  19. :openfiles-max=2048:\
  20. :tc=daemon:
  21. Rebuild the login.conf.db file if necessary:
  22. # [ -f /etc/login.conf.db ] && cap_mkdb /etc/login.conf
  23. For larger servers and dedicated database servers, these numbers
  24. and memory limits (e.g. datasize and stacksize) may also need to be
  25. increased. Please report any changes and experiences to the package
  26. maintainers so that we can update this file for future versions.
  27. chrooted daemons and MariaDB socket
  28. ===================================
  29. For external program running under a chroot(8) to be able to access the
  30. MariaDB server without using a network connection, the socket must be
  31. placed inside the chroot.
  32. e.g. httpd(8) or nginx(8): connecting to MariaDB from PHP
  33. ---------------------------------------------------------
  34. Create a directory for the MariaDB socket:
  35. # install -d -m 0711 -o _mysql -g _mysql /var/www/var/run/mysql
  36. Adjust ${SYSCONFDIR}/my.cnf to put and connect to the MariaDB socket
  37. within the chroot:
  38. [client]
  39. socket = /var/www/var/run/mysql/mysql.sock
  40. [mysqld]
  41. socket = /var/www/var/run/mysql/mysql.sock