安装Linux Dash小记
服务器操作系统及环境:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
CentOS release 6.4 (Final) lnmp 1.2 {php 5.5} 第一步:安装epel {参考:<a href="http://www.80000s.com/2015/10/01/%e5%a6%82%e4%bd%95%e5%9c%a8centos-56%e4%b8%8a%e5%ae%89%e8%a3%85epel-%e6%ba%90/" target="_blank">如何在CentOS 5/6上安装EPEL 源</a>} 第二步:cd /usr/local/php/etc 第三步:修改php.ini ,将 disable_functions 中的三个函数删除e<code>xec</code>, <code>shell_exec</code>, and <code>escapeshellarg 第四部:cd /data/home{你的web目录} ,执行:</code><code><span class="pln">git clone https</span><span class="pun">:</span><span class="com">//github.com/afaqurk/linux-dash.git 下载源码。 第五步: sudo cp -r linux-dash/ /data/home/linux-dash {将下载的文件转移到指定目录} sudo chown -R www:www /data/home {www设置权限} chmod -R 0755 /data/home/linux-dash {把该目录设置为0755,应该还有更严禁的权限设计,这里我就不深入} </span> |
1 2 3 4 5 |
第六步:添加一个虚拟站点 cd /usr/local/nginx/conf/vhost ,然后 vim linuxdash.conf {虚拟主机配置如下:蓝色字体是需要你自己设置的} |
[sourcecode language=”plain”]
server
{
listen 80;
#listen [::]:80;
server_name <span style="color: #0000ff;">你的域名</span>;
index index.html index.htm index.php default.html default.htm default.php;
root <span style="color: #0000ff;">/data/home/linux-dash</span>;
include none.conf;
#error_page 404 /404.html;
location ~* \.(?:xml|ogg|mp3|mp4|ogv|svg|svgz|eot|otf|woff|ttf|css|js|jpg|jpeg|gif|png|ico)$ {
try_files $uri =404;
expires max;
access_log off;
add_header Pragma public;
add_header Cache-Control "public, must-revalidate, proxy-revalidate";
}
location /linux-dash {
index index.html index.php;
}
location ~ [^/]\.php(/|$)
{
# comment try_files $uri =404; to enable pathinfo
try_files $uri =404;
fastcgi_pass unix:/tmp/php-cgi.sock;
fastcgi_index index.php;
include fastcgi.conf;
#include pathinfo.conf;
}
access_log <span style="color: #0000ff;">/home/wwwlogs/centos.log</span> access;
}
[/sourcecode]
第七步:添加完执行:/usr/local/nginx/sbin/nginx -t测试配置文件,执行:/usr/local/nginx/sbin/nginx -s reload 载入配置文件使其生效。
1 |
<span style="color: #ff0000;"><code>注意:因为开启了exec等危险的函数,所以一定要注意设置好安全防范。?</code></span> |
噢!评论已关闭。