LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE
User Name
Password
SUSE / openSUSE This Forum is for the discussion of Suse Linux.

Notices


Reply
  Search this Thread
Old 10-31-2016, 10:41 AM   #1
redssr
Member
 
Registered: Oct 2013
Location: Dist Nasik MH State Country India
Distribution: Linux
Posts: 111

Rep: Reputation: Disabled
symlink not allowed


Dear Experts,

I had one opensuse 13.2 server. I am trying to access a website with symlink, but i gets below error in apache logs,

Code:
[core:error] [pid 1337] [client 192.168.1.101:46119] AH00037: Symbolic link not allowed or link target not accessible: /srv/www, referer: http://192.168.1.102/owncloud/
I had below configurations

Code:
linux:~ # rpm -qa|grep apache
apache2-2.4.10-28.1.x86_64
apache2-prefork-2.4.10-28.1.x86_64
apache2-mod_php5-5.6.1-36.1.x86_64
apache2-mod_dnssd-0.6-22.2.1.x86_64
owncloud-config-apache-8.2.1-1.1.noarch
apache2-utils-2.4.10-28.1.x86_64
apache2-example-pages-2.4.10-28.1.x86_64
my server config files

Code:
linux:~ # cat /etc/apache2/default-server.conf
DocumentRoot "/srv/www/htdocs"
<Directory "/srv/www/htdocs">
        Options +FollowSymlinks +Multiviews
        AllowOverride All
        Require all granted
</Directory>

Alias /icons/ "/usr/share/apache2/icons/"

<Directory "/usr/share/apache2/icons">
        Options Indexes MultiViews
        AllowOverride None
        Require all granted
</Directory>

ScriptAlias /cgi-bin/ "/srv/www/cgi-bin/"

<Directory "/srv/www/cgi-bin">
        AllowOverride None
        Options +ExecCGI -Includes
        Require all granted
</Directory>

<IfModule mod_userdir.c>
        UserDir public_html
        Include /etc/apache2/mod_userdir.conf
</IfModule>


