LAMP

来源:互联网 发布:网络兼职赚钱 编辑:程序博客网 时间:2024/06/16 19:50
1、关闭防火墙
   vim /etc/sysconfig/selinux   service iptables stop  chkconfig iptables off
  yum update  yum groupinstall 'Development Tools'  yum install -y gcc gcc-c++ gcc-g77 autoconf automake zlib* fiex* libxml* ncurses-devel libmcrypt* libtool-ltdl-devel*
 mkdir -p /home/data/soft mkdir -p /home/data/logs mkdir -p /home/data/mysql/data cd /home/data/softscp -i /root/.ssh/id_rsa_test13 -P 38383 coolyou@114.112.192.13:/home/data/soft/* ./     #从远程下载安装包
安装mysql
yum install cmakeuseradd -s /sbin/nologin mysqltar zxvf mysql-5.6.19.tar.gz cd mysql-5.6.19cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_UNIX_ADDR=/tmp/mysql.sock -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_EXTRA_CHARSETS:STRING=all -DWITH_MYISAM_STORAGE_ENGINE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_MEMORY_STORAGE_ENGINE=1 -DWITH_READLINE=1 -DENABLED_LOCAL_INFILE=1 -DMYSQL_DATADIR=/home/data/mysql/data -DMYSQL_USER=mysql -DMYSQL_TCP_PORT=3306makemake installchown -R mysql:mysql /usr/local/mysql/cp support-files/mysql.server /etc/init.d/mysqldvi /etc/init.d/mysqld  basedir=/usr/local/mysql  datadir=/home/data/mysql/datachmod +x /etc/init.d/mysqldchkconfig --level 235 mysqld onrm -rf /etc/my.cnf ,删除配置文件,不删除初使化会报错rm -rf /usr/local/mysql/my.cnf/usr/local/mysql/scripts/mysql_install_db  --basedir=/usr/local/mysql --datadir=/home/data/mysql/data --user=mysql ,初使化mysql会在安装目录生成配置文件mkdir /var/lib/mysql ,创建目录ln -s /tmp/mysql.sock /var/lib/mysql/mysql.sock ,创建软链接,不创建进入mysql报错(my.cnf里指定sock目录就不需要软链接)vi /usr/local/mysql/my.cnf :添加指定安装目录、数据目录vi /etc/porfile  PATH=$PATH:/usr/local/mysql/binsource /etc/profileservice mysqld restart  
安装nginx
yum install -y apr* autoconf automake bison bzip2 bzip2* cloog-ppl compat* cpp curl curl-devel fontconfig fontconfig-devel freetype freetype* freetype-devel gcc gcc-c++ gtk+-devel gd gettext gettext-devel glibc kernel kernel-headers keyutils keyutils-libs-devel krb5-devel libcom_err-devel libpng libpng-devel libjpeg* libsepol-devel libselinux-devel libstdc++-devel libtool* libgomp libxml2 libxml2-devel libXpm* libtiff libtiff* make mpfr ncurses* ntp openssl openssl-devel patch pcre-devel perl php-common php-gd policycoreutils telnet t1lib t1lib* nasm nasm* wget zlib-develtar zxvf pcre-8.35.tar.gz  cd pcre-8.35 ./configure --prefix=/usr/local/pcremakemake install cd .. tar zxvf openssl-1.0.1h.tar.gz  cd openssl-1.0.1h ./config --prefix=/usr/local/openssl make make install cd .. vim /etc/profile source /etc/profile tar zxvf zlib-1.2.8.tar.gz  cd zlib-1.2.8 ./configure --prefix=/usr/local/zlibmakemake installyum install glibc.i686yum -y install gcc glibc glibc-devel make nasm pkgconfig lib-devel openssl-devel expat-devel gettext-devel libtool mhash.x86_64 perl-Digest-SHA1.x86_64   gcc-c++yum install gitcd ..tar zxvf yasm-1.2.0.tar.gz cd yasm-1.2.0./configuremakemake installcd ..git clone git://git.videolan.org/x264cd x264/./configure --enable-sharedmakemake installcd ..tar zxvf lame-3.99.5.tar.gz cd lame-3.99.5./configure --enable-nasmmakemake installcd ..tar zxvf libogg-1.3.0.tar.gz cd libogg-1.3.0./configuremakemake installcd ..tar zxvf libvorbis-1.3.3.tar.gz cd libvorbis-1.3.3./configuremakemake installcd ..tar jxvf libvpx-v1.3.0.tar.bz2 cd libvpx-v1.3.0./configure --enable-sharedmakemake installcd ..tar zxvf faad2-2.7.tar.gz cd faad2-2.7./configuremakemake installcd ..tar zxvf faac-1.28.tar.gz cd faac-1.28/common/mp4v2/vim mpeg4ip.h      从123行开始修改此文件mpeg4ip.h,到129行结束。修改前:#ifdef __cplusplusextern "C"{#endifchar*strcasestr(const char *haystack, const char *needle);#ifdef __cplusplus}#endif 修改后:#ifdef __cplusplusextern"C++" {#endifconst char*strcasestr(const char *haystack, const char *needle);#ifdef __cplusplus}#endifcd .../configuremakemake installcd ..tar zxvf xvidcore-1.3.2.tar.gz cd xvidcore/build/generic/./configuremakemake installcd ..git clone git://source.ffmpeg.org/ffmpeg cd ffmpeg./configure  --prefix=/usr/local/ffmpeg/ --enable-version3  --enable-libvpx --enable-libfaac --enable-libmp3lame  --enable-libvorbis --enable-libx264 --enable-libxvid --enable-shared --enable-gpl --enable-postproc --enable-nonfree  --enable-avfilter --enable-pthreadsmakemake installcd ..vi /etc/ld.so.conf/lib/lib64/usr/lib/usr/lib64/usr/local/lib/usr/local/lib64/usr/local/ffmpeg/lib#idconfigldconfigtar zxvf nginx-1.6.0.tar.gz useradd -s /sbin/nologin wwwscp -r -i /root/.ssh/id_rsa_test13 -P 38383 coolyou@114.112.192.13:/home/data/soft/nginx_mod* ./vi nginx_mod_h264_streaming-2.2.7/src/ngx_http_streaming_module.c ,删除if (r->zero_in_uri)这一行scp -r -i /root/.ssh/id_rsa_test13 -P 38383 coolyou@114.112.192.13:/home/data/soft/nginx-rtmp* ./cd nginx-1.6.0./configure --prefix=/usr/local/nginx --without-http_memcached_module --user=www --group=www --with-http_stub_status_module --with-http_ssl_module --with-http_gzip_static_module --with-openssl=/home/data/soft/openssl-1.0.1h --with-zlib=/home/data/soft/zlib-1.2.8 --with-pcre=/home/data/soft/pcre-8.35 --add-module=/home/data/soft/nginx_mod_h264_streaming-2.2.7 --with-http_ssl_module --with-http_flv_module --with-http_stub_status_module --add-module=/home/data/soft/nginx-rtmp-modulemakemake installcd ..vim /etc/init.d/nginxchmod +x /etc/init.d/nginx chkconfig nginx --level 235 on service nginx restart
安装PHP
 tar zxvf libmcrypt-2.5.8.tar.gz cd libmcrypt-2.5.8./configuremakemake installcd ..tar zxvf tiff-4.0.3.tar.gz cd tiff-4.0.3./configure --prefix=/usr/local/tiff --enable-sharedmakemake installcd ..tar xvf libpng-1.6.16.tar cd libpng-1.6.16./configure --prefix=/usr/local/libpng --enable-sharedmakemake installcd ..tar zxvf freetype-2.5.5.tar.gz cd freetype-2.5.5       报错make: Nothing to be done for `unix'    make clean./configure --prefix=/usr/local/freetype --enable-sharedmakemake installcd ..tar zxvf jpegsrc.v9a.tar.gz cd jpeg-9a/./configure --prefix=/usr/local/jpeg --enable-sharedmakemake installcd ..tar zxvf libgd-2.1.0.tar.gz cd libgd./configure --prefix=/usr/local/libgd --enable-shared --with-jpeg=/usr/local/jpeg --with-png=/usr/local/libpng --with-freetype=/usr/local/freetype --with-  fontconfig=/usr/local/freetype --with-xpm=/usr/ --with-tiff=/usr/local/tiff --with-vpx=/usr/local/libvpxmakemake installcd ..tar zxvf t1lib-5.1.2.tar.gz cd t1lib-5.1.2./configure --prefix=/usr/local/t1lib --enable-sharedmake without_docmake installln -s /usr/lib64/libltdl.so /usr/lib/libltdl.socp -frp /usr/lib64/libXpm.so* /usr/lib/cd ..tar zxvf php-5.5.28.tar.gz cd php-5.5.28export LD_LIBRARY_PATH=/usr/local/libgd/lib./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-mysql-sock=/tmp/mysql.sock --with-pdo-mysql=/usr/local/mysql --with-gd --with-png-dir=/usr/local/libpng --with-jpeg-dir=/usr/local/jpeg --with-freetype-dir=/usr/local/freetype --with-xpm-dir=/usr/ --with-vpx-dir=/usr/local/libvpx/ --with-zlib-dir=/usr/local/zlib --with-t1lib=/usr/local/t1lib --with-iconv --enable-libxml --enable-xml --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --enable-opcache --enable-mbregex --enable-fpm --enable-mbstring --enable-ftp --enable-gd-native-ttf --with-openssl --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --without-pear --with-gettext --enable-session --with-mcrypt --with-curl --enable-ctype makemake installcp php.ini-production /usr/local/php/etc/php.ini ,创建配置文件cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm ,创建启动脚本chmod +x /etc/init.d/php-fpm ,添加执行权限chkconfig php-fpm on ,添加开机启动  cp sapi/fpm/php-fpm.conf /usr/local/php/etc/ ,创建php-fpm配置文件service php-fpm start
vi index.php   <?php phpinfo(); ?>  ,测试PHP解析
原创粉丝点击