エンジニア的な技術的なブログ

webエンジニアの開発の知見を書きます。PHP、javascript、postgres、mysql、あと多少のインフラ周りとか。

centOS7にLAPP環境(postgresの9.3で)をインストール

<環境>

ニフティクラウド

centOS7 

 

<やりたいこと>

LAPP環境作りたい。

phpyumにある5.4でいい

postgresはyumになる9.2はダメ。9.3を入れる必要がある。

 

<なんと>

centOS7からserviceコマンドとかapachectlコマンド使えなくなってました,,,,

公開から1年近く経ってやっと7を触り始めたら、こんなことなっているのね。

 

 

<やったコマンドをダラダラと書きます>

 

apache, php

centの6とあんまり変わんない。これだけ

yum -y install httpd

yum -y install php

 

apacheは勝手に起動してくれてます。

 

【ポスグレ9.3】

1. rpmから9.3

rpm -ivh http://yum.postgresql.org/9.3/redhat/rhel-6-x86_64/pgdg-centos93-9.3-1.noarch.rpm

 

2. rpmで取得した9.3をyumでインストール

yum install postgresql93-server postgresql93-devel

yum install postgresql93-contrib.x86_64 

 

3.dbを初期化する。

/usr/pgsql-9.3/bin/postgresql93-setup initdb

 

4.postgresを起動 

systemctl start postgresql-9.3.service

 

 

基本の手順やコマンドは9.4とかでも一緒のはずなんで、参考になればと。