Difference between revisions of "SME Server:Documentation:Technical Manual:Chapter4"
m |
(root user warning) |
||
Line 96: | Line 96: | ||
This will create an empty database called name. | This will create an empty database called name. | ||
+ | |||
+ | {{DrawBoxWarning|content=The 'root' user should not be permitted to access the database except from localhost. Each application should have its own database and its own user to access that database.|| | ||
+ | }} | ||
To create a new MySQL user. Decide which permissions you will have to give to the user on what database. Details about this can be found in the MySQL Manual found at the MySQL site. Get access to the SME Server shell and issue the following commands to login to the MySQL server: | To create a new MySQL user. Decide which permissions you will have to give to the user on what database. Details about this can be found in the MySQL Manual found at the MySQL site. Get access to the SME Server shell and issue the following commands to login to the MySQL server: |
Revision as of 23:09, 19 February 2007
Chapter 4. Software Configuration
Information for software that comes with the SME Server but may require additional configuration
Nut UPS – Uninterruptable Power Supply
The primary goal of the Network UPS Tools (NUT) project is to provide reliable monitoring of UPS hardware and ensure safe shutdowns of the systems which are connected.
Standard configuration
Obtain your configuration values
Find your model here http://www.networkupstools.org/compat/stable.html
Type is only used if your model is genericups
note. /dev/ttyS0 = com1, [if using USB]
set configuration values
config setprop nut Device /dev/ttyS0 config setprop nut Model apcsmart config setprop nut Type 7 config setprop nut status enabled
check
config show nut
apply changes and restart server
signal-event post-upgrade ; signal-event reboot
confirm server is communicating with UPS
upsc UPS@localhost
Emails are sent to admin whenever a UPS event occurs
Configuring as a slave
where 192.168.33.11 is your UPS master, the computer that will communicate with the UPS The hostname of the server may also work.
set configuration values
config setprop nut SlaveUPS UPS@192.168.33.11 config setprop nut Master no
apply changes and restart server
signal-event post-upgrade ; signal-event reboot
confirm server is communicating with master
upsc UPS@192.168.33.11
Conecting multiple UPS's
to be added http://bugs.contribs.org/show_bug.cgi?id=629
MySQL Database
SME Server runs MySQL as a database server. There are a lot of applications require a MySQL database, among them is the Horde webmail interface which is supplied by SME Server by default.
Usefull links
- MySQL website: http://www.mysql.com
- MySQL 4.1 manual: http://dev.mysql.com/doc/refman/4.1/en/
General
The SME Server is based on CentOS, the development team will take their stock RPM's from the CentOS releases. The current version of MySQL installed on SME Server is version 4.1.20.
You can upgrade MySQL to a higher version but you are advised not to do so, as this might break your SME Server configuration. The Horde webmail interface relies on MySQL. Upgrading to version 5.x is known to break stuff like webmail. If you insist on upgrading MySQL you may be able to find instructions in the forum, but be advised that no support can be expected from the developers and all bugs reported in the bugtracker will not be taken into account.
MySQL on SME Server runs on a socket instead of on a port which you might be accustomed to. This is done to improve security as in the view of the development team only the server self needs to have access to the MySQL server. However you can configure MySQL to be accessible from the local network
There seems to be no password set for the MySQL root password, but this is not true. If you are logged in to the SME Server shell a special mechanism is in place to log you in with MySQL root privileges without prompting you for the password.
The MySQL root password for SME Server is a 72 character random string generated during installation of SME Server. You should never change the MySQL root password as this will break your SME Server configuration. How to login as MySQL root user? describes how to access MySQL with root privileges on SME Server.
To reset the password for the MySQL root account. The MySQL root user on SME Server has a random generated password which is generated during installation. You do not need to know this password to login to MySQL with root privileges on SME Server. If you might have changed the MySQL root password you can reset it like this after getting command line access as root user:
cd /var/service/mysqld runsvctrl d . expand-template /root/.my.cnf expand-template /var/service/mysqld/set.password /usr/libexec/mysqld --bootstrap --user=mysql --skip-grant-tables < ./set.password runsvctrl u .
To access MySQL from my local network Because MySQL on SME Sverer is ran on a socket instead of a on a port MySQL on SME Server is by default configured to allow only local connections to improve security, this means that it is only accessible from the server it self and not from the local network nor from the internet. If you wish to enable local network access, execute the following commands on a SME Server shell as root:
config setprop mysqld LocalNetworkingOnly no expand-template /etc/my.cnf /etc/rc.d/init.d/mysqld restart
Administration
To create a new database
- See the developers guide if you wish to automate the creation of a database within an rpm
or
- Get command line access and issue the following commands:
mysqladmin createdatabase 'name'
This will create an empty database called name.
To create a new MySQL user. Decide which permissions you will have to give to the user on what database. Details about this can be found in the MySQL Manual found at the MySQL site. Get access to the SME Server shell and issue the following commands to login to the MySQL server:
mysql
Suppose we want to create a user which has read-only access on all tables in the database called 'test':
GRANT SELECT ON test.* TO 'user'@'host' IDENTIFIED BY 'password';
In the above line you will have to fill in the user and the host and/or domain from which you will allow the user access to the SME Server MySQL server (don't forget the single quotes). More information can be found in the MySQL Server Manual at the MySQL website linked here.
To login as MySQL root user, simply type 'mysql' at the SME Server shell, this will log you in with root privileges.
After changing the email settings with a db command run the event
signal-event email-update
Spamassassin
Set spamassassin for automatically delete junkmail. You can change the "days" that spamassassin sets to automatically delete junkmail, to delete after two months
db configuration setprop spamassassin MessageRetentionTime 60
Firewall
After changing the firewall settings with a db command run the event
signal-event remoteaccess-update
see the devguide http://mirror.contribs.org/smeserver/contribs/gordonr/devguide/html/x2072.htm
Block An IP Range from a service
FIXME