LoginSignup
0
1

More than 5 years have passed since last update.

ServersManのVPSを申し込んでからLAMP環境を立ち上げるまでの手順

Last updated at Posted at 2016-09-10

ServersManのサイト(MyDTI)から ServersMan@VPS Entry プラン をプラン追加。
データセンターは東京を選択。
OSは、CentOS7(64bit)、テンプレートはシンプルパック。
クレジットカード情報を入力して申し込む。
申し込むとメールが届くので、保存しておく(パスワードなどが書かれている)。
しばらく待つとサーバが稼動してSSH接続ができるようになる。
サーバの稼働状況は、MyDTIから確認できる。だいたい5分~15分ぐらい待てばOK。

サーバの稼動を確認したら、TeraTermなどでSSH接続する。
メールには、接続先のIPアドレスとrootのパスワードが書かれている。
ポート番号に注意(メール参照)。

接続できたら、LAMP環境を構築する。CentOS7(64bit)

yum update

yum install epel-release

rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm

yum install --enablerepo=remi,remi-php56 php php-common php-opcache php-devel php-mbstring php-mcrypt php-mysqlnd php-phpunit-PHPUnit php-pecl-xdebug php-pecl-xhprof

yum install --enablerepo=remi,remi-php56 -y php-intl

yum install --enablerepo=remi,remi-php56 -y httpd

systemctl start httpd

cd /var/www/html/

vi index.php

<?php
  phpinfo();
?>

httpで、サーバのIPアドレスにアクセスして、phpinfoが表示されたらOK。

表示されない場合は、SELinuxを疑う。無効化するには下記コマンドを実行する。

setenforce 0
getenforce

permissive または disabled になっていればOK。
それでも表示されない場合は、firewalld を疑う。

systemctl status firewalld

この結果が

Active: active (running)

になっていると、ファイアウォールが効いているので、無効化する。

systemctl stop firewalld

結果が

firewalld.service - firewalld

になっていれば無効化成功。

cd /root

yum install http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm

yum install wget

wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm

rpm -Uvh mysql-community-release-el7-5.noarch.rpm

yum --enablerepo=mysql56-community install mysql-community-server

systemctl start mysqld

mysql -u root

update mysql.user set password=password('任意のパスワード') where user = 'root';

flush privileges;
0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1