在XAMPP上设置虚拟主机 [英] Setting up virtual host on XAMPP
问题描述
我已经在Ubuntu的'/opt/lampp'目录中安装了XAMPP,并希望设置一些VirtualHosts.Apache Virtual Host教程指示放置
I've installed XAMPP on Ubuntu in '/opt/lampp' directory and would like to set up some VirtualHosts. Apache Virtual Host tutorial instructs to place
<VirtualHost *:80>
...
</VirtualHost>
"/etc/apache2/sites-available/[virtualhostname].conf"中的
代码.问题是我在"/etc"中没有"apache2"文件夹.我在"/opt/lampp/apache2"中也没有"sites-available"目录.
code in '/etc/apache2/sites-available/[virtualhostname].conf'. The problem is that I don't have 'apache2' folder in '/etc'. I also don't have 'sites-available' directory in '/opt/lampp/apache2'.
我虽然有'/opt/lampp/etc/httpd.conf'和'/opt/lampp/etc/extra/httpd-vhosts.conf'文件.我应该使用哪些设置VH?
I have '/opt/lampp/etc/httpd.conf' and '/opt/lampp/etc/extra/httpd-vhosts.conf' files though. Which ones shall I use to set the VH up?
推荐答案
您应该使用/opt/lampp/etc/extra/httpd-vhosts.conf
,但是在将服务器名添加到您的 .hosts
文件,并取消注释/opt/lampp/etc/httpd.conf
中的 httpd-vhosts.conf
.
You should use /opt/lampp/etc/extra/httpd-vhosts.conf
, but before you should add your servername to your .hosts
file and uncomment inclusion of of the httpd-vhosts.conf
in the /opt/lampp/etc/httpd.conf
.
这篇关于在XAMPP上设置虚拟主机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!