[iyunv@lnmp local]# ll nginx/
total 16
drwxr-xr-x 2 root root 4096 Dec 8 15:56 conf
drwxr-xr-x 2 root root 4096 Dec 8 15:56 html
drwxr-xr-x 2 root root 4096 Dec 8 15:56 logs
drwxr-xr-x 2 root root 4096 Dec 8 15:56 sbin
重启nginx
[iyunv@lnmp local]# ./nginx/sbin/nginx -t
nginx: the configuration file /usr/local/nginx1.6.2/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx1.6.2/conf/nginx.conf test is successful
配置nginx
[iyunv@lnmp conf]# grep html nginx.conf
root html; 默认站点
[iyunv@lnmp conf]# ll
total 60
-rw-r--r-- 1 root root 1034 Dec 8 15:56 fastcgi.conf 动态位置文件
-rw-r--r-- 1 root root 1034 Dec 8 15:56 fastcgi.conf.default
-rw-r--r-- 1 root root 964 Dec 8 15:56 fastcgi_params
-rw-r--r-- 1 root root 964 Dec 8 15:56 fastcgi_params.default
-rw-r--r-- 1 root root 2837 Dec 8 15:56 koi-utf
-rw-r--r-- 1 root root 2223 Dec 8 15:56 koi-win
-rw-r--r-- 1 root root 3957 Dec 8 15:56 mime.types
-rw-r--r-- 1 root root 3957 Dec 8 15:56 mime.types.default
-rw-r--r-- 1 root root 2656 Dec 8 15:56 nginx.conf 静态配置文件
-rw-r--r-- 1 root root 2656 Dec 8 15:56 nginx.conf.default
配置虚拟主机
[iyunv@lnmp conf]# mkdir ../html/{www,blog,bbs}
[iyunv@lnmp conf]# for i in www blog bbs;do echo "http://$i.bier.org" >../html/$i/index.html;done
[iyunv@lnmp conf]# for i in www blog bbs;do cat ../html/$i/index.html;done
http://www.bier.org
http://blog.bier.org
http://bbs.bier.org
打开配置文件
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 80;
server_name www.bier.org;
root html/www;
index index.html index.htm;
}
server {
listen 80;
server_name blog.bier.org;
root html/blog;
index index.html index.htm;
index index.html index.htm;
}
server {
listen 80;
server_name bbs.bier.org;
root html/bbs;
index index.html index.htm;
}
}
[iyunv@lnmp nginx]# ./sbin/nginx -t
nginx: the configuration file /usr/local/nginx1.6.2/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx1.6.2/conf/nginx.conf test is successful
[iyunv@lnmp mysql]# mysql 输入mysql登录数据库
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.5.32 MySQL Community Server (GPL)
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
安装php
Lnmp下的php
Apache==>libphp5.so
Nginx php ===> fcgi php-fpm port 9000
字符集
tar zxf libiconv-1.14.tar.gz
cd libiconv-1.14
./configure --prefix=/usr/local/libiconv
make
make install
加密的库
tar -xf libmcrypt-2.5.8.tar.gz
cd libmcrypt-2.5.8
./configure
make
make install
sleep 2
/sbin/ldconfig
cd libltdl/
./configure --enable-ltdl-install
make
make install
tar -xf mhash-0.9.9.9.tar.gz
cd mhash-0.9.9.9
./configure
make
make install
加密扩展库
tar -xf mcrypt-2.6.8.tar.gz
cd mcrypt-2.6.8
/sbin/ldconfig
./configure LD_LIBRARY_PATH=/usr/local/lib
make
make install