본문 바로가기

리눅스 헛다리/Ubuntu

(13)
우분투 systemd 데몬 사용 - 일정시간마다 동작처리 vi /etc/systemd/system/[서비스명].service​[Unit]Description=[서비스] Schedule TaskAfter=network.target​[Service]ExecStart=/usr/bin/php /home/[프로젝트]/spark schedule:your_schedule Restart=always ##RestartSec=3 ##User=[사용자]WorkingDirectory=/home/[프로젝트]StandardOutput=append:/var/log/[서비스명].logStandardError=append:/var/log/[서비스명].log----------------------------------------------------------------------------..
우분투 systemd 데몬 사용 - sh 파일 실행하기 (여기서는 특정시간에 동작 설정) vi /etc/systemd/system/bakup_sh.service[Unit]Description=설명 db를 백업할거야....After=network.targetRequires=network-online.target[Service]Type=oneshotUser=rootWorkingDirectory=/home/backup ExecStart=/home/backup/backup.sh   vi /etc/systemd/system/bakup_sh.timer[Unit]Description=설명 .....[Timer]OnCalendar=*-*-* 03:00:00   # systemd 새로고침sudo systemctl daemon-reload​#시스템 시작시 등록되었는지 확인systemctl i..
[ubuntu server 24.04] git설치및 git pull [ubuntu server 24.04] git설치및 git pull​​위 구조에서 운영서버 git pull 작업 ....​​- git 설치sudo apt install git​- 프로젝트 이동cd /프로젝트​​- 초기화git init​- user 등록git config --global user.email "이메일"git config --global user.name "이름"​​- 저장소 등록git remote add origin 저장소경로​- 저장소 등록시 에러문 발생할 경우에러메시지 :fatal: detected dubious ownership in repository at '경로'To add an exception for this directory, call: (안전한 디렉토리가 아니라고 경고) 아래..
우분투24.04 ftp 설정 apt install vsftpd​​​vi /etc/vsftpd.conf# Example config file /etc/vsftpd.conf## The default compiled in settings are fairly paranoid. This sample file# loosens things up a bit, to make the ftp daemon more usable.# Please see vsftpd.conf.5 for all compiled in defaults.## READ THIS: This example file is NOT an exhaustive list of vsftpd options.# Please read the vsftpd.conf.5 manual page to get a ..
우분투 sftp 권한 처리(nginx 루트경로를 /var/www/html/ 인경우 ) 우분투 sftp 권한 처리(nginx 루트경로를 /var/www/html/ 인경우 )​​nginx 웹 루트 경로를 /var/www/html/ 하위로 사용할 경우​sftp로 파일 및 폴더를 올리려면 권한이 필요하다.​chown www-data , chmod 를 했어도 권한이 없어서 폴더가 생성이 되지 않는다.​sftp 설정에서 권한을 줘야 한다.​vi /etc/ssh/sshd_config​ 그룹으로 주던가Match Group www-data ChrootDirectory / ForceCommand internal-sftp 유저명으로 주던가 Match User user001 ChrootDirectory /user001 ForceCommand internal-sftp 그룹으로 하던 유저로 ..
우분투24.04서버 nginx설치03 [vhost설정] 1. nginx.conf 확인sudo vi /etc/nginx/nginx.conf​include /etc/nginx/sites-enabled/*; 있는지 확인​2. vhost 설정 폴더 확인​/etc/nginx 에 sites-available sites-available 폴더 확인​​sudo vi /etc/nginx/sites-available/lore2.vm-ubuntu.com​server {listen 80;server_name lore2.vm-ubuntu.com;​root /home/lore2/public_html;index index.html index.htm index.php;​location / {try_files $uri $uri/ =404;}​error_page 404 /404.html;​..
우분투24.04서버 nginx설치02 [php-fpm설치] nginx는 아파치(mod php기본장착 아파치 만세)와 달리 php fpm을 추가설치해야 한다.​​설치하자sudo apt install php8.3-fpm​​상태확인sudo systemctl status php8.3-fpm
우분투24.04서버 nginx설치01 1. 버전확인​nginx -v친절한 우분투는 설치 명령어를 알려준다.​​apt install nginx​​y​​​설치완료 후 다시 버전확인​​3. Nginx 서비스 관리Nginx 시작:​sudo systemctl start nginx ​​자동 시작 활성화:sudo systemctl enable nginx ​​Nginx 상태 확인:sudo systemctl status nginx 4. 방화벽 설정 (방화벽 사용하는 경우) 일단은 virtuabox에 깔아서 신경안씀. 서버운영시를 위해 기록해 놓자.sudo ufw allow 'Nginx Full' sudo ufw reload 5. Nginx 기본 페이지 확인브라우저에서 서버의 IP 주소로 접속하여 Nginx 기본 페이지가 표시되는지 확인​브라우져로 확인 추가..