Managing virtual machines with Vagrant+virtualbox under Windows (64-bit) specific explanations

Source: Internet
Author: User

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 goes to Vagrant's installation folder my own folder is C:\HashiCorp\Vagrant\bin (PS: To see there is Vagrant this file is an application)
Then put the prepared box file in the current folder (preferably put in the Bin folder. Same as vagrant, or you may not find a 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 added to the box's command base. You want to be able to customize. But now it's recommended to use base, which is the idea of using the vagrant command to save yourself the name of the box, followed by the name of your box.


2.vagrant Init
PS: After this command is run, it will generate a vagrantfile file in your Bin folder, which is very important to your configuration file, the two configurations in the main changes
1) The Vagrant Network has three modes
Config.vm.network:forwarded_port, guest:80, host:8080 (it is recommended to use such a configuration guest:80 represents 80port in a virtual machine, host:8080 represents 8080PO mapped to a host  Rt. Can be all set to 80port, so you can directly use localhost access to ask)


2) Config.vm.synced_folder "e:/work/", "/data/httpd/" This is a shared folder. The front is your working folder, and behind it is the folder that maps to your virtual machine, note that this is your working folder. can be defined according to the installation folder 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. Run this command./php-cgi-b 127.0.0.1:9000 or run this statement directly:/usr/local/php5435/bin/php-cgi-b 127.0.0.1:9000 or/usr/local /php5435/sbin/php-fpm
The fact is that this fastcgi does not open in Windows only manually (when I do, I open the cgi.fix_pathinfo=1 in/usr/local/php5435/etc/php.ini)




######################### #数据库 #####################
When connecting to a database, use SSH to connect using the third-Party connection tool (SECURECRT) information to
MySQL Usernamepassword is root root








Vagrant command
First, go to this folder C:\HashiCorp\Vagrant\bin
Vagrant up Boot
Vagrant Halt shutdown
Vagrant SSH View information for connecting to server and database with SSH










#########################################
To be able to execute a boot execution script on the server with only vagrant management.
sudo vim/etc/rc.d/rc.local


Then add the statement below (which is feasible by experiment)
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) specific explanations

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.