linux环境搭建lnmp环境,linux搭建lnmp88bf必发娱乐

yum install libxml2 libxml2-devel curl-devel free-type-devel

linux环境搭建lnmp环境,linux搭建lnmp

[原创]编译安装lnmp环境准备软件:nginx1.10.3+php-5.5.12+mariadb10.0.8(数据库在此使用的yum安装)

如果需要编译安装的可以给我留言,我后续再发布出来! 

依赖包均已yum在线安装一、yum安装mariadb数据库yum -y install
mariadb*启动数据库systemctl start mariadb修改root密码grant all
privileges on *.* to ‘root’@’localhost’ identified by “root” with
grant option;grant all privileges on *.* to ‘root’@’%’ identified by
“root” with grant option;flush privileges;二、安装nginx1、安装依赖包yum
install -y pcre pcre-devel openssl openssl-devel
gcc-c++2、创建运行进程的用户groupadd nginxuseradd -g nginx -s
/bin/nologin nginx3、编译安装nginx我在这儿的软件都放在myapp目录下的tar
-zxvf nginx-1.10.3.tar.gz #解压到当前目录cd nginx-1.10.3./configure
–prefix=/usr/local/nginx –user=nginx –group=nginx
–with-http_ssl_module –with-pcre –with-http_gzip_static_module
–without-http_gzip_module –with-http_stub_status_modulemakemake
install4、启动nginxcd
/usr/local/nginx/sbin./nginx5、验证:浏览器访问http://ip三、编译安装php1、安装依赖包yum
-y install libxml2* curl curl-devel libpng-devel libpng openldap
openldap-devel freetype freetype-devel libjpeg-devel
libpng-devel2、编译安装phptar -xjf php-5.5.12.tar.bz2cd
php-5.5.12./configure^C-prefix=/usr/local/php –with-bz2 –with-curl
–enable-ftp –enable-sockets –disable-ipv6 –with-gd
–with-jpeg-dir=/usr/local –with-png-dir=/usr/local
–with-freetype-dir=/usr/local –enable-gd-native-ttf
–with-iconv-dir=/usr/local –enable-mbstring –enable-calendar
–with-gettext –with-libxml-dir=/usr/local/ –with-zlib
–with-pdo-mysql=mysqlnd –with-mysqli=mysqlnd –with-mysql=mysqlnd
–enable-dom –enable-xml –enable-fpm –with-libdir=lib64makemake
testmake install3、修改php文件cp /myapp/php-5.5.12/php.ini-production
/usr/local/php/etc/php.inicp /usr/local/php/etc/php-fpm.conf.default
php-fpm.conf4、启动php/usr/local/php/sbin/php-fpm检查启动是否成功netstat
-lntp | grep php-fpm显示 tcp 0 0 127.0.0.1:9000 0.0.0.0:* LISTEN
77087/php-fpm: mast四、整合nginx支持php1、修改nginx配置文件vi
/usr/local/nginx/conf/nginx.conf[[email protected]
conf]# cat nginx.conf | grep -v “#”user nginx nginx;worker_processes
1;events { worker_connections 1024;}http { include mime.types;
default_type application/octet-stream; log_format main ‘$remote_addr

  • $remote_user [$time_local] “$request” ‘ ‘$status
    $body_bytes_sent “$http_referer” ‘ ‘”$http_user_agent”
    “$http_x_forwarded_for”‘; access_log logs/access.log main; sendfile
    on; keepalive_timeout 65; server { listen 80; server_name localhost;
    charset utf8; location / { root html; index index.html index.htm
    index.php; } error_page 500 502 503 504 /50x.html; location = /50x.html
    { root html; } location ~ \.php$ { root html; fastcgi_pass
    127.0.0.1:9000; fastcgi_index index.php; fastcgi_param
    SCRIPT_FILENAME $document_root$fastcgi_script_name; include
    fastcgi_params; } }2、创建index.php文件测试cd /usr/local/nginx/htmlvi
    index.php[[email protected]
    html]# cat index.php <?php
    $link=mysql_connect(“172.16.20.112″,”root”,”root”); if(!$link) echo
    “MySQL数据库连接失败!!”; else echo “MySQL数据库连接成功!!”;
    phpinfo();?> 保存退出chmod 775
    index.php3、验证浏览器http://IP/index.php

有问题大家请指出来!!谢谢!! 

http://www.bkjia.com/Linuxjc/1220067.htmlwww.bkjia.comtruehttp://www.bkjia.com/Linuxjc/1220067.htmlTechArticlelinux环境搭建lnmp环境,linux搭建lnmp
[原创]编译安装lnmp环境
准备软件:nginx1.10.3+php-5.5.12+mariadb10.0.8(数据库在此使用的yum安装)
如果需要编…

Compile PHP-5.4

    #keepalive_timeout  0;
    keepalive_timeout  65;

(= /data/system/php5.4/sbin/php-fpm -c /data/system/php5.4/etc/php.ini
-y /data/system/php5.4/etc/php-fpm.conf)

user  nginx nginx;
worker_processes  8;

CentOS 6.4 install nginx+php5.4+mysql

http {
    include       mime.types;
    default_type  application/octet-stream;

            include fastcgi_params;
            fastcgi_pass 127.0.0.1:9000;
            fastcgi_index index.php;
            fastcgi_param SCRIPT_FILENAME
/data/www/phpmyadmin$fastcgi_script_name;
        }

        location ~ ^/myadminphp/.+\.php$ {
            rewrite /myadminphp/(.+\.php) /$1 break;

    server {
        listen       80;
        server_name  localhost;

        #access_log  logs/host.access.log  main;

        location / {
            #root   html;
            alias /data/www/web/;
            index  index.html index.htm;

            location ~ \.php$ {
              fastcgi_pass    127.0.0.1:9000;
              fastcgi_index index.php;
              fastcgi_param  SCRIPT_FILENAME 
/data/www/web/$fastcgi_script_name;
              include fastcgi.conf;
            }
        }

  gzip on;
  gzip_min_length  1k;
  gzip_buffers     4 16k;
  gzip_http_version 1.0;
  gzip_comp_level 2;
  gzip_types       text/plain application/x-javascript text/css
application/xml application/json image/png image/jpeg image/gif;
  gzip_vary on;

/usr/sbin/groupadd nginx
/usr/sbin/useradd -g nginx nginx
/usr/sbin/usermod -a -G webuser nginx (Add wordpress user ‘webuser’ into
nginx group)

            #above line is important !!!

        #error_page  404              /404.html;

附nginx.conf的主要配置部分:

events {
    worker_88bf必发娱乐,connections  1024;
}

版权声明:本文为博主原创文章,未经博主允许不得转载。

            if (-f $request_filename/index.html){
                rewrite (.*) $1/index.html break;
            }
            if (-f $request_filename/index.php){
                rewrite (.*) $1/index.php;
            }
            if (!-f $request_filename){
                rewrite (.*) /index.php;
            }


cp php.ini-production   /data/system/php5.4/etc/php.ini
cp /data/system/php5.4/etc/php-fpm.conf.default
/data/system/php5.4/etc/php-fpm.conf
killall php-fpm

        #charset koi8-r;

./configure –prefix=/data/system/php5.4 –with-zlib –with-libxml
–enable-gd-native-ttf –enable-gd-jis-conv –with-freetype-dir
–with-jpeg-dir –with-png-dir –with-ttf=shared  –enable-mbstring
–with-mysql=mysqlnd –with-mysqli=mysqlnd –with-pdo-mysql=mysqlnd
–with-mysql-sock=/var/lib/mysql/mysql.sock 
–with-config-file-path=/data/system/php5.4/etc
–with-iconv=/data/system/libiconv –disable-ipv6 –enable-static
–enable-zend-multibyte –enable-inline-optimization
–enable-zend-multibyte –enable-sockets –enable-soap  –with-gettext
–enable-sysvsem –enable-mbregex –enable-fastcgi –enable-fpm
–enable-force-cgi-redirect  –with-curl –with-curlwrappers
–enable-mbregex –enable-bcmath –enable-shmop –enable-suhosin
–with-libevent=shared –with-gd –with-mcrypt –enable-zip
–enable-soap –enable-mime-magic –enable-cgi –enable-xml –enable-ftp
–enable-json –enable-ctype –enable-gd-native-ttf

download nginx

#pid        logs/nginx.pid;

    #log_format  main  ‘$remote_addr – $remote_user [$time_local]
“$request” ‘
    #                  ‘$status $body_bytes_sent “$http_referer” ‘
    #                  ‘”$http_user_agent”
“$http_x_forwarded_for”‘;

          location /myadminphp {
                alias  /data/www/phpmyadmin/;
                index  index.php index.html;
                access_log off;
                error_log off;
                #charset gb2312;
          }

    sendfile        on;
    #tcp_nopush     on;

./configure  –prefix=/data/system/pcre8
make&&make install

#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

http://downloads.sourceforge.net/project/pcre/pcre/8.34/pcre-8.34.tar.gz

./configure –user=nginx –group=nginx –prefix=/data/system/nginx
–with-pcre=/data/system/source/nginx/pcre-8.34
–with-zlib=/data/system/source/nginx/zlib-1.2.8
–with-http_ssl_module

wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz
./configure –prefix=/data/system/libiconv

    #access_log  logs/access.log  main;

cp php-5.4.26/sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
chmod +x /etc/init.d/php-fpm
chkconfig on php-fpm
service php-fpm restart