動作環境

仮想マシン作成・起動

$ vagrant box add CentOS7.0 https://github.com/tommy-muehle/puppet-vagrant-boxes/releases/download/1.1.0/centos-7.0-x86_64.box
$ vagrant box list
CentOS7.0 (virtualbox, 0)
$ mkdir ~/MyVagrant
$ cd MyVagrant
$ mkdir CentOS7.0
$ cd CentOS7.0
$ vagrant init CentOS7.0
A `Vagrantfile` has been placed in this directory. You are now ready to `vagrant up` your first virtual environment! Please read the comments in the Vagrantfile as well as documentation on `vagrantup.com` for more information on using Vagrant.
$ vi Vagrantfile
--------------------
config.vm.network "private_network", ip: "192.168.33.10"
--------------------
$ vagrant up
$ vagrant ssh
Welcome to your Vagrant-built virtual machine.
[vagrant@localhost ~]$

Webサーバーの設定

$ sudo yum -y install httpd
$ sudo systemctl start httpd.service    // Apacheを起動
$ sudo systemctl enable httpd.service    // Apacheを常時起動
$ sudo systemctl stop firewalld    // ファイアーウォールを停止
$ sudo systemctl disable firewalld    // ファイアーウォールを常時停止
$ ps aux | grep httpd

Hello World!

$ cd /var/www/html
$ vi hello.js
--------------------
alert("Hello World!");
--------------------

トップ   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS