Comment to 'HTTP Error 404.0 - Not Found ,after installation, click any link will get this error'
  • HI, if your UNA CMS install isn’t routing requests correctly (404 errors, service worker issues, blank pages), follow this checklist step by step:

    Check Official Requirements

    Verify that your server meets UNA’s requirements: 👉 UNA CMS Requirements Overview

    Check Nginx & PHP-FPM Service Status

    sudo systemctl status nginx
    sudo nginx -t
    sudo systemctl status php8.1-fpm
    

    If any service isn’t running, restart them:

    sudo systemctl restart nginx
    sudo systemctl restart php8.1-fpm
    

    Check Nginx Error Logs

    sudo tail -n 100 /var/log/nginx/error.log
    

    Look for errors like:

    open() "/var/www/html/your/path" failed (2: No such file or directory)

    Check PHP-FPM Logs

    sudo tail -n 100 /var/log/php8.1-fpm.log
    

    If you have custom pool configs, check those log paths too.

    Verify Nginx Site Configuration

    Ensure your Nginx config has the correct routing requests should fall back to index.php. Example config: 👉 UNA Docker Nginx Config Example

    Check if you have correctly set UNA root in nginx config

    cat /etc/nginx/sites-enabled/yoursite.conf
    

    if it is not correct change it

    vim /etc/nginx/sites-enabled/yoursite.conf
    

    After any edits, reload Nginx:

    sudo systemctl reload nginx
    

    or

    sudo service nginx reload
    

    Clear UNA Cache

    Inside your UNA directory:

    sudo rm -rf ./cache/bx*
    sudo rm -rf ./cache/db*
    sudo rm -rf ./cache/lang*
    sudo rm -rf ./cache_public/bx*
    sudo rm -rf ./cache_public/less*
    

    Then check:

    ls cache
    ls cache_public
    

    Delete everything except .htaccess files.

    Check UNA Logs

    cd /path/to/una/
    ls logs/
    cat logs/any_una.log
    

    Check File & Directory Permissions

    Ensure the web server can write to essential folders:

    so..

    cd una
    

    and then:

    sudo chown -R www-data:www-data .
    sudo find ./ -type d -exec chmod 755 {} \;
    sudo find ./ -type f -exec chmod 644 {} \;
    # Set execute permissions for ffmpeg.exe
    sudo chmod +x ./plugins/ffmpeg/ffmpeg.exe
    

    Check MySQL/MariaDB Logs

    For MySQL:

    sudo tail -n 100 /var/log/mysql/error.log
    

    For MariaDB:

    sudo tail -n 100 /var/log/mysql/mariadb.log
    

    Look for errors like:

    • Access denied for user 'una_user'@'localhost'
    • Unknown database 'una_db'

    Restart All Services

    sudo systemctl restart nginx
    sudo systemctl restart php8.1-fpm
    sudo systemctl restart mysql
    

    Important Note:

    • Never post sensitive details like site URLs, usernames, or passwords publicly.
    • If you're stuck, share your Nginx config and error log snippets (with personal info removed) for community help.

    HAPPY CODING!

    • Thanks @Romulus , your post helped a lot!

      Cheers!

      • well I forgot something

        # Set execute permissions for ffmpeg.exe
        sudo chmod +x ./plugins/ffmpeg/ffmpeg.exe
        
        • Also to correctly process video and photo files, make sure you specify your domain in the host. Here’s how to add a host to your server in Linux:

          Steps to Add a Host in Linux

          1. Open the Terminal: Access your Linux terminal.
          2. Edit the Hosts File: Use a text editor to open the /etc/hosts file. You will need superuser (root) privileges to edit this file. You can use nanovim, or any text editor of your choice. Here’s an example using nano:
          sudo nano /etc/hosts
          
          1. Add Your Host: Once you have the file open, you can add a new line for your domain. The format is:
          <IP_address>    <hostname>
          
          1. For example, if you want to add a host for the domain www.example.com pointing to the IP address 192.168.1.100, you would add the following line:
          192.168.1.100    www.example.com
          
          1. Save the Changes: After you have added the necessary line, save the changes. If you are using nano, you can do this by pressing CTRL + X, then Y to confirm changes, and Enter to exit.
          2. Test the Configuration: To ensure that your new host is properly configured, you can use the ping command to check if it resolves correctly:
          ping www.example.com
          
          1. If everything is set up correctly, you should see responses from the specified IP address.

          Additional Steps

          • Restart Services: In some cases, you may need to restart certain services or your network for the changes to take effect, but typically changes to the /etc/hosts file take effect immediately.
          • DNS Configuration: If you are running a more complex setup or need external accessibility, consider configuring DNS records through your domain registrar or DNS provider instead.