centos上安装lnmp

1.网络安装 查看网络是否连接正常

2. sudo yum -y install wget screen python curl

wget http://mirrors.linuxeye.com/oneinstack-full.tar.gz下载到本地

tar -xzvf oneinstack-full.tar.gz  解压文件

cd oneinstack/

ls

./install.sh 进行安装

3.

4.ps -ef|grep nginx

ps -ef|grep php

ps -ef|grep mysql查看进程

5.创建简单项目

cd /data/wwwroot/

mkdir blog

cd blog

touch index.php

6. cd /usr/local/nginx/conf

mkdir blog

]cd blog

touch blog.conf

server {
    listen 80;
    server_name blog.com;
    root /data/wwwroot/blog;
    index index.html index.htm index.php;


    location ~ [^/]\.php(/|$) {
      #fastcgi_pass remote_php_ip:9000;
      fastcgi_pass unix:/dev/shm/php-cgi.sock;
      fastcgi_index index.php;
      include fastcgi.conf;
    }
    location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|mp4|ico)$ {
      expires 30d;
      access_log off;
    }
    location ~ .*\.(js|css)?$ {
      expires 7d;
      access_log off;
    }
    location ~ /\.ht {
      deny all;
    }

  }

7.service nginx reload 重启nginx

8.mysql -uroot -pdong0715

show databases;查看数据库

猜你喜欢

转载自blog.csdn.net/u013782819/article/details/80073608