1.首先在“/etc/hosts”文件中加入当前主机的IP地址和需要设置的虚拟主机名:
如:192.168.0.143 www.moyaping2.com
2.在“/etc/apache2/sites-available”目录下有“000-default.conf”
将000-default.conf 复制一份叫做 redis.conf
3 进入redis.conf
修改 ServerName 和 DocumentRoot
4 ln -s /etc/apache2/sites-available/redis.conf ../sites-enabled/
如:192.168.0.143 www.moyaping2.com
2.在“/etc/apache2/sites-available”目录下有“000-default.conf”
将000-default.conf 复制一份叫做 redis.conf
3 进入redis.conf
修改 ServerName 和 DocumentRoot
4 ln -s /etc/apache2/sites-available/redis.conf ../sites-enabled/
5 sudo /etc/init.d/apache2 restart