CHUẨN BỊ
Cài bằng script: https://www.horilla.com/docs/installation-using-shell-script/
Ubuntu 22
Filezilla để upload file script:
Tạo thư mục usr
Up file script lên:
Set quyền:
chmod +x horilla_install_ubuntu.sh
Chạy script:
./horilla_install_ubuntu.sh
CHẠY VỚI BẤT KỲ IP
Cài xong Horilla chỉ chạy với địa chỉ localhost: http://127.0.0.1:8000
Để chạy được với IP hoặc tên miền cần chỉnh sửa file setting.py, cụ thể là add thêm IP và tên miền vào mục ALLOWED_HOST và CSRF_TRUSTED_ORIGINS như minh họa bên dưới:
Sau đó khởi động lại Horilla bằng lệnhpython manage.py runserver 0.0.0.0:8000
CÀI ĐẶT LDAP
cd /path/to/horilla
source venv/bin/activate
pip install django-auth-ldap
LỖI GỬI MAIL
Nguyên nhân do chưa copy static files vào cache
Chạy lệnh:
python3 manage.py collectstatic
LỖI TẠO COMPANY BỊ ĐƠ:
Kiểm tra log trong Django (https://ipaddress:8000/admin) thì thấy thiếu quyền ghi dữ liệu:
Chạy lệnh kiểm tra user nào đang dùng:
ps aux | grep gunicorn
Sẽ thấy user ở cột thứ 1, phía sau có dãy 12345....
Set quyền cho user đó:
sudo chown -R systemadmin /home/usr/horilla/media
sudo chmod -R 755 /home/usr/horilla/media
Comments
Post a Comment