Created
February 10, 2014 03:22
-
-
Save sergeifilippov/8909839 to your computer and use it in GitHub Desktop.
linux-dash with nginx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
server_name $domain_name; | |
root /var/www; | |
index index.html index.php; | |
access_log /var/log/nginx/access.log; | |
error_log /var/log/nginx/error.log; | |
# Cache static files for as long as possible | |
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"; | |
} | |
# if hosting in a sub folder, setup a new location | |
# replace `/linus-dash` with the folder name eg. `/folder_name` | |
#location /linux-dash { | |
# index index.html index.php; | |
#} | |
# Pass PHP requests on to PHP-FPM using sockets | |
location ~ \.php(/|$) { | |
fastcgi_split_path_info ^(.+?\.php)(/.*)$; | |
fastcgi_pass unix:/run/php5-fpm.sock; | |
# fastcgi_pass localhost:9000; # using TCP/IP stack | |
if (!-f $document_root$fastcgi_script_name) { | |
return 404; | |
} | |
try_files $uri $uri/ /index.php?$args; | |
include fastcgi_params; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Dependecies | |
+ nginx | |
+ php-fpm | |
+ php5-curl | |
1. Install `php-fpm` and configura to use either `sockets` or `TCP/IP` | |
2. Create a nginx configuration (`eg. domain_name.conf`) in `/etc/nginx/conf.d/` |
My config:
upstream php5-fpm-sock { server unix:/var/run/php5-fpm.sock; } server { server_name dash.domain.com; listen 80; root /usr/share/nginx/html/linux-dash; index index.php index.html module.php; access_log /var/log/nginx/linux-dash-access.log; error_log /var/log/nginx/linux-dash-error.log; location ~ \.php$ { try_files $uri =404; root /usr/share/nginx/html/linux-dash; fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } }
Works fine!
How can i enable
-exec
-shell_exec
-escapeshellarg
for linux-dash?
How can i enable
-exec
-shell_exec
-escapeshellargfor linux-dash?
first: vim /usr/local/php/etc/php.ini
second: find this word disable_functions
I can see the webpage produced by Dash, but there is no data in any of the boxes.
My set up is on a RPi 5. I am using Nginx
Here is my nginx config:
server {
listen 80 default_server;
listen [::]:80 default_server;
autoindex on;
root /var/www/html;
index index.html index.htm index.php;
server_name silver;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
}
location /dash {
index index.html index.php;
}
# pass PHP scripts to FastCGI server
#
location ~ \.php$ {
include snippets/fastcgi-php.conf;
#
# # With php-fpm (or other unix sockets):
#fastcgi_pass unix:/run/php/php7.4-fpm.sock;
fastcgi_pass unix:/run/php/php8.2-fpm.sock;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $realpath_root;
fastcgi_param HTTPS off;
fastcgi_read_timeout 1000;
include fastcgi_params;
# # With php-cgi (or other tcp sockets):
# fastcgi_pass 127.0.0.1:9000;
}
}
In /var/www/ the /html is a link:
lrwxrwxrwx 1 root root 32 Mar 29 13:28 html -> /S3TB/data/share/Documents/HTML/
and /dash can be found in that directory
drwxrwxr-x 5 james janda 4096 Apr 1 14:17 dash
I am assuming that the problem is with my nginx configuration for the location of dash.
Any help would be appreciated.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Has anyone tried to get this to work with the new setup? I can't seem to give it access to the modules directory...