我正在尝试创建一个本地开发环境,以便可以在我的网站 matthewfedak.co.uk 上工作。
我正在使用无业游民和虚拟盒子。
这是我的流浪文件:
Vagrant.configure("2") do |config|
config.vm.box = "lucid32"
config.vm.provision :shell, :path => "localhost.sh"
config.vm.network :forwarded_port, host:4567, guest: 80
config.vm.network :forwarded_port, host: 3306, guest: 3306
config.vm.synced_folder "/Users/mfedak/sites", "/var/www/vhosts", :owner => "www-data", :group => "www-data"
end
这是我的 /etc/hosts 文件:
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
#127.0.0.1 localhost
#255.255.255.255 broadcasthost
#::1 localhost
#fe80::1%lo0 localhost
127.0.0.1:4567 matthewfedak.co.uk
127.0.0.1:4567 www.matthewfedak.co.uk
这是我在 /etc/apache2/sites-enabled/matthewfedak.co.uk 中的站点的虚拟主机
vagrant@lucid32:~$ sudo vim /etc/apache2/sites-enabled/matthewfedak.co.uk
<VirtualHost *:80>
ServerAdmin info@matthewfedak.co.uk
ServerName matthewfedak.co.uk
ServerAlias www.matthewfedak.co.uk
DocumentRoot /var/www/vhosts/matthewfedak.co.uk/httpdocs/
ErrorLog /var/www/vhosts/matthewfedak.co.uk/logs/error.log
CustomLog /var/www/vhosts/matthewfedak.co.uk/logs/access.log combined
</VirtualHost>
这听起来很简单,但我现在厌倦了玩这个。我之前已经设置了很多 Ubuntu 服务器,所以不要认为它与此有关,只是为了让主机/远程进行通信。