Installation under Windows (64-bit) vagrant and Vituriebox
Http://blog.smdcn.net/article/1308.html
host:127.0.0.1
port:2222
Username:vagrant
Private key:xxxxx
Tips:virtualbox installation before Vagrant Remember (PS: These two files preferably installed in his default C drive)
Vagrant Command:
Windows cmd enters command line mode and then enters Vagrant's installation directory my own directory is C:\HashiCorp\Vagrant\bin (PS: To see there is Vagrant this file is an application)
Then put the prepared box file into the current directory (preferably in the bin directory, with the vagrant sibling, otherwise may not find the file)
1. Use the command Vagrant box add base Centos-6.3-x86_64-minimal.box
Ps:vagrant box Add is the name of the box to add the command base of box, you can define it yourself, but at the moment it is recommended to use base, the purpose is to follow the vagrant command, you can save yourself the name of the box, behind the name of your box
2.vagrant Init
PS: After this command is finished, it will generate a vagrantfile file in your bin directory, which is important for your profile, and it mainly modifies the two configurations.
1) The Vagrant Network has three modes
Config.vm.network:forwarded_port, guest:80, host:8080 (This configuration is recommended guest:80 represents 80 ports in a virtual machine, and host:8080 represents a 8080 port mapped to a host.) Can be set to all 80 ports, which can be accessed directly using localhost)
2) Config.vm.synced_folder "e:/work/", "/data/httpd/" This is a shared directory, the front is your working directory, behind the map to your virtual machine directory, note that this is your working directory, can be defined according to the installation directory of the Ngnix in your box
Start the Ngnix service to enter root
Su-
Vagrant
Sudo/usr/local/nginx/sbin/nginx-c/usr/local/nginx/conf/nginx.conf
Sudo/usr/local/nginx/sbin/nginx-s Reload
#sudo/usr/local/php5435/bin/php-cgi-b 127.0.0.1:9000
sudo/usr/local/php5435/sbin/php-fpm
See if Nginx is turned on
ps-a | grep nginx
The following steps are required to really open a service:
1. Enter/usr/local/php5435/bin
2. Execute this command./php-cgi-b 127.0.0.1:9000 or execute this statement directly:/usr/local/php5435/bin/php-cgi-b 127.0.0.1:9000 or/usr/local /php5435/sbin/php-fpm
In fact, this fastcgi does not open in Windows can only be opened manually (when I do the/usr/local/php5435/etc/php.ini opened in the cgi.fix_pathinfo=1)
######################### #数据库 #####################
When connecting to a database, use SSH to connect using the information of the third-party connection tool (SECURECRT)
The user name password for MySQL is root root
Vagrant command
First go to this directory C:\HashiCorp\Vagrant\bin
Vagrant up Boot
Vagrant Halt shutdown
Vagrant ssh To view information about connecting to servers and databases with SSH
#########################################
You can run a startup script on the server only if you manage it with vagrant.
sudo vim/etc/rc.d/rc.local
Then add the statement below (the experiment is feasible)
Sudo/usr/local/nginx/sbin/nginx-c/usr/local/nginx/conf/nginx.conf
Sudo/usr/local/nginx/sbin/nginx-s Reload
#sudo/usr/local/php5435/bin/php-cgi-b 127.0.0.1:9000
sudo/usr/local/php5435/sbin/php-fpm
PS: I use the CentOS + Php5.4.35+mysql+nginx to do the system
Managing virtual machines with Vagrant+virtualbox under Windows (64-bit)