Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
linux_wiki:network_services_overview_database_services [2016/10/01 15:42] billdozor [Configure the service to start when the system is booted] |
linux_wiki:network_services_overview_database_services [2018/05/12 16:34] billdozor [Use SELinux port labeling to allow services to use non-standard ports] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Network Services Overview Database Services ====== | + | ====== Network Services Overview: Database Services ====== |
**General Information** | **General Information** | ||
- | This page covers the Network Services objectives, specifically for < | + | This page covers the Network Services objectives, specifically for MariaDB. |
**Network Services Objectives** | **Network Services Objectives** | ||
Line 12: | Line 12: | ||
* Configure the service for basic operation | * Configure the service for basic operation | ||
* Configure host-based and user-based security for the service | * Configure host-based and user-based security for the service | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ====== Lab Setup ====== | ||
+ | |||
+ | The following virtual machines will be used: | ||
+ | * server1.example.com (192.168.1.150) -> Perform any client testing here | ||
+ | * server2.example.com (192.168.1.151) -> Install the database here | ||
---- | ---- | ||
Line 23: | Line 31: | ||
* mariadb -> the client | * mariadb -> the client | ||
* mariadb-server -> the server | * mariadb-server -> the server | ||
+ | |||
+ | \\ | ||
+ | Documentation (what can go in the /etc/my.cnf config) | ||
+ | <code bash> | ||
+ | / | ||
+ | |||
+ | # then search for ' | ||
+ | / | ||
+ | </ | ||
---- | ---- | ||
Line 37: | Line 54: | ||
* Examples: "man semanage-port" | * Examples: "man semanage-port" | ||
- | * Tip: To see current port labels< | + | * Tip: To see current port labels< |
\\ | \\ | ||
Line 58: | Line 75: | ||
SELinux: Allow mariadb to use the new port | SELinux: Allow mariadb to use the new port | ||
<code bash> | <code bash> | ||
- | semanage port -a -t mysqld_port_t | + | semanage port -a -t mysqld_port_t -p tcp 5502 |
</ | </ | ||
Line 66: | Line 83: | ||
systemctl restart mariadb | systemctl restart mariadb | ||
</ | </ | ||
+ | |||
+ | \\ | ||
+ | Remote clients would need to connect like this example (specifying a port)< | ||
+ | * -h 192.168.1.151 | ||
+ | * --port=5502 | ||
+ | * -u root -> Database username | ||
+ | * -p -> Prompt for password | ||
---- | ---- | ||
Line 89: | Line 113: | ||
Enable and Start the service | Enable and Start the service | ||
<code bash> | <code bash> | ||
- | systemctl enable | + | systemctl enable |
- | systemctl start < | + | systemctl start mariadb |
</ | </ | ||
Line 101: | Line 125: | ||
Allow access through the firewall | Allow access through the firewall | ||
<code bash> | <code bash> | ||
- | firewall-cmd --permanent --add-service=< | + | firewall-cmd --permanent --add-service=mysql |
firewall-cmd --reload | firewall-cmd --reload | ||
</ | </ |