문서의 선택한 두 판 사이의 차이를 보여줍니다.
nextcloud_삽질 [2019/07/10 13:43] gsjung [삼바 연결시] |
nextcloud_삽질 [2020/04/14 08:25] |
||
---|---|---|---|
줄 1: | 줄 1: | ||
- | < | ||
- | 기본적으로 [[https:// | ||
- | |||
- | ===== 파티셔닝 ===== | ||
- | 환경 | ||
- | 기존 centos 7 에서 4TB 볼륨 2개를 추가 -> 1개 볼륨 그룹으로 생성 | ||
- | os디스크는 한개로 구성 | ||
- | |||
- | - 2TB이상에서는 GPT볼륨으로 구성을 해야 하는데 fdisk 로는 파티션을 잡을 수 없다.. | ||
- | 그래서 parted 로 설정을 해야함. | ||
- | |||
- | < | ||
- | # fdisk -l 로 현재 장치명 확인 | ||
- | / | ||
- | # parted /dev/sdb | ||
- | < | ||
- | < | ||
- | < | ||
- | < | ||
- | < | ||
- | < | ||
- | # parted /dev/sdc : 이것도 동일하게 설정 | ||
- | # fdisk -l로 다시 확인 | ||
- | /dev/sdb1 /dev/sdc1 으로 파티션이 설정된 것이 보임 | ||
- | |||
- | # pvcreate /dev/sdb1 : Physical volume 생성 | ||
- | # pvcreate /dev/sdc1 : 동일 | ||
- | # vgcreate VG01 /dev/sdb1 / | ||
- | # lvcreate -n lv_test01 -L 100G VG01 : VG01볼륨 그룹에서 lv_test01 이라는 이름의 logical volume 을 생성한다. | ||
- | # mkfs.ext4 / | ||
- | # mkdir / | ||
- | # mount / | ||
- | # vi /etc/fstab : 위 마운트 정보를 등록하여 재부팅시 자동으로 마운트 하도록 설정 | ||
- | / | ||
- | |||
- | </ | ||
- | |||
- | fstabl 등록시 다른 방법 | ||
- | # df -h |grep /dev/VG01/ >> /etc/fstab : 이렇게 하면 df -h 에서 /dev/VG01 문자가 들어있는 문자열을 / | ||
- | |||
- | 출처: https:// | ||
- | |||
- | ===== 서버들 ===== | ||
- | 내 nginx 설정 | ||
- | < | ||
- | upstream php-handler { | ||
- | server 127.0.0.1: | ||
- | } | ||
- | |||
- | server { | ||
- | listen 80; | ||
- | server_name 192.168.1.131; | ||
- | |||
- | # Add headers to serve security related headers | ||
- | add_header X-Content-Type-Options nosniff; | ||
- | add_header X-XSS-Protection "1; mode=block"; | ||
- | add_header X-Robots-Tag none; | ||
- | add_header X-Download-Options noopen; | ||
- | add_header X-Permitted-Cross-Domain-Policies none; | ||
- | |||
- | #This header is already set in PHP, so it is commented out here. | ||
- | #add_header X-Frame-Options " | ||
- | |||
- | # Path to the root of your installation | ||
- | root / | ||
- | |||
- | location = /robots.txt { | ||
- | allow all; | ||
- | log_not_found off; | ||
- | access_log off; | ||
- | } | ||
- | |||
- | # The following 2 rules are only needed for the user_webfinger app. | ||
- | # Uncomment it if you're planning to use this app. | ||
- | #rewrite ^/ | ||
- | #rewrite ^/ | ||
- | # last; | ||
- | |||
- | location = / | ||
- | return 301 $scheme:// | ||
- | } | ||
- | location = / | ||
- | | ||
- | } | ||
- | |||
- | location ~ / | ||
- | allow all; | ||
- | } | ||
- | |||
- | # set max upload size | ||
- | client_max_body_size 512M; | ||
- | fastcgi_buffers 64 4K; | ||
- | |||
- | # Disable gzip to avoid the removal of the ETag header | ||
- | gzip off; | ||
- | |||
- | # Uncomment if your server is build with the ngx_pagespeed module | ||
- | # This module is currently not supported. | ||
- | #pagespeed off; | ||
- | |||
- | error_page 403 / | ||
- | error_page 404 / | ||
- | |||
- | location / { | ||
- | | ||
- | } | ||
- | |||
- | location ~ ^/ | ||
- | deny all; | ||
- | } | ||
- | location ~ ^/ | ||
- | deny all; | ||
- | } | ||
- | |||
- | location ~ ^/ | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | # | ||
- | | ||
- | | ||
- | | ||
- | # | ||
- | # | ||
- | | ||
- | | ||
- | } | ||
- | |||
- | location ~ ^/ | ||
- | | ||
- | index index.php; | ||
- | } | ||
- | |||
- | # Adding the cache control header for js and css files | ||
- | # Make sure it is BELOW the PHP block | ||
- | location ~* \.(?: | ||
- | try_files $uri / | ||
- | add_header Cache-Control " | ||
- | # Add headers to serve security related headers (It is intended to | ||
- | # have those duplicated to the ones above) | ||
- | add_header X-Content-Type-Options nosniff; | ||
- | add_header X-XSS-Protection "1; mode=block"; | ||
- | add_header X-Robots-Tag none; | ||
- | add_header X-Download-Options noopen; | ||
- | add_header X-Permitted-Cross-Domain-Policies none; | ||
- | # Optional: Don't log access to assets | ||
- | access_log off; | ||
- | } | ||
- | |||
- | | ||
- | try_files $uri / | ||
- | # Optional: Don't log access to other assets | ||
- | access_log off; | ||
- | } | ||
- | } | ||
- | |||
- | </ | ||
- | ===== 데이터 옮기기 ===== | ||
- | [[https:// | ||
- | |||
- | < | ||
- | 1. sudo -u www-data php / | ||
- | 2. mkdir -p / | ||
- | 3. cp -a / | ||
- | 4. chown -R www-data: | ||
- | 5. nano / | ||
- | ' | ||
- | 6. mysqldump -u< | ||
- | 7. Adjust " | ||
- | mysql -u< | ||
- | //enter mysql root password, then within mysql console: | ||
- | use < | ||
- | update oc_storages set id=' | ||
- | quit; | ||
- | 8. sudo -u www-data php / | ||
- | </ | ||
- | |||
- | ===== Redis ===== | ||
- | 기초적인 세팅: [[https:// | ||
- | |||
- | redis 쓸 때 selinux가 진짜 그지같이 군다. | ||
- | |||
- | redis 실행: [[https:// | ||
- | |||
- | 유닉스소켓으로 연결할 때: [[https:// | ||
- | |||
- | 아 그냥 selinux 끌까 ㅠ | ||
- | |||
- | ===== 삼바 연결시 ===== | ||
- | 자동 리스캔 [[https:// | ||
- | |||
- | Recon [[https:// | ||
- | ===== 기타 ===== | ||
- | < | ||
- | rsync -azvh --progress / | ||
- | </ | ||
- | 현재 rsync가 옮기는 거 보기 | ||
- | < | ||
- | lsof -ad3-999 -c rsync | ||
- | </ |