Server setting 1

권한세팅 / ACM 설치

Posted by ETHAN KIM on July 10, 2022 · 3 mins read
Server PHP

root 계정 혹은 sudo 권한 계정으로 진행


1. 권한관리

  • 계정생성
    [root@centos7 ~]# sudo useradd -m newuser
    -- 옵션 -- 
    -m : 해당 유저의 폴더를 같이 생성
    -g : 그룹 지정
    -d : 디렉토리 지정
    -s : 쉘(shell) 지정
    -p : 패스워드(암호) 지정
    
  • 생성한 계정의 비밀번호를 변경
    [root@centos7 ~]# sudo passwd mem1
    
  • 그룹 추가 및 확인
    [root@centos7 ~]# sudo groupadd {newGroupName}
    [root@centos7 ~]# sudo gpasswd {groupName} -a {userName}
    
  • 유저에게 sudo권한 부여
    [root@centos7 ~]# visudo
    root ALL=(ALL) ALL <--밑으로 sudo 권한 유저 추가
    mem1 ALL=(ALL) ALL
    mem2 ALL=(ALL) ALL
    



2. 의존성 패키지 확인 및 설치

  • 패키지 확인
    [root@centos7 ~]# rpm -qa libjpeg* libpng* freetype* gd-* gcc gcc-c++ gdbm-devel libtermcap-devel
    
  • 패키지 설치
    [root@centos7 ~]# yum install libjpeg* libpng* freetype* gd-* gcc gcc-c++ gdbm-devel libtermcap-devel
    



3. APM 설치 (순서주의)

  • Apache 설치
    [root@centos7 ~]# yum install httpd
    
  • MariaDB 설치
    [root@centos7 ~]# yum install mariadb mariadb-server
    
  • PHP 설치 (원하는 버전으로 설치 시 remi repository 설치 및 버전 세팅 필요)
    [root@centos7 ~]# yum install php php-mysql php-mbstring php-pdo php-gd
    
  • 설치 확인



4. 서비스 구동확인

  • 프로세스 시작 및 구동확인
    [root@centos7 ~]# systemctl start httpd
    [root@centos7 ~]# systemctl enable httpd.service
    [root@centos7 ~]# systemctl status httpd
    [root@centos7 ~]# ps -ef | grep httpd (프로세스 확인)
    [root@centos7 ~]# systemctl start mariadb
    [root@centos7 ~]# systemctl enable mariadb.service
    [root@centos7 ~]# systemctl enable mariadb.service
    [root@centos7 ~]# ps -ef | grep mariadb (프로세스 확인)
    
  • maraidb 확인