AH00037: Symbolic link not allowed or link target not accessible: /var/www/html/flaskproject

0

<VirtualHost *:80>

    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/html
    WSGIDaemonProcess flaskproject threads=5
    WSGIScriptAlias / /var/www/html/flaskproject/app.wsgi

    <Directory flaskproject>
        WSGIProcessGroup flaskproject
        WSGIApplicationGroup %{GLOBAL}
        Order deny,allow
        Allow from all
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

I have given all this... stil in the error log file it is showing: Symbolic link not allowed or link target not accessible: /var/www/html/flaskproject i am using ubuntu instance, i have also tried changing the permission of folder using chmod 777

AV
asked 8 months ago3173 views
1 Answer
0

Hello AV,

The error message you're encountering, "Symbolic link not allowed or link target not accessible," indicates that Apache is having trouble with symbolic links in your configuration. This error typically occurs when Apache is configured to follow symbolic links, but the target of the symbolic link is not accessible due to permission issues or the target does not exist.

To resolve this issue, you can take the following steps:

  1. Check the Symbolic Link:

    Ensure that the symbolic link /var/www/html/flaskproject points to a valid directory or file. You can check the target of the symbolic link using the ls command:

    ls -l /var/www/html/flaskproject

    Verify that the target exists and has the necessary permissions.

  2. Permissions:

    Make sure that both the symbolic link and the target directory have appropriate permissions for Apache to access. You can try setting the permissions as follows:

    sudo chmod -R 755 /var/www/html/flaskproject

    Ensure that the user running the Apache process (www-data on Ubuntu) has read and execute permissions on both the symbolic link and the target.

  3. Check Apache Configuration:

    Ensure that the Apache configuration allows symbolic links. In your virtual host configuration, you can add the Options directive to explicitly allow symbolic links:

    <Directory /var/www/html/flaskproject>
        Options +FollowSymLinks
        # ... other configuration ...
    </Directory>
  4. Check SELinux (if applicable):

    If your server is using SELinux, it may be restricting Apache from accessing symbolic links. You can use the chcon command to change the security context of the symbolic link:

    sudo chcon -R -h -t httpd_sys_content_t /var/www/html/flaskproject
  5. Check Target Permissions:

    If the target of the symbolic link is a directory, ensure that Apache has read and execute permissions for that directory and its contents.

  6. Restart Apache:

    After making any changes, restart the Apache service to apply the configuration:

    sudo systemctl restart apache2
  7. Logs:

    Check Apache error logs for any additional information about the issue:

    sudo tail -f /var/log/apache2/error.log

By following these steps and ensuring the correct permissions and configurations, you should be able to resolve the "Symbolic link not allowed or link target not accessible" issue in your Apache setup.

Please give a thumbs up if my suggestion helps

profile picture
answered 8 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions