CentOS:超簡単「LAMP」環境構築

CentOSで超簡単に「LAMP」環境を構築します。(2010/04/29作成)

LAMP StockSnap / Pixabay

1.環境

$ cat /etc/redhat-release
CentOS release 5.4 (Final)

$ uname -a
Linux localhost.localdomain 2.6.18-164.15.1.el5 #1 SMP Wed Mar 17 11:37:14 EDT 2010 i686 i686 i386 GNU/Linux

2.SELinux の無効化

$ sudo vi /etc/sysconfig/selinux
SELINUX=enforcing → SELINUX=disabled

※システム再起動。

3.iptables を全て許可

$ sudo vi /etc/sysconfig/iptables

# Firewall configuration written by system-config-securitylevel
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [319:25628]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [267:22603]
COMMIT
$ sudo /etc/init.d/iptables restart

4.LAMP 環境構築

$ sudo yum -y install httpd mod_ssl mysql mysql-server php php-mysql php-mbstring
$ sudo /etc/init.d/mysqld start
$ sudo /etc/init.d/httpd start

5.LAMP 動作確認

$ sudo echo “<?php phpinfo(); ?>” > /var/www/html/phpinfo.php

下記ブラウザにて。 http://サーバーIP/phpinfo.php
PHP Version 5.1.6 のページが表示されれば完了。

以上

About yoshimasa

埼玉県さいたま市在住、2男3女のパパです。Linux系の技術情報を中心にまとめています。1978年2月生まれ。