markdown 使用符号链接从主目录运行站点

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了markdown 使用符号链接从主目录运行站点相关的知识,希望对你有一定的参考价值。


Create a symlink for each project to your home directory. Say your project is located at `~/projects/foo` and you want to have it located at /var/www/foo, run:

```bash
sudo ln -sT ~/www/magento2 /var/www/html/magento2
```
If your home directory has no execute bit (descend) set for other (for security reasons), change the group of it to www-data, but set the execute bit only (no read/write). Do the same for the ~/projects folder as it may contain other projects than www. (You don't need sudo if you have previously added your user to the www-data group.)

```bash
sudo chgrp www-data ~ ~/www
chmod 710 ~ ~/www
```
Set the group to www-data on `~/www/magento2` and allow the webserver to read and write to files and files+directories and descend into directories:

```bash
sudo chgrp www-data ~/www/magento2
find ~/www/magento2 -type f -exec chmod 660 {} \;
find ~/www/magento2 -type d -exec chmod 2770 {} \;
```
Even safer: use 640 and 2750 by default and manually chmod files and directories that need to be writable by the webserver user. The setgid bit should be added only if you want every newly created file in `~/www/magento2` to be accessible by the group.

From now on, you can access your site at `http://localhost/magento2` and edit your project files in `~/www/magento2`.

以上是关于markdown 使用符号链接从主目录运行站点的主要内容,如果未能解决你的问题,请参考以下文章

markdown Node Crawler用于查找站点上的所有域链接并对其运行功能

AWS Elastic Beanstalk Drupal 8 安装错误:未能创建符号链接“站点/默认/文件”:

书写博客: Markdown 语法讲解

Homebrew npm install:无法符号链接

在 Razor 中使用站点根目录相对链接

markdown 符号链接