Apache的别名VS符号链接 [英] apache alias vs symbolic link
问题描述
当与Apache在UNIX系统上工作,
When working with apache on a unix system,
如果你的文件系统有图标的/ home / ME /网络/图标
If your file system has icons in /home/me/web/icons
和你想调用的URL http://www.me.com/icons /myicon.jpg
例如,
and you want the browser be able to display them when calling the url http://www.me.com/icons/myicon.jpg for example,
那么你至少有2个解决方案:
then you have at least 2 solutions :
别名(别名/图标/的/ home /网络/图标/)
alias ( Alias /icons/ /home/web/icons/ )
符号链接(LN -s /家庭/网络/图标/家庭/ ME /网络/网络/图标)
symbolic links ( ln -s /home/web/icons /home/me/web/www/icons )
在我看来,使用Apache的别名是最好的选择,因为我们确切地知道别名
通常会在/ etc / apache2的目录(所以这是一个地方看的情况下应用
增长),但我会很高兴知道你用什么解决方案?为什么?
It seems to me that using apache aliases is the best choice since we know exactly that aliases would normally be in the /etc/apache2 directory ( so that is just one place to look at in case the application grows ), but I would be pleased to know about what solution you use and why ?
推荐答案
使用别名一>在你的Apache httpd的过度使用符号链接有几个好处:
Using an Alias in your Apache httpd has several advantages over using a symbolic link:
- 符号链接需要一个额外的磁盘访问,以解决符号链接。
-
别名
适用于被Apache httpd的支持的所有平台。符号链接并不是所有的平台和文件系统的支持。 - 您的Apache httpd配置将工作在新系统上完全相同的方式,而无需创建文件系统中的符号链接。
- Symbolic links require an additional disk access to resolve the symbolic link.
Alias
works on all platforms supported by Apache httpd. Symbolic links are not supported by all platforms and filesystems.- Your Apache httpd configuration will work the exactly same way on a new system without the need to create symbolic links in your file system.
这篇关于Apache的别名VS符号链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!