简体   繁体   English

在ubuntu上使用灯泡堆栈是否需要虚拟主机配置和启用站点?

[英]Is virtual host configuration and enabling sites necessary with lamp stack on ubuntu?

In windows with 'Wamp Server' installed, to create a new project for development I just create a new directory in 'www' (eg www/myproject) and access it with http://localhost/myproject . 在安装了“ Wamp Server”的Windows中,要创建一个用于开发的新项目,我只需在“ www”中创建一个新目录(例如www / myproject),然后使用http://localhost/myproject

But recently installed ubuntu,installed lamp stack by following tutorials on internet, and found that things were not that easy. 但是最近安装了ubuntu,并按照互联网上的教程安装了灯架,发现事情并不是那么简单。

I had to create a new myproject.conf file for every new project and then enable it then restart apache service. 我必须为每个新项目创建一个新的myproject.conf文件,然后启用它,然后重新启动apache服务。

Any easier/better alternate? 有没有更容易/更好的选择?

VirtualHosts are only necessary, and will even only work, if you want to be able to access all your different projects using a different (sub)domain. 如果您希望能够使用不同的(子)域访问所有不同的项目,则VirtualHost仅是必需的,甚至将仅起作用。 For example: 例如:

mycoolproject.conf -> http://mycoolproject.com/
myotherproject.conf -> http://myotherproject.io/

If you are fine being able to access them using http://localhost/mycoolproject/ and http://localhost/myotherproject/ , you do not need seperate .conf files. 如果可以使用http:// localhost / mycoolproject /http:// localhost / myotherproject /来访问它们,则不需要单独的.conf文件。

Creating seperate .conf files all using http://localhost as their domain, will probably not work. 使用http://localhost作为其域创建单独的.conf文件可能无法正常工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM