首页 技术 正文
技术 2022年11月12日
0 收藏 441 点赞 2,295 浏览 1344 个字

一。运行环境

  • Centos7 x64
  • lnmp (Linux , Nginx , Mysql , PHP/Python)

二。安装依赖和修改配置

安装Lnmp环境集成包:https://lnmp.org/install.html

wget -c http://soft.vpser.net/lnmp/lnmp1.4.tar.gz && tar zxf lnmp1.4.tar.gz && cd lnmp1.4 && ./install.sh lnmp


添加、删除虚拟主机及伪静态管理:https://lnmp.org/faq/lnmp-vhost-add-howto.html

lnmp vhost add 、 lnmp vhost list 、 lnmp vhost del


LNMP默认网站配置文件:/usr/local/nginx/conf/nginx.conf

LNMPA默认网站配置文件:/usr/local/nginx/conf/nginx.conf 和 /usr/local/apache/conf/extra/httpd-vhosts.conf

LAMP默认网站配置文件:/usr/local/apache/conf/extra/httpd-vhosts.conf


相关配置:

TP5 需要设置 防跨目录设置:https://lnmp.org/faq/lnmp-vhost-add-howto.html


LNMP 1.4上如果不想用防跨目录或者修改.user.ini的防跨目录的目录还需要将 /usr/local/nginx/conf/fastcgi.conf 里面的fastcgi_param PHP_ADMIN_VALUE "open_basedir=$document_root/:/tmp/:/proc/"; 在该行行前添加 # 或删除改行,需要重启nginx。


1

/usr/local/php/etc/php.ini

找到disable_functions 后面的scandir删除掉这个函数。

lnmp restart


2

/usr/local/nginx/conf/vhost/域名.conf/


3

include enable-php.conf;

修改为

include enable-php-pathinfo.conf;


4 nginx 配置


server
{
listen 80 default_server;
#listen [::]:80 default_server ipv6only=on;
#server_name _;
#server_name 127.0.0.1;
server_name 服务器ip;
index index.html index.htm index.php;
root /data/wwwroot/项目名/; include enable-php.conf;location / {
#autoindex on;
if (!-e $request_filename){
rewrite ^(.*)$ /index.php?s=/$1 last;
}
}}

5 网站访问目录指向public


6 设置相关目录权限

chmod -R 777 目录


7 如需要用到Redis 则需要PHP环境安装扩展支持Redis

https://lnmp.org/faq/addons.html

安装

进入lnmp解压后的目录,执行:./addons.sh install redis

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,489
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,904
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,737
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,489
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:8,128
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:5,290