반응형

Samba is the standard Windows interoperability suite of programs for Linux and Unix.

Since 1992, Samba has provided secure, stable and fast file and print services for all clients using the SMB/CIFS protocol, such as all versions of DOS and Windows, OS/2, Linux and many others.


This post describes how to create a public share on Samba in Fedora Linux.


Samba를 이용해 윈도우에서도 접속 가능한 리눅스 공유 폴더를 간단히 만들 수 있다. 사용자 이름이나 암호 없이 접속 가능한 간단한 공유 폴더를 만들어 보자.


Download and install Samba package.


Edit '/etc/samba/smb.conf'


Add the following in [global].

netbios name = sean

map to guest = Bad User


Make [share] at the end and add the following in it.

path = /share

public = yes

writable = yes


Run 'testparm' and check 'smb.conf'.


Move to the root directory and make a directory you want to share.

The name of the sharing directory has to be the same as the name you assigned to 'path' in 'smb.conf' [share].


※ 'share' has read and execute permissions only for 'other'. So if you access it as an 'other', you can't write to it unless you give write permission to 'other'. (chmod 777 share)



Add Samba service to the firewall and reload it.


Start and enable Samba. To start services automatically at boot, you must enable them.


Run 'File Explorer' in Windows and access to the sharing directory in Linux by its IP address.


You can also access the directory by the name you assigned to 'netbios name' in 'smb.conf' [global]


반응형
Posted by J-sean
:
반응형

Python comes preinstalled on most Linux distributions and is available as a package on all others. However, there are certain features you might want to use that are not available on your distro’s package. You can easily compile the latest version of Python from the source.


대부분의 리눅스에는 파이썬이 포함되어 있어 바로 사용할 수 있지만 최신 버전의 파이썬 소스를 직접 컴파일해 사용할 수 도 있다.


파이썬 홈페이지에서 소스 파일 링크 주소를 확인 한다.


wget으로 소스코드를 다운 받는다.


다운 받은 소스 코드 확인.


--enable-optimizations 옵션과 함께 configure를 실행 한다.


make가 없다면 설치 한다.



make로 컴파일 한다. 지정된 디렉토리에 설치 하고 싶다면 make 실행 후 make altinstall 까지 진행 한다.


Warning: make install can overwrite or masquerade the python3 binary. make altinstall is therefore recommended instead of make install since it only installs exec_prefix/bin/pythonversion.


exec_prefix (${exec_prefix}) is installation-dependent and should be interpreted as for GNU software. For example, on most Linux systems, the default is /usr.


./python을 실행하면 컴파일된 파이썬이 실행 된다.


간단히 python명령어로 실행하기 위해 /usr/bin에 소프트 링크를 만들어 준다.


파이썬 홈페이지에서 다운 받았던 압축 파일은 삭제 한다.


dnf로 최신 버전 파이썬을 간단히 설치 할 수 도 있다.



설치가 완료되면 파이썬[버전] 형식으로 실행 할 수 있다.


Python package installer인 pip도 설치 한다. 


pip3 --version 명령으로 pip버전을 확인할 수 있다.


반응형
Posted by J-sean
:
반응형

Explains how to install MariaDB in Fedora Linux.

 

2021.08.28 - [Linux] - Linux(Ubuntu) MariaDB(MySQL) Server Remote Access - 데이터베이스 원격 접

 

Generate custom MariaDB YUM repository under '/etc/yum.repos.d/' and name the file 'MariaDB.repo' or something similar.

 

Setting up MariaDB Repositories

 

With the repo file in place, MariaDB can be installed with:

sudo dnf install MariaDB-server

 

Start and enable the service.

 

Open MariaDB Server port.

 

 

 

continues.......

 

 

 

 

 

 

 

반응형
Posted by J-sean
:
반응형

Fedora Linux를 설치하고 간단히 웹서버를 만들 수 있다.

 

2021.08.25 - [Linux] - Linux(Ubuntu) Build Your Own Web Server - 리눅스(우분투)로 웹서버 만들기

 

Fedora 설치 중 Root 암호를 설정 한다. User Creation은 하지 않아도 된다.

 

Root 암호를 입력하고 설치를 완료 한다.

 

설치가 완료되면 재부팅하고 위에서 설정한 암호로 로그인 한다.

 

dnf -y install httpd 를 입력하고 Apache HTTP Server를 설치 한다.

 

 

 

Apache HTTP Server 설치가 완료되면 systemctl status httpd를 입력하고 상태를 확인한다. inactive 상태로 나타난다.

 

systemctl start httpd를 입력해 활성화 시키고 다시 systemctl status httpd를 입력해 확인 한다. active 상태로 나타난다.

 

systemctl enable httpd를 입력해 Apache HTTP Sever가 항상 작동 하도록 한다.

 

firewall-cmd --permanent --add-service=http

firewall-cmd --permanent --add-service=https

firewall-cmd --reload

위 명령어들로 방화벽에 http, https service를 등록한다.

 

ifconfig 명령어로 서버의 주소를 확인 한다. (192.168.11.131)

 

다른 컴퓨터로 서버 주소에 접속할 때 위와 같이 나오면 제대로 설정 된 것이다.

 

 

 

/var/www/html로 이동해서 index.html 파일을 생성 한다.

 

a나 i 키를 눌러 파일을 수정 한다.

 

간단한 html코드를 입력 하고 저장한다.

 

다시 다른 컴퓨터에서 서버에 접속했을 때 위와 같이 나오면 제대로 설정 된 것이다.

 

위와 같이 nmcli를 이용해 고정 IP 주소(192.168.11.200)를 정해 줄 수 있다.

 

※ -ipv4.addresses로 지정하면(앞에 -기호 추가) 원하는 주소를 삭제 할 수 있다고 하는데 처음 지정된 주소는 error가 발생 한다.

새로 추가한 주소는 error 없이 삭제 된다.

 

nmtui를 사용하자.

 

※ 설치: dnf install NetworkManager-tui

 

 

 

php를 설치 한다. 이번엔 -y 옵션을 주지 않았다.

 

y를 입력하고 설치를 진행 한다.

 

/var/www/html/index.php파일을 만든다. 파일명은 원하는대로 지정해도 된다.

 

서버에 설치된 php 정보를 보여주는 코드를 작성 하고 저장 한다.

 

httpd를 재시작 한다.

 

http://192.168.11.200/index.php 에 접속 했을때 위와 같은 화면이 나오면 제대로 설정된 것이다.

 

php-<extension>의 형식으로 필요한 PHP extension을 설치 한다.

 

※ 예를 들어 JSON 데이터를 다룬다면 아래와 같이 php-json을 설치 한다.

dnf install php-json

 

관련 업데이트가 함께 진행 된다.

 

반응형
Posted by J-sean
: