ubuntu

NAS 설치(삼바, mysql)

cj92 2019. 3. 15. 21:17

sudo apt install mysql-server

sudo mysql_secure_installation

Y->1->(password 입력)->Y->Y->Y->Y->Y


sql설치


sudo mysql

(mysql 환경 내에서)

create database 데이터베이스명 default character set utf8;

show variables like 'validate_password%';

grant all privileges on 데이터베이스명.* to '사용자이름'@'localhost' identified by '비번';

mysql -u webnauts -p

show databases;

use db;

exit;



php설치

sudo apt install php php-mysql

sudo vi /var/www/html/info.php

<?php phpinfo(); ?>  입력 -> :wq입력


인터넷에 localhost/info.php 확인


sudo apt install phpmyadmin


확인 -> 예 -> mysql id 입력

localhost/phpmyadmin 접속


혹시 접속이 안되면 

sudo -H gedit /etc/apache2/apache2.conf

include /etc/phpmyadmin/apache.conf

/etc/init.d/apache2 restart


cmd로 설정

sudo apt-get install samba

sudo vi /ect/samba/smb.conf


내부설정

[data]

path = /home/data/ 등의 경로

writeable        = yes

browseable     = yes

guest ok        = yes

creat mask     = 0777

directory mask= 0777

security mask  = 0777


gui로 설정

sudo apt-get install system-config-samba

sudo touch /etc/libuser.conf

sudo system-config-samba


sudo systemctl restart smbd

sudo systemctl /lib/systemd/systemd-sysv-install enable smbd

sudo systemctl status smbd



nextcloud(miria DB 사용했을 때 nas 설정)

sudo apt-get install samba


sudo apt-get install system-config-samba

sudo touch /etc/libuser.conf

sudo system-config-samba


sudo systemctl restart smbd

sudo systemctl /lib/systemd/systemd-sysv-install enable smbd

sudo systemctl status smbd