Lapp環境をソースからインストールする(centos)

Embed Size (px)

Citation preview

  • 1.Lapp(Apahe,PostgreSQL,PHP)- CentOS - @kimiyukiy 2013.02.23(sat)

2. make# yum groupinstall Development Tools# yum install libxml2-devel readline-devel# yum install vim#yum install wget#yum install system-config-firewall 3. Apache(1)ApachemakeAPRAPR-UtilPCREApacheAPR$ wget http://ftp.tsukuba.wide.ad.jp/software/apache//apr/apr-1.4.6.tar.bz2$ tar jxfv apr-1.4.6.tar.bz2$ cd apr-1.4.6/$ ./configure --prefix=/usr/local/apr$ make# make install 4. Apache(2)APR-Util$ wget http://ftp.kddilabs.jp/infosystems/apache//apr/apr-util-1.5.1.tar.bz2$ tar jxfv apr-util-1.5.1.tar.bz2$ cd apr-util-1.5.1/$ ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr$ make# make install 5. Apache(3)PCRE$ wget http://sourceforge.net/projects/pcre/files/pcre/8.32/pcre-8.32.tar.bz2$ tar jxvf pcre-8.32.tar.bz2$ cd pcre-8.32/$ ./configure --prefix=/usr/local/pcre$ make# make install 6. Apache(4)Apahe$ wget http://ftp.riken.jp/net/apache//httpd/httpd-2.4.3.tar.bz2$ tar jxfv httpd-2.4.3.tar.bz2$ cd httpd-2.4.3/$ ./configure --prefix=/usr/local/apache --enable-so--enable-rewrite --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --with-pcre=/usr/local/pcre$ make# make install 7. Apache(5)Apache# groupadd apache && useradd -g apache apacheApache# cd /usr/local/apache/conf/# cp httpd.conf httpd.conf.bak# vi httpd.conf(155) daemon => apache(156) daemon => apache(186)#ServerName www.example.com:80 => ServerName localhost 8. Apache(6)Apahe# system-config-firewall(80)# /usr/local/apache/bin/apachectl start=> It works! 9. Apache(7)# cp build/rpm/httpd.init /etc/init.d/httpd# vi /etc/init.d/httpd(60)httpd=${HTTPD-/usr/local/apache/bin/httpd}(61)pidfile=${PIDFILE-/usr/local/apache/logs/${prog}.pid}(62)lockfile=${LOCKFILE-/usr/local/apache/logs/${prog}}(67)CONFFILE=/usr/local/apache/conf/httpd.conf# chkconfig --add httpd# chkconfig httpd on# chkconfig --list httpd=> 10. Apache(8)# serivce http start# service httpd stop# service httpd status 11. PostgreSQL(1)# adduser postgres# passwd postgres# mkdir /usr/local/pgsql# chown postgres.postgres /usr/local/pgsql# su postgres$ wget http://ftp.postgresql.org/pub/source/v9.2.3/postgresql-9.2.3.tar.bz2$ tar jxvf postgresql-9.2.3.tar.bz2$ cd postgresql-9.2.3/$ ./configure$ make$make install 12. PostgreSQL(2)$ cd ~$ vi .bashrc()POSTGRES_HOME=/usr/local/pgsqlexport PATH="$PATH":/usr/local/pgsql/binexport PGLIB=$POSTGRES_HOME/libexport PGDATA=$POSTGRES_HOME/dataexport MANPATH="$MANPATH":$POSTGRES_HOME/man$ source .bashrc 13. PostgreSQL(3)$ initdb --no-locale --encoding=UNICODE$ vi /usr/local/pgsql/data/postgresql.conf(300)logging_collector = on(309)log_filename = %a.log()$ pg_ctl start$ psql -l(OK)$pg_ctl stop() 14. PostgreSQL(4)# cp /home/postgres/postgresql-9.2.3/contrib/start-scripts/linux/etc/init.d/postgres# chmod 755 /etc/init.d/postgres# chkconfig postgres on=> 15. PostgreSQL(5)# serivce postgres start# service postgres stop# service postgres status 16. PHP(1)()$ tar jxvf php-5.4.11.tar.bz2$ cd php-5.4.11/$ ./configure --with-apxs2=/usr/local/apache/bin/apxs --enable-mbstring --enable-mbregex --with-pgsql --with-zlib$ make# make install# cp php.ini-development /usr/local/lib/php.ini 17. PHP(2)# vi /usr/local/apache/conf/mime.types()application/x-httpd-php php# vi /usr/local/apache/htdocs/test.php()# /usr/local/apache/bin/apachectl restart=> test.phpPHP