首先在/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
<VirtualHost *:80>
ServerAdmin webmaster@admin.fbtools.cn
ServerName local.admin.fbtools.cn
DocumentRoot "/home/cc/workspace/admin.fbtools.cn"
<Directory "/home/cc/workspace/admin.fbtools.cn">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
ErrorLog "logs/admin.fbtools.cn-error_log"
CustomLog "logs/admin.fbtools.cn-access_log" common
</VirtualHost>
4.配置hosts
sudo gedit /etc/hosts
最上方添加: 127.0.0.1 local.admin.fbtools.cn
××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××
浏览器访问:local.admin.fbtools.cn /***.php