LAMP Configure Memo - For Debian And CentOS

LAMP Configure Memo - For Debian And CentOS

1. Option Package Install



yum install gcc
yum install gcc-c++
yum -y install ncurses-devel
yum -y install libxml2-devel
yum -y install zlib-devel openssl-devel
yum -y install gd
yum -y install gd-devel
yum -y install flex
yum -y install diffutils
yum -y install curl curl-devel



apt-get install libncurses5-dev   
apt-get install libncursesw5-dev
apt-get install libcurl4-gnutls-dev



2. MySQL Configure And Install



./configure \
--prefix=/usr/local/mysql \
--localstatedir=/var/mysql \
--with-comment=Source \
--with-server-suffix=-enterprise-gpl \
--with-mysqld-user=mysql \
--without-debug \
--with-big-tables \
--with-charset=utf8 \
--with-collation=utf8_general_ci \
--with-extra-charsets=all \
--with-pthread \
--enable-static \
--enable-thread-safe-client \
--with-client-ldflags=-all-static \
--with-mysqld-ldflags=-all-static \
--enable-assembler \
--without-ndb-debug \
--enable-local-infile \
--with-readline



# make
# make install
# useradd mysql
# cd /usr/local/mysql
# bin/mysql_install_db --user=mysql
# chown -R root:mysql .
# chown -R mysql /data/mysql
# chgrp -R mysql .
# cp share/mysql/my-medium.cnf /etc/my.cnf
# cp share/mysql/mysql.server /etc/init.d/mysqld
# chmod 755 /etc/init.d/mysqld
# chkconfig --add mysqld
# echo "/usr/local/mysql/lib" >> /etc/ld.so.conf && ldconfig
# /etc/init.d/mysqld start
# ln -s /usr/local/mysql/bin/mysql /usr/bin/mysql



3. Apache Configure And Install



APR & APR-UTIL
./configure --prefix=/usr/local/apr --enable-threads --enable-other-child --enable-static
./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr/ --with-mysql=/usr/local/mysql



Apache
./configure \
--prefix=/usr/local/apache2 \
--enable-mods-shared=all \
--enable-cache \
--enable-file-cache \
--enable-mem-cache \
--enable-disk-cache \
--enable-static-support \
--enable-static-htpasswd \
--enable-static-htdigest \
--enable-static-rotatelogs \
--enable-static-logresolve \
--enable-static-htdbm \
--enable-static-ab \
--enable-dav \
--enable-so \
--enable-static-checkgid \
--disable-cgid \
--disable-cgi \
--with-apr=/usr/local/apr/ \
--with-apr-util=/usr/local/apr-util/ \
--enable-ssl \
--with-ssl=/usr/include \
--with-pcre \
--sysconfdir=/etc/httpd



4. PHP Configure And Install



./configure \
--prefix=/usr/local/php \
--with-apxs2=/usr/local/apache2/bin/apxs \
--enable-inline-optimization \
--with-config-file-path=/etc \
--enable-calendar \
--enable-bcmath \
--enable-calendar \
--enable-exif \
--enable-ftp \
--enable-gd-native-ttf \
--enable-libxml \
--enable-magic-quotes \
--enable-mbstring \
--enable-soap \
--enable-sockets \
--enable-wddx \
--enable-zip \
--with-freetype-dir=/usr \
--with-gd \
--with-gettext \
--with-jpeg-dir=/usr \
--with-libxml-dir=/usr \
--with-mysql=/usr/local/mysql \
--with-mysql-sock=/tmp/mysql.sock \
--with-mysqli=/usr/local/mysql/bin/mysql_config \
--with-openssl=/usr \
--with-openssl-dir=/usr \
--with-png-dir=/usr \
--with-xmlrpc \
--with-xpm-dir=/usr/X11R6 \
--with-zlib \
--with-zlib-dir=/usr \
--with-pdo-mysql=/usr/local/mysql \
--with-curl \
--enable-sqlite-utf8



APC



wget http://pecl.php.net/get/APC-3.0.19.tgz/usr/local/php/bin/phpize
./configure --prefix=/usr/local/apc \
--with-php-config=/usr/local/php/bin/php-config \
--with-apxs=/usr/local/apache2/bin/apxs \
--enable-apc \
--enable-apc-mmap \
--sysconfdir=/etc



Edit php.ini, add lines: 



[APC] 



extension=apc.so
apc.enabled=1
apc.shm_segments=1
apc.shm_size=128
apc.ttl=7200
apc.user_ttl=7200
apc.num_files_hint=1024
apc.mmap_file_mask=/tmp/apc.XXXXXX
apc.enable_cli=1

ischeck 收集|网站建设

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值