Centos7 mariadb+nginx+phpmyadmin
- yum install -y epel-release
- yum install -y mariadb
- yum install -y mariadb-server
- yum install -y nginx
- yum install -y phpmyadmin
- yum install -y php-fpm
- yum install -y net-tools
- yum install -y htop
- yum install -y tcpdump
- yum install -y mc
- yum install -y nano
Добавляем в автозапуск что нужно:
- systemctl enable mariadb
- systemctl enable nginx
- systemctl enable php-fpm
- systemctl start php-fpm
Настройка maridb
- systemctl start mariadb
- mysql_secure_installation
Enter current password for root (enter for none):
Ничего не вводим, жмем enter
Set root password?Вводим новый пароль
Remove anonymous users? [Y/n]Жмем Y
Disallow root login remotely? [Y/n]Жмем Y
Remove test database and access to it?
Жмем Y
Reload privilege tables now? [Y/n]Жмем Y
Настройка centos
Отключить SELinux
проверяем
- getenforce
Enforcing (включен)Выключаем
- nano /etc/selinux/config
SELINUX=disabled
Настройка PHP-FPM
- mcedit /etc/php-fpm.d/www.conf
listen = /var/run/php-fpm/php5-fpm.socklisten.owner = nginx
listen.group = nginx
listen.mode = 0666
user и group заменив содержимое строк на nginx
- systemctl restart php-fpm
- mkdir -p /var/lib/php/session
- chown -R nginx:nginx /var/lib/php
- ln -s /usr/share/phpMyAdmin /usr/share/nginx/html
- mcedit /etc/nginx/conf.d/pma.conf
nginx.conf
server {
listen 85;
server_name IPSERVER;
root /usr/share/phpMyAdmin/;
index index.php index.html index.htm;
access_log /var/log/nginx/pmaAccess.log main;
error_log /var/log/nginx/pmaError.log;
location ~ \.php$ {
fastcgi_pass unix:/var/run/php-fpm/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param DOCUMENT_ROOT /usr/share/phpMyAdmin/;
fastcgi_param SCRIPT_FILENAME /usr/share/phpMyAdmin$fastcgi_script_name;
fastcgi_param PATH_TRANSLATED /usr/share/phpMyAdmin$fastcgi_script_name;
include fastcgi_params;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_intercept_errors on;
fastcgi_ignore_client_abort off;
fastcgi_connect_timeout 60;
fastcgi_send_timeout 180;
fastcgi_read_timeout 180;
fastcgi_buffer_size 128k;
fastcgi_buffers 4 256k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
}
}
iptables
iptables -I INPUT -p tcp --dport 3306 -j ACCEPT
iptables -I INPUT -p tcp --dport 85 -j ACCEPT
На клиентской машине поставить
https://dev.mysql.com/downloads/connector/net/5.2.html
тут смотрим как создать строку подключения
https://www.connectionstrings.com/
https://dev.mysql.com/downloads/connector/net/5.2.html
тут смотрим как создать строку подключения
https://www.connectionstrings.com/
Комментарии
Отправить комментарий