Web目录是所有应用程序的公共和静态文件的归属。 包括图像,样式表和JavaScript文件。 这也是前线pipe制员的生活场所。
所以问题是当我安装和设置xampp我的web目录是:
xampp\htdocs
我想设置它为:
xampp\htdocs\myproject\web
怎么做? 现在当我在我的浏览器中input地址: http://localhost/
我inputxampp\htdocs
目录
我想在我的浏览器中input地址: http://localhost/
并inputxampp\htdocs\myproject\web
目录
您可以通过单击(在xampp控制面板中) apache/conf/httpd.conf
来更改Apaches httpd.conf,并调整DocumentRoot
的条目和相应的Directory
条目。 只需Ctrl + F “htdocs”并将条目更改为新路径。
现在找到<Directory>标签并将其更改为<Directory“C:/ xampp / htdocs / myproject / web”>
重新启动你的Apache
您可以在打开XAMP控制面板时更改端口,请执行以下步骤:
httpd.conf
,会打开一个文本文件 listen:80
, listen:80
替换listen:8080
和 一旦完成,你将能够启动你的本地服务器。
好吧,你们不会相信我有多容易,所以我在YouTube上放了一段视频,告诉你[ 点击这里 ]
现在,步骤:
DocumentRoot "C:/xampp/htdocs" <Directory "C:/xampp/htdocs">
那两条线|| C:/ xampp / htdocs ==当前位置为root || 用任何你想要的位置改变C:/ xampp / htdocs
我将我的htdocs文件夹从C:\ xampp \ htdocs移动到D:\ htdocs,而无需编辑Apache配置文件(httpd.conf)。
步骤1)将C:\xampp\htdocs
文件夹移动到D:\htdocs
步骤2)使用mklink命令在链接到D:\ htdocs的C:\ xampp \ htdocs中创建一个符号链接。
D:\>mklink /JC:\xampp\htdocs D:\htdocs Junction created for C:\xampp\htdocs <<===>> D:\htdocs D:\>
步骤3)完成!
如果有人更喜欢简单的解决方案,特别是在Linux(例如Ubuntu)上,一个非常简单的方法是创建一个到htdocs文件夹中的目标文件夹的符号链接。 例如,如果我希望能够从名为“/ home / some / projects / testserver /”的文件夹提供文件,并且我的htdocs位于“/ opt / lampp / htdocs /”中。 只要创建一个象这样的符号链接:
ln -s /home/some/projects/testserver /opt/lampp/htdocs/testserver
符号链接的命令如下所示: ln -s target source
where,
target - The existing file/directory you would like to link TO. source - The file/folder to be created, copying the contents of the target. The LINK itself.
有关更多帮助,请参阅ln –help源: 在Ubuntu中创建符号链接
这就完成了。 只要访问http:// localhost / testserver /其实你甚至不需要重启你的服务器。
XAMP上Bitnami(这是唯一的选择现在)apache设置是在bitnami.conf在c:\ Bitnami \ wampstack-XXX \ apache2 \ conf \ bitnami \或东西。 httpd.conf现在不影响任何东西。 闻起来像一个谷歌风格诱饵;)