ubuntu 16.04 xampp环境配置虚拟主机

首先在/home/cc/下创建workspace目录/下创建admin.fbtools.cn目录

1.修改httpd.conf

sudo gedit /opt/lampp/etc/httpd.conf

将 : #Include etc/extra/httpd-vhosts.conf

修改为: Include etc/extra/httpd-vhosts.conf

2.将/opt/lampp/apache2/conf/httpd.conf 全部注释(localhost不可用)

3.修改httpd-vhosts.conf

sudo gedit /opt/lampp/etc/extra/httpd-vhosts.conf

添加或者打开注释: NameVirtualHost *:80

大概修改为:

NameVirtualHost *:80

ServerAdmin [email protected]

ServerName local.admin.fbtools.cn

DocumentRoot "/home/cc/workspace/admin.fbtools.cn"

Options Indexes FollowSymLinks Includes ExecCGI

AllowOverride All

Order allow,deny

Allow from all

ErrorLog "logs/admin.fbtools.cn-error_log"

CustomLog "logs/admin.fbtools.cn-access_log" common

4.配置hosts

sudo gedit /etc/hosts

最上方添加: 127.0.0.1 local.admin.fbtools.cn

××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××

浏览器访问:local.admin.fbtools.cn /***.php

你可能感兴趣的:(ubuntu 16.04 xampp环境配置虚拟主机)