Wildcard Virtual Hosts Ubuntu

99封情书 提交于 2020-01-03 05:27:12

问题


I'm looking to setup wildcard virtual hosts in Ubuntu. I've set it up on a WAMP setup pretty easily, but I don't know enough about Linux to know how the setup differs.

The goal is to be able to create folders like:

site.weblocal
site2.weblocal
site3.weblocal
etc.....

without having to add individual vhosts each time. Someone has recommended dnsmasq?

Any tips would be greatly appreciated :)


回答1:


for Ubuntu it goes as simple as

sudo apt-get install dnsmasq
sudo echo "address=/weblocal/127.0.0.1" >> /etc/dnsmasq.d/weblocal
sudo /etc/init.d/dnsmasq restart



回答2:


sudo apt-get install dnsmasq

sudo gedit /etc/dnsmasq.conf

add this line "address=/.weblocal/127.0.0.1"

then restart dnsmasq using following

sudo service dnsmasq restart



来源:https://stackoverflow.com/questions/10873439/wildcard-virtual-hosts-ubuntu

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!