zoukankan      html  css  js  c++  java
  • nginx安装

    wget -q http://nginx.org/download/nginx-1.6.3.tar.gz
    tar xf nginx-1.6.3.tar.gz

    cd nginx-1.6.3

    yum install pcre pcre-devel -y

    rpm -qa pcre pcre-devel

    yum install openssl-devel openssl -y

    mkdir -p /application/nginx-1.6.3/

    useradd nginx -s /sbin/nologin -M

    ./configure --user=nginx --group=nginx --prefix=/application/nginx-1.6.3/ --with-http_stub_status_module --with-http_ssl_module

    make&&make install

    ln -s /application/nginx-1.6.3/ /application/nginx

    cd /application/nginx

    /application/nginx/sbin/nginx -t

    groupadd mysql

    useradd -s /sbin/nologin -g mysql -M mysql

    id mysql

    cd /home/dean/tools/

    ls -sh mysql-5.5.15-linux2.6-i686.tar.gz

    tar xf mysql-5.5.15-linux2.6-i686.tar.gz

    mv mysql-5.5.15-linux2.6-i686 /application/mysql-5.5-15

    ln -s /application/mysql-5.5-15/ /application/mysql

    cd /application/mysql

    ls -l support-files/*.cnf

    mkdir -p /application/mysql/data

    chown -R mysql.mysql /application/mysql/

    /application/mysql/scripts/mysql_install_db --basedir=/application/mysql --datadir=/application/mysql/data --user=mysql

    cp support-files/mysql.server /etc/init.d/mysqld

    chmod +x /etc/init.d/mysqld

    sed -i 's#/usr/local/mysql#/application/mysql#g' /application/mysql/bin/mysqld_safe /etc/init.d/mysqld

    [root@LNMP mysql]# mv /etc/my.cnf /etc/mmyy.ccnnff   !!!!!十分重要的一步操作,将原来编译生成的配置文件,改名,移动,不然会报错:cannot open `/application/mysql/data/LNMP.err' for reading: No such file or directory

    [root@LNMP mysql]# /bin/cp support-files/my-small.cnf /etc/my.cnf

    /etc/init.d/mysqld start

    /etc/init.d/mysqld stop

    chkconfig --add mysqld

    chkconfig mysqld on

    chkconfig --list mysqld

    export PATH=/application/mysql/bin:$PATH

    echo 'export PATH=/application/mysql/bin:$PATH' >>/etc/profile

    mysql  直接使用mysql登录

    show databases;

    select user();

    quit

    mysqladmin -u root password 'yy631562'

    [root@LNMP mysql]# mysql -uroot -p
    Enter password:

    select user,host from mysql.user;

    drop user "root"@"::1";

    drop user ""@"localhost";

    drop user "root"@"LNMP";   

    drop user ""@"LNMP";   

    delete from mysql.user where user='' and host='LNMP';

    delete from mysql.user where user='root' and host='LNMP';

    flush privileges;

    select user,host from mysql.user;
    drop database test;
    ERROR 1010 (HY000): Error dropping database (can't rmdir './test/', errno: 17) :原因data目录下的test数据库里面有数据库不能识别的隐藏文件,删除就好了

    /application/nginx/sbin/nginx -t

    /application/nginx/sbin/nginx

    netstat -lntup|grep -E "80|3306"

    wget 127.0.0.1

    yum install -y zlib-devel libxml2-devel libjpeg-devel libjpeg-turbo-devel libiconv-devel

    rpm -qa zlib-devel libxml2-devel libjpeg-devel libjpeg-turbo-devel libiconv-devel

    rpm -qa freetype-devel libpng-devel gd-devel libcurl-devel libxslt-devel libxslt-devel

    yum install -y freetype-devel libpng-devel gd-devel libcurl-devel libxslt-devel libxslt-devel

    wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz

    tar zxf libiconv-1.14.tar.gz

    cd libiconv-1.14

    ./configure --prefix=/usr/local/libiconv

    make&&make install

    cd ../

    yum -y install libmcrypt-devel

    yum -y install mhash

    yum -y install mcrypt

    wget http://cn2.php.net/get/php-5.3.27.tar.gz/from/cn2.php.net/mirror

    tar zxf php-5.3.27.tar.gz

    cd php-5.3.27

    ./configure --prefix=/application/php5.3.27 --with-mysql=/application/mysql --with-iconv-dir=/usr/local/libiconv --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-safe-mode --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-fpm --enable-mbstring --with-gd --with-mcrypt --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --enable-short-tags --enable-zend-multibyte --enable-static --with-xsl --with-fpm-user=nginx --with-fpm-group=nginx --enable-ftp

    ln -s /application/mysql/lib/libmysqlclient.so.18 /usr/lib64

    touch ext/phar/phar.phar

    make

    make install

    ln -s /application/php5.3.27 /application/php

    ls -l /application/php

    cp php.ini-production /application/php/lib/php.ini

    cp php-fpm.conf.default php-fpm.conf

    [root@LNMP php-5.3.27]# cp php.ini-production /application/php/lib/php.ini

    /application/php/sbin/php-fpm

    安装wordpress:

    tar xf wordpress-4.3.1-zh_CN.tar.gz

    /bin/mv wordpress-4.3.1-zh_CN.tar.gz /home/dean/tools/

    chown -R nginx.nginx ../blog/
    vim ../nginx.conf
    worker_processes  1;
    error_log logs/error.log;
    events {
        worker_connections  1024;
    }
    http {
        include       mime.types;
        default_type  application/octet-stream;
                        '"$http_user_agent" "$http_x_forwarded_for"';
        sendfile        on;
        include extra/www.conf;
        include extra/bbs.conf;
        include extra/blog.conf;
        include extra/status.conf;
    }

  • 相关阅读:
    coursera 《现代操作系统》 -- 第五周 同步机制(2)
    coursera 《现代操作系统》 -- 第五周 同步机制(1)
    coursera 《现代操作系统》 -- 第四周 处理器调度
    coursera 《现代操作系统》
    路由器WAN端与LAN端的区别
    如何查看与刷新DNS本地缓存
    国内外常用的DNS服务器
    PPPOE协议
    WDS 的两种实现方式
    wifi基础知识整理
  • 原文地址:https://www.cnblogs.com/sunshineyang/p/5986594.html
Copyright © 2011-2022 走看看