3
Help us understand the problem. What are the problem?

More than 5 years have passed since last update.

posted at

updated at

LAMPの構築

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初期設定

これに関するリンク

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
3
Help us understand the problem. What are the problem?