LNMP Setup Steps
Using Shell to proceed setup LNMP.
wget http://soft.vpser.net/lnmp/lnmp1.6.tar.gz -cO lnmp1.6.tar.gz && tar zxf lnmp1.6.tar.gz && cd lnmp1.6 && ./install.sh lnmp
Setup and change conf vhost/.conf
Main problems after setup
- pathinfo
- base_dir
- .htaccess
Pathinfo
Pathinfo problem is solved in the new version of LNMP. You can include it in the conf file rewrite/thinkphp.conf
Add code below into conf file:
include enable-php-pathinfo.conf;
location /
{
try_files $uri $uri/ /index.php?s=$uri&$args;
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=/$1 last;
break;
}
}
base_dir
There are 3 possible conf files to change base_dir setting. nginx/conf/fastcgi.conf
、php.ini
、.user.ini
Comment the base_dir setting in fastcgi.conf can solve it.
.htaccess
Forbidden the access of .htaccess in file vhost/.conf
.
location ~ /\.ht
{
deny all;
}