在ubuntu
下 安装apache2
完成后apache
在/etc/apache2/
目录下是看不到httpd.conf
的ubuntu
由于被apache2.conf
代替了. 不重要 ,只是名字不同而已服务器
默认状况下 访问127.0.0.1
是读取sites-available的conf
配置的ide
为了支持 多个虚拟主机的配置咱们须要作如下操做ui
1.在apache2
目录下 手动添加 extra
文件夹 ,并在extra
文件加下添加一个 httpd-vhost.conf
文件spa
2.打开apache2.conf
对rest
(1).修改code
<Directory /> Options FollowSymLinks AllowOverride None #Require all denied //注释掉 allow from all //添加这个选项 </Directory>
(2).添加 Include extra/httpd-vhost.conf
域名
3.在httpd-vhost.conf中 添加虚拟主机 示例:it
<VirtualHost *:80> ServerName localhost.fis3 DocumentRoot /home/spademan/mypro/fis/fis3/ ErrorLog /logs/localhost.fis3-error.log CustomLog /logs/localhost.fis3-access.log combined </VirtualHost>
4.重启服务器 sudo apache apache2ctl restart //或者 sudo apachectl restart
5.配置hosts,便可用虚拟域名访问