Windows (64-bit) with Vagrant+virtualbox management virtual machine detailed

Source: Internet
Author: User
Tags fpm
Windows Install (64-bit) vagrant with Vituriebox
Http://blog.smdcn.net/article/1308.html


host:127.0.0.1
port:2222
Username:vagrant
Private key:xxxxx


Tips:virtualbox installation to Vagrant remember to remember (PS: These two files are best installed to his default C disk)




Vagrant Command:
Windows cmd Enter the command line mode and then enter the Vagrant 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 in the current directory (preferably in the bin directory, with the vagrant sibling, or you 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 added to the box's command base, you can define it yourself, but at this point, base is recommended, and the purpose is to use the Vagrant command later, you can omit to enter the name of the box, followed by the name of your box


2.vagrant Init
PS: After the execution of this command will be in your bin directory to generate a vagrantfile file, this file is your profile is very important, mainly modify the two of these configurations
1 Vagrant Network has three kinds of models
Config.vm.network:forwarded_port, guest:80, host:8080 (This configuration is recommended guest:80 represents 80 ports in the virtual machine, and host:8080 represents 8080 ports mapped to host hosts.) Can be all set to 80 ports, so you can use localhost access directly


2 Config.vm.synced_folder "e:/work/", "/data/httpd/" This is a shared directory, the front is your working directory, the back is mapped 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 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


To see if Nginx is open
ps-a | grep nginx


The actual opening of the service requires the following steps:
1. Enter/usr/local/php5435/bin
2. Execute this order./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 use/usr/local /php5435/sbin/php-fpm
It's actually equal to this fastcgi. Open only manually on Windows (when I do it opens in/usr/local/php5435/etc/php.ini cgi.fix_pathinfo=1)




######################### #数据库 #####################
The information to use the Third Party Connection tool (SECURECRT) with SSH connection when connecting to the database
MySQL username password is root root








Vagrant command
The first step is to enter this directory C:\HashiCorp\Vagrant\bin
Vagrant up Boot
Vagrant Halt shutdown
Vagrant ssh to view server and database information with SSH










#########################################
You can run a boot run script on the server with only vagrant management
sudo vim/etc/rc.d/rc.local


The following statements are then added (experimentally 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

Related Article

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.