tengine icon indicating copy to clipboard operation
tengine copied to clipboard

could not open error log file: open() "/usr/sbin/nginx/logs/error.log" failed (20: Not a directory)

Open minibear0523 opened this issue 9 years ago • 1 comments

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)

minibear0523 avatar Oct 05 '15 01:10 minibear0523

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?

ljluestc avatar Jun 20 '23 02:06 ljluestc