IncludeOptional /etc/apache2/conf.d/*.conf

IncludeOptional /etc/apache2/conf.d/apache2-manual?conf

my vhostfile
linux:~ # cat /etc/apache2/conf.d/owncloud.conf
Alias /owncloud "/srv/www/htdocs/owncloud/"

<Directory "/srv/www/htdocs/owncloud">
    Options +FollowSymLinks +Multiviews
    AllowOverride All

    <IfModule mod_dav.c>
      Dav off
    </IfModule>

    SetEnv HOME /srv/www/htdocs/owncloud
    SetEnv HTTP_HOME /srv/www/htdocs/owncloud


</Directory>

<Directory "/srv/www/htdocs/owncloud/data/">
  # just in case if .htaccess gets disabled
  Require all denied
</Directory>

linux:~ # ls -lrth /srv/
total 4.0K
drwxr-xr-x 2 root root 4.0K Sep 25  2014 ftp
lrwxrwxrwx 1 root root    9 Oct 31 15:18 www -> /ssr/www/
Any replies will be appreciable
 
Old 10-31-2016, 01:10 PM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,634

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by redssr View Post
Dear Experts,
I had one opensuse 13.2 server. I am trying to access a website with symlink, but i gets below error in apache logs,
Code:
[core:error] [pid 1337] [client 192.168.1.101:46119] AH00037: Symbolic link not allowed or link target not accessible: /srv/www, referer: http://192.168.1.102/owncloud/
my server config files
Code:
linux:~ # cat /etc/apache2/default-server.conf
DocumentRoot "/srv/www/htdocs"
<Directory "/srv/www/htdocs">
        Options +FollowSymlinks +Multiviews
        AllowOverride All
        Require all granted
</Directory>
A few things, and you may have already tried them:
  • Did you restart apache after making this change? If not...try that first. You *MUST* restart Apache after making config file changes, before they will take effect.
  • Things are case-sensitive....it should be "MultiViews" not "Multiviews"
  • Try specifying the options without the + signs.
 
Old 10-31-2016, 01:23 PM   #3
gda
Member
 
Registered: Oct 2015
Posts: 130

Rep: Reputation: 27
Maybe check also the permissions of the symbolic link target and be sure the apache user/group has all the needed accesses.
 
1 members found this post helpful.
Old 11-01-2016, 05:35 AM   #4
redssr
Member
 
Registered: Oct 2013
Location: Dist Nasik MH State Country India
Distribution: Linux
Posts: 111

Original Poster
Rep: Reputation: Disabled
Dear gda,

Thanks for the reply, sorry i was forgot to mention same in my previous posts. The permissions are correct.

Code:
linux:~ # ls -lrth /ssr
total 4.0K
drwxr-xr-x 4 wwwrun www 4.0K Dec 13  2015 www
linux:~ # ls -lrth /ssr/www/
total 8.0K
drwxr-xr-x 2 wwwrun www 4.0K Sep 25  2014 cgi-bin
drwxr-xr-x 5 wwwrun www 4.0K Dec 13  2015 htdocs
linux:~ # ls -lrth /ssr/www/htdocs/owncloud/
total 200K
-rw-r--r--  1 wwwrun www  34K Nov 17  2015 COPYING-AGPL
-rw-r--r--  1 wwwrun www 1.8K Nov 17  2015 status.php
-rw-r--r--  1 wwwrun www 2.9K Nov 17  2015 public.php
-rwxr-xr-x  1 wwwrun www  283 Nov 17  2015 occ
-rw-r--r--  1 wwwrun www 2.0K Nov 17  2015 index.php
-rw-r--r--  1 wwwrun www  179 Nov 17  2015 index.html
-rw-r--r--  1 wwwrun www 2.5K Nov 17  2015 console.php
-rw-r--r--  1 wwwrun www 4.5K Nov 17  2015 remote.php
-rw-r--r--  1 wwwrun www  24K Nov 17  2015 db_structure.xml
-rw-r--r--  1 wwwrun www 5.3K Nov 17  2015 cron.php
-rw-r--r--  1 wwwrun www  477 Nov 17  2015 AUTHORS
-rw-r--r--  1 wwwrun www  233 Nov 17  2015 version.php
-rw-r--r--  1 wwwrun www   26 Nov 17  2015 robots.txt
-rw-r--r--  1 wwwrun www 7.8K Nov 17  2015 README.packaging
-rw-r--r--  1 wwwrun www 1.4K Nov 17  2015 README.SELinux
-rw-r--r--  1 wwwrun www  26K Nov 17  2015 README
drwxrwxr-x  2 wwwrun www 4.0K Nov 17  2015 assets
drwxr-xr-x 19 wwwrun www 4.0K Dec  6  2015 core
drwxrwxr-x 28 wwwrun www 4.0K Dec 13  2015 3rdparty
drwxr-xr-x  6 wwwrun www 4.0K Dec 13  2015 lib
drwxr-xr-x  2 wwwrun www 4.0K Dec 13  2015 ocs-provider
drwxr-xr-x  2 wwwrun www 4.0K Dec 13  2015 ocs
drwxr-xr-x  3 wwwrun www 4.0K Dec 13  2015 resources
drwxrwxr-x  3 wwwrun www 4.0K Dec 13  2015 themes
drwxr-xr-x 13 wwwrun www 4.0K Dec 13  2015 settings
drwxrwxr-x 21 wwwrun www 4.0K Dec 13  2015 apps
drwxrwx---  3 wwwrun www 4.0K Oct 31 15:22 data
drwxrwxr-x  2 wwwrun www 4.0K Nov  1 10:28 config
Regards,

Redssr
 
Old 11-01-2016, 07:38 AM   #5
ember1205
Member
 
Registered: Oct 2014
Posts: 176

Rep: Reputation: 16
Please post the output of EACH of the following:

Code:
ls -l /
Code:
ls -l /srv
Code:
ls -l /www
Code:
ls -l /ssr
 
Old 11-01-2016, 07:45 AM   #6
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,634

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by redssr View Post
Dear gda,
Thanks for the reply, sorry i was forgot to mention same in my previous posts. The permissions are correct.
And you're *VERY* welcome for what I posted as well.....did you check/try THOSE????
 
Old 11-01-2016, 07:59 AM   #7
redssr
Member
 
Registered: Oct 2013
Location: Dist Nasik MH State Country India
Distribution: Linux
Posts: 111

Original Poster
Rep: Reputation: Disabled
Hello,

ember1205 and TB0ne,

I had already posted the outputs of all your cmds except /. please find below

Code:
linux:/ # ls -lrth /
total 88K
drwxr-xr-x  2 root   root 4.0K Sep 25  2014 home
drwxr-xr-x  2 root   root 4.0K Sep 25  2014 selinux
drwxr-xr-x  2 root   root 4.0K Sep 25  2014 mnt
drwxr-xr-x 13 root   root 4.0K Dec 13  2015 usr
drwxr-xr-x  5 root   root 4.0K Dec 13  2015 lib64
drwxr-xr-x  8 root   root 4.0K Dec 13  2015 lib
drwxr-xr-x  2 root   root 4.0K Dec 13  2015 bin
drwxr-xr-x  4 root   root 4.0K Dec 13  2015 opt
-rw-r--r--  1 root   root 2.7K Dec 13  2015 bootincluded_archives.filelist
drwx------  2 root   root  16K Dec 13  2015 lost+found
drwxr-xr-x  2 root   root 4.0K Dec 13  2015 sbin
drwxr-xr-x  5 root   root 4.0K Dec 13  2015 boot
drwxr-xr-x  2 root   root 4.0K Dec 13  2015 studio
drwxr-xr-x 12 root   root 4.0K Oct 31 14:30 var
drwxr-xr-x  3 wwwrun www  4.0K Oct 31 15:17 ssr
drwxr-xr-x  3 wwwrun www  4.0K Oct 31 15:18 srv
drwx------  5 root   root 4.0K Oct 31 15:25 root
drwxr-xr-x 17 root   root 3.6K Nov  1 12:53 dev
dr-xr-xr-x 98 root   root    0 Nov  1 12:53 proc
drwxr-xr-x 69 root   root 4.0K Nov  1 12:53 etc
drwxrwxrwt  8 root   root 4.0K Nov  1 12:53 tmp
drwxr-xr-x 16 root   root  440 Nov  1 12:53 run
dr-xr-xr-x 12 root   root    0 Nov  1 12:53 sys

linux:/ # ls -lrth /srv/
total 4.0K
drwxr-xr-x 2 wwwrun www 4.0K Sep 25  2014 ftp
lrwxrwxrwx 1 wwwrun www    9 Oct 31 15:18 www -> /ssr/www
Regards,

Redssr
 
Old 11-01-2016, 08:15 AM   #8
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,634

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by redssr View Post
Hello,
ember1205 and TB0ne,

I had already posted the outputs of all your cmds except /. please find below
Except I had not GIVEN YOU ANY COMMANDS....did you not read/understand my post??? Again:
  • Did you restart apache after making this change? If not...try that first. You *MUST* restart Apache after making config file changes, before they will take effect.
  • Things are case-sensitive....it should be "MultiViews" not "Multiviews"
  • Try specifying the options without the + signs.
  • Additional from yesterday: did you check the error logs for Apache after you RESTARTED IT with the mis-cased option??
There are no 'commands' to try, and nothing to do with permissions.
 
Old 11-01-2016, 08:46 AM   #9
redssr
Member
 
Registered: Oct 2013
Location: Dist Nasik MH State Country India
Distribution: Linux
Posts: 111

Original Poster
Rep: Reputation: Disabled
Dear TBOne,

I did changes suggested by you now
1) Multiviews to MultiViews
2) Removed + sign
3) Most imp (I was doing everytime after making changes in config files)
3a) Check syntax by cmd apache2ctl configtest. If its results me syntax ok then
3b) /etc/init.d/apache2 restart

Code:
but still no effect
Lastly. I know that you had not given me any cmds but ember1205 asked me to post them which i already posted before his reply.

I replied to both of you. I apologies if it got personally to you.

Regards,

Redssr

Last edited by redssr; 11-01-2016 at 08:59 AM.
 
Old 11-01-2016, 09:34 AM   #10
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,634

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by redssr View Post
Dear TBOne,

I did changes suggested by you now
1) Multiviews to MultiViews
2) Removed + sign
3) Most imp (I was doing everytime after making changes in config files)
3a) Check syntax by cmd apache2ctl configtest. If its results me syntax ok then
3b) /etc/init.d/apache2 restart

but still no effect
Interesting...did you try "service apache2 restart", instead of the init.d command you posted? And did you actually check the error logs (typically in /var/log/apache2/error_log). I would run:
Code:
cat /dev/null > /var/log/apache2/error_log
service apache2 restart
So I could see a 'fresh' (and small) set of data from the apache startup. You could also try putting "Options All" as a test, and see if symlinks work for you then. If so, there may be a typo....which I see in your original post. As said before...those options are case sensitive, and from the Apache sample config file, it should be "FollowSymLinks"...you have a lower-case "l".
 
Old 11-01-2016, 09:42 AM   #11
redssr
Member
 
Registered: Oct 2013
Location: Dist Nasik MH State Country India
Distribution: Linux
Posts: 111

Original Poster
Rep: Reputation: Disabled
Dear TBOne,

Kindly find the output of error log

Code:
linux:~ # cat /dev/null > /var/log/apache2/error_log
linux:~ # service apache2 restart
linux:~ # cat  /var/log/apache2/error_log
[Tue Nov 01 14:37:02.962836 2016] [mpm_prefork:notice] [pid 1084] AH00170: caught SIGWINCH, shutting down gracefully
AH00557: httpd2-prefork: apr_sockaddr_info_get() failed for linux
AH00558: httpd2-prefork: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message
[Tue Nov 01 14:37:03.134143 2016] [ssl:warn] [pid 1194] AH01873: Init: Session Cache is not configured [hint: SSLSessionCache]
[Tue Nov 01 14:37:03.139504 2016] [mpm_prefork:notice] [pid 1194] AH00163: Apache/2.4.10 (Linux/SUSE) PHP/5.6.1 OpenSSL/1.0.1k-fips configured -- resuming normal operations
[Tue Nov 01 14:37:03.139579 2016] [core:notice] [pid 1194] AH00094: Command line: '/usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf -D SYSTEMD -D FOREGROUND'
[Tue Nov 01 14:45:01.705603 2016] [core:error] [pid 1269] [client 192.168.1.101:52003] AH00037: Symbolic link not allowed or link target not accessible: /srv/www
[Tue Nov 01 14:45:01.759908 2016] [core:error] [pid 1269] [client 192.168.1.101:52003] AH00037: Symbolic link not allowed or link target not accessible: /srv/www
[Tue Nov 01 14:45:01.770377 2016] [core:error] [pid 1269] [client 192.168.1.101:52003] AH00037: Symbolic link not allowed or link target not accessible: /srv/www
Code:
Please note: These logs are after changing the Options to All from previous
Regards,

Redssr

Last edited by redssr; 11-01-2016 at 09:55 AM.
 
Old 11-01-2016, 09:56 AM   #12
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,634

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by redssr View Post
Dear TBOne,
Kindly find the output of error log
Code:
linux:~ # cat /dev/null > /var/log/apache2/error_log
linux:~ # service apache2 restart
linux:~ # cat  /var/log/apache2/error_log
[Tue Nov 01 14:37:02.962836 2016] [mpm_prefork:notice] [pid 1084] AH00170: caught SIGWINCH, shutting down gracefully
AH00557: httpd2-prefork: apr_sockaddr_info_get() failed for linux
AH00558: httpd2-prefork: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message
[Tue Nov 01 14:37:03.134143 2016] [ssl:warn] [pid 1194] AH01873: Init: Session Cache is not configured [hint: SSLSessionCache]
[Tue Nov 01 14:37:03.139504 2016] [mpm_prefork:notice] [pid 1194] AH00163: Apache/2.4.10 (Linux/SUSE) PHP/5.6.1 OpenSSL/1.0.1k-fips configured -- resuming normal operations
[Tue Nov 01 14:37:03.139579 2016] [core:notice] [pid 1194] AH00094: Command line: '/usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf -D SYSTEMD -D FOREGROUND'
[Tue Nov 01 14:45:01.705603 2016] [core:error] [pid 1269] [client 192.168.1.101:52003] AH00037: Symbolic link not allowed or link target not accessible: /srv/www
[Tue Nov 01 14:45:01.759908 2016] [core:error] [pid 1269] [client 192.168.1.101:52003] AH00037: Symbolic link not allowed or link target not accessible: /srv/www
[Tue Nov 01 14:45:01.770377 2016] [core:error] [pid 1269] [client 192.168.1.101:52003] AH00037: Symbolic link not allowed or link target not accessible: /srv/www
Ok...and did you read ALL of my last post??? Did you see the part where I suggested you use "All", and that you check the FollowSymLinks directive, because you don't have the right case??? Might want to do/try the things suggested, instead of posting back one thing at a time.
 
Old 11-01-2016, 10:15 AM   #13
redssr
Member
 
Registered: Oct 2013
Location: Dist Nasik MH State Country India
Distribution: Linux
Posts: 111

Original Poster
Rep: Reputation: Disabled
Dear TBOne,

These logs are after changing Options to All from my previous Options

Code:
linux:~ # cat /etc/apache2/conf.d/owncloud.conf
Alias /owncloud "/srv/www/htdocs/owncloud/"

<Directory "/srv/www/htdocs/owncloud">
    Options All
    AllowOverride All

    <IfModule mod_dav.c>
      Dav off
    </IfModule>

    SetEnv HOME /srv/www/htdocs/owncloud
    SetEnv HTTP_HOME /srv/www/htdocs/owncloud


</Directory>

<Directory "/srv/www/htdocs/owncloud/data/">
  # just in case if .htaccess gets disabled
  Require all denied
</Directory>

## Please enable this manually, if needed. See also
## https://doc.owncloud.org/server/8.2/admin_manual/issues/index.html#apple-ios
# Redirect 301 /.well-known/carddav /owncloud/remote.php/carddav
# Redirect 301 /.well-known/caldav  /owncloud/remote.php/caldav

<Directory "/srv/www>
    Options All
    AllowOverride All

    <IfModule mod_dav.c>
      Dav off
    </IfModule>
</Directory>
 
Old 11-03-2016, 10:13 AM   #14
redssr
Member
 
Registered: Oct 2013
Location: Dist Nasik MH State Country India
Distribution: Linux
Posts: 111

Original Poster
Rep: Reputation: Disabled
Hello,

Experts,

I also given 777 permission to www directory, but still same error.

Regards

Redssr
 
Old 11-03-2016, 01:05 PM   #15
ember1205
Member
 
Registered: Oct 2014
Posts: 176

Rep: Reputation: 16
Please provide output of ALL of the directories that I asked for earlier. You believe that you already have, but you have not - you have yet to provide output of

Code:
ls -l /srv
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] symlink to symlink confusion, Reprovo Linux - Newbie 2 11-18-2014 02:17 PM
Method Not Allowed: The requested method POST is not allowed for the URL /writedhcp.p WiWa Linux - Networking 15 01-06-2011 01:20 PM
Question How to get stat() of symlink and not of target of symlink ? ronbarak Programming 3 11-08-2010 12:14 PM
Tracking user logins that was allowed and not allowed eswanepoel Linux - Security 3 08-02-2006 04:37 AM
SlackWare :Method Not Allowed The requested method POST is not allowed for the URL slack31337 Linux - Software 0 04-08-2006 06:09 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE

All times are GMT -5. The time now is 01:44 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration