LoginSignup
2
3

More than 5 years have passed since last update.

LAMPの構築

Last updated at Posted at 2015-10-13

LAMPの構築

Linux、Apache、MySQL、PHPの頭文字をとったもので

DB

  • yum install mysql-server
Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)の対策
/etc/init.d/mysql stop
chown -R mysql:mysql /var/lib/mysql
mysql_install_db
/etc/init.d/mysql start

apache

  • yum install httpd

php

  • yum install php php-mysql php-mbstring

自動起動

  • chkconfig httpd on
  • chkconfig mysqld on
  1. chkconfigでの確認
  2. phpの確認/var/www/htmlで vi index.php
<?php
phpinfo();
  1. mysql_secure_installation(mysqlの構築) rootのpw以外は基本Yでok

MySQL設定

  • ログの出力先作成(必要であれば)
    mkdir /var/log/mysql
    chown -R mysql:mysql /var/log/mysql

  • オリジナルのコンフィグをバックアップします。
    mv -i /etc/my.cnf /etc/my.cnf.org

vi /etc/my.cnf ← MySQL設定ファイル編集
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
character-set-server = utf8 ← 追加(MySQLサーバーの文字コードをUTF-8にする)

LAMP初期設定

これに関するリンク

2
3
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
2
3