LoginSignup
2
3

More than 5 years have passed since last update.

EC2でマネージドじゃない最新のLAMPスタックの構築

Posted at

環境

Amazon Linux

  • Development Toolsのインストール
# yum groupinstall -y 'Development Tools'
# yum groupinstall -y "Development Libraries"

MariaDB 10.1

$ sudo vi /etc/yum.repos.d/MariaDB.repo
MariaDB.repo
# MariaDB 10.1 CentOS repository list - created 2016-03-13 07:22 UTC
# http://mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.1/centos6-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
$ sudo yum install -y MariaDB-server MariaDB-client
$ sudo /etc/init.d/mysql start
$ mysql_secure_installation

Apache 2.4

# yum install apr*
# yum install pcre-devel
# cd /usr/local/src/
# wget http://ftp.meisei-u.ac.jp/mirror/apache/dist//httpd/httpd-2.4.18.tar.bz2
# tar xfj httpd-2.4.18.tar.bz2
# cd httpd-2.4.18
# ./configure --enable-so --prefix=/usr/local/apache2
# make 
# make install
# cp build/rpm/httpd.init /etc/rc.d/init.d/httpd2
# vi /etc/init.d/httpd2
/etc/init.d/httpd2
#httpd=${HTTPD-/usr/sbin/httpd}
#pidfile=${PIDFILE-/var/run/${prog}.pid}
httpd=${HTTPD-/usr/local/apache2/bin/httpd}
pidfile=${PIDFILE-/usr/local/apache2/logs/httpd.pid}

#CONFFILE=/etc/httpd/conf/httpd.conf
CONFFILE=/usr/local/apache2/conf/httpd.conf
# chkconfig --add httpd2
# chkconfig --level 35 httpd2 on
# chkconfig --list | grep httpd2
# vi /usr/local/apache2/conf/httpd.conf
httpd.conf
LoadModule php7_module modules/libphp7.so
AddType application/x-httpd-php .php

PHP 7.0

# yum install -y libicu-devel
# cd /usr/local/src/
# wget http://jp2.php.net/distributions/php-7.0.4.tar.bz2
# tar xvfj php-7.0.4.tar.bz2
# cd cd php-7.0.4
./configure \
--with-apxs2=/usr/local/apache2/bin/apxs \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \
--with-openssl \
--enable-mbstring \
--enable-opcache \
--enable-intl \
--with-zlib-dir
# make
# make install 
# php -v
PHP 7.0.4 (cli) (built: Mar 13 2016 08:50:50) ( ZTS )
# cp /usr/local/src/php-7.0.4/php.ini-production /etc/php.ini
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