tengine
tengine copied to clipboard
could not open error log file: open() "/usr/sbin/nginx/logs/error.log" failed (20: Not a directory)
When I stop old nginx and start tengine, the error messages are below: [alert] could not open error log file: open() "/usr/sbin/nginx/logs/error.log" failed (20: Not a directory) [emerg] 5312#0: mkdir() "/usr/sbin/nginx/client_body_temp" failed (20: Not a directory)
TENGINE_USER="nginx"
# Specify the required directories
LOGS_DIR="/usr/sbin/nginx/logs"
CLIENT_TEMP_DIR="/usr/sbin/nginx/client_body_temp"
# Create the directories if they don't exist
if [ ! -d "$LOGS_DIR" ]; then
sudo mkdir -p "$LOGS_DIR"
fi
if [ ! -d "$CLIENT_TEMP_DIR" ]; then
sudo mkdir -p "$CLIENT_TEMP_DIR"
fi
# Adjust ownership and permissions
sudo chown -R $TENGINE_USER:$TENGINE_USER "$LOGS_DIR"
sudo chmod -R 755 "$LOGS_DIR"
sudo chown -R $TENGINE_USER:$TENGINE_USER "$CLIENT_TEMP_DIR"
sudo chmod -R 755 "$CLIENT_TEMP_DIR"
sudo systemctl restart tengine
Have you tried some basic simple debugging scripts to verify?