按照“Fecmall-2.x 安装”标准通用教程(标准),在文档中的2.2 apache配置文件中,我的VirtualHost配置如下:
ubuntu apache2.4配置文件路径:/etc/apache2/sites-available/000-default.conf
ServerName localhost
ServerAlias localhost
DocumentRoot "/var/www/html/"
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
ServerName appadmin.fecshoptest.com
ServerAlias fecshoptest
DocumentRoot "/var/www/html/fecmall/appadmin/web"
Options +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
hosts配置(文件路径/etc/hosts):
127.0.0.1 localhost
192.168.0.200 appfront.usertest.com
192.168.0.200 appadmin.admintest.com
192.168.0.200 img.imgtest.com
192.168.0.200 apphtml5.htmltest.com
192.168.0.200 appserver.servertest.com
192.168.0.200 appapi.apitest.com
The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
这两个文件设置好之后,service apache2 restart命令重启apache。
浏览器访问时,出现的问题:
1、URL:http://appfront.usertest.com/fecmall/appfront/web/install.php 无法访问
无法访问此网站
找不到 appfront.usertest.com 的服务器 IP 地址。
2、将URL中的appfront.usertest.com修改为本地ip就可以访问到安装界面
URL:http://192.168.0.200/fecmall/appfront/web/install.php 可以访问