linux – Symbolic Link和LAMPP htdocs

linux – Symbolic Link和LAMPP htdocs,第1张

概述我完成了这些步骤,以便在lampp htdocs之外使用symlink目录. $mkdir test$chmod 777 test//test is now in /home/Dropbox/test///I put an index.html with 777 perms in it.$cd /opt/lampp/htdocs/$sudo ln -s /home/Dropbox/tes 我完成了这些步骤,以便在lampp htdocs之外使用symlink目录.
$mkdir test$chmod 777 test//test is Now in /home/DropBox/test///I put an index.HTML with 777 perms in it.$cd /opt/lampp/htdocs/$sudo ln -s /home/DropBox/test/ /opt/lampp/htdocs/$USER//my user appears as symlink directory in htdocs.$/opt/lampp/lampp stop$/opt/lampp/lampp start//lampp is Now restarted

我键入localhost / myusername并得到404错误…找不到对象.

请注意,我可以在htdocs目录中创建常规目录和.HTML / .PHP文件,但我不能执行任何符号链接目录或.HTML / .PHP文件,它们不会加载.

谢谢你的输入!

httpd conf(仅涉及Symlinks的部分)

<Directory />    Options FollowSymlinks    AllowOverrIDe None    #XAMPP    #Order deny,allow    #Deny from all</Directory><Directory "/opt/lampp/htdocs/">    #    # Possible values for the Options directive are "None","All",# or any combination of:    #   Indexes Includes FollowSymlinks SymlinksifOwnerMatch ExecCGI multiviews    #    # Note that "multiviews" must be named *explicitly* --- "Options All"    # doesn't give it to you.    #    # The Options directive is both complicated and important.  Please see    # http://httpd.apache.org/docs/2.2/mod/core.HTML#options    # for more information.    #    #Options Indexes FollowSymlinks    # XAMPP    Options Indexes FollowSymlinks ExecCGI Includes    #    # AllowOverrIDe controls what directives may be placed in .htaccess files.    # It can be "All","None",or any combination of the keywords:    #   Options fileInfo AuthConfig limit    #    #AllowOverrIDe None    # since XAMPP 1.4:    AllowOverrIDe All    #    # Controls who can get stuff from this server.    #    Order allow,deny    Allow from all</Directory>

error_log中

$tail -f error_log [Fri Dec 23 13:55:50 2011] [error] [clIEnt 127.0.0.1] Symbolic link not allowed or link target not accessible: /opt/lampp/htdocs/*myusername*[Fri Dec 23 13:56:02 2011] [notice] caught SIGTERM,shutting down[Fri Dec 23 13:56:08 2011] [notice] suEXEC mechanism enabled (wrapper: /opt/lampp/bin/suexec)[Fri Dec 23 13:56:08 2011] [warn] RSA server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)[Fri Dec 23 13:56:08 2011] [warn] RSA server certificate Commonname (CN) `localhost' does NOT match server name!?[Fri Dec 23 13:56:08 2011] [notice] Digest: generating secret for digest authentication ...[Fri Dec 23 13:56:08 2011] [notice] Digest: done[Fri Dec 23 13:56:09 2011] [warn] RSA server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)[Fri Dec 23 13:56:09 2011] [warn] RSA server certificate Commonname (CN) `localhost' does NOT match server name!?[Fri Dec 23 13:56:09 2011] [notice] Apache/2.2.21 (Unix) DAV/2 mod_ssl/2.2.21 OpenSSL/1.0.0c PHP/5.3.8 mod_apreq2-20090110/2.7.1 mod_perl/2.0.5 Perl/v5.10.1 configured -- resuming normal operations

访问日志

$tail -f access_log 127.0.0.1 - - [23/Dec/2011:13:41:27 -0500] "GET /work http/1.1" 403 1111127.0.0.1 - - [23/Dec/2011:13:41:27 -0500] "GET /work http/1.1" 403 1111127.0.0.1 - - [23/Dec/2011:13:41:28 -0500] "GET /work http/1.1" 403 1111127.0.0.1 - - [23/Dec/2011:13:55:47 -0500] "GET / http/1.1" 302 -127.0.0.1 - - [23/Dec/2011:13:55:47 -0500] "GET /xampp/ http/1.1" 200 588127.0.0.1 - - [23/Dec/2011:13:55:47 -0500] "GET /xampp/head.PHP http/1.1" 200 1362127.0.0.1 - - [23/Dec/2011:13:55:47 -0500] "GET /xampp/navi.PHP http/1.1" 200 2290127.0.0.1 - - [23/Dec/2011:13:55:47 -0500] "GET /xampp/start.PHP http/1.1" 200 786127.0.0.1 - - [23/Dec/2011:13:55:47 -0500] "GET /favicon.ico http/1.1" 200 30894127.0.0.1 - - [23/Dec/2011:13:55:50 -0500] "GET /work http/1.1" 403 1111

/ opt / lampp / htdocs /的权限/

drwxr-xr-x 4 nobody root 4096 2011-12-23 13:32 htdocs

/ opt / lampp / htdocs / * myusername *的权限

lrwxrwxrwx 1 root root 39 2011-12-23 13:12 myusername

/ home / DropBox / test /的权限

drwxr-xr-x 2 work work 4096 2011-12-23 13:10 myusername

解决方法 这表明FollowSymlinks在节中不存在.这是一个例子,取自 here:
<Directory /usr/local/httpd/htdocs>Options Indexes FollowSymlinks</Directory>

等待验证apache配置(我认为你应该粘贴),这是最可能的答案.

编辑:阅读你对embobo的回复后,我去了我的服务器复制问题:

[Fri Dec 23 23:03:58 2011] [error] [clIEnt 192.168.15.20] Symbolic link not allowed or link target not accessible: /var/www/HTML/testsym

我建议在test的父级上进行以下设置

chmod go+x /home/DropBox

这样DropBox目录就可以拥有组和其他的执行权限.

总结

以上是内存溢出为你收集整理的linux – Symbolic Link和LAMPP htdocs全部内容,希望文章能够帮你解决linux – Symbolic Link和LAMPP htdocs所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/yw/1034074.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-24
下一篇 2022-05-24

发表评论

登录后才能评论

评论列表(0条)

保存