boez Posted April 3, 2018 Share Posted April 3, 2018 Решил запустить на Keenetic Omni II web server c DokuWiki. Исходные данные: 1. Архив Entware нашел в этой теме 2. Установленные пакеты: Скрытый текст ~ # opkg list-installed busybox - 1.27.2-3c dropbear - 2017.75-5 entware-release - 1.0-2 findutils - 4.6.0-1 glib2 - 2.55.1-1 grep - 2.26-1 ldconfig - 2.27-8 libattr - 20170915-1 libblkid - 2.30.2-2 libbz2 - 1.0.6-3 libc - 2.27-8 libcurl - 7.58.0-1 libffi - 3.2.1-3 libfreetype - 2.9-1 libgcc - 7.3.0-8 libiconv-full - 1.11.1-3 libintl-full - 0.19.8.1-1 libjpeg - 9a-1 liblua - 5.1.5-1 libmariadb - 5.5.58-1 libmbedtls - 2.6.0-1 libmount - 2.30.2-2 libncurses - 6.1-1 libncursesw - 6.1-1 libndm - 1.8.0-1 libopenssl - 1.0.2n-1b libpcre - 8.41-2 libpng - 1.6.34-1 libpthread - 2.27-8 libreadline - 7.0-1 librt - 2.27-8 libslang2 - 2.3.1a-1 libssh2 - 1.8.0-1 libssp - 7.3.0-8 libstdcpp - 7.3.0-8 libuuid - 2.30.2-2 libxml2 - 2.9.7-1 locales - 2.27-8 mc - 4.8.20-1 ndmq - 1.0.2-3 nginx - 1.12.2-1 opkg - 2011-04-08-9c97d5ec-17b opt-ndmsv2 - 1.0-10a php7 - 7.2.2-1 php7-cgi - 7.2.2-1 php7-fastcgi - 7.2.2-1 php7-fpm - 7.2.2-1 php7-mod-ctype - 7.2.2-1 php7-mod-curl - 7.2.2-1 php7-mod-dom - 7.2.2-1 php7-mod-exif - 7.2.2-1 php7-mod-fileinfo - 7.2.2-1 php7-mod-gd - 7.2.2-1 php7-mod-gettext - 7.2.2-1 php7-mod-hash - 7.2.2-1 php7-mod-iconv - 7.2.2-1 php7-mod-json - 7.2.2-1 php7-mod-mbstring - 7.2.2-1 php7-mod-mysqli - 7.2.2-1 php7-mod-pdo - 7.2.2-1 php7-mod-pdo-mysql - 7.2.2-1 php7-mod-session - 7.2.2-1 php7-mod-simplexml - 7.2.2-1 php7-mod-sockets - 7.2.2-1 php7-mod-xml - 7.2.2-1 php7-mod-xmlreader - 7.2.2-1 php7-mod-xmlwriter - 7.2.2-1 php7-mod-zip - 7.2.2-1 terminfo - 6.1-1 zlib - 1.2.11-2 zoneinfo-asia - 2018c-1 zoneinfo-europe - 2018c-1 Мой nginx.conf Скрытый текст user nobody; worker_processes 1; #error_log /opt/var/log/nginx/error.log; #error_log /opt/var/log/nginx/error.log notice; #error_log /opt/var/log/nginx/error.log info; #pid /opt/var/run/nginx.pid; events { worker_connections 64; } http { include mime.types; default_type application/octet-stream; #log_format main '$remote_addr - $remote_user [$time_local] "$request" ' # '$status $body_bytes_sent "$http_referer" ' # '"$http_user_agent" "$http_x_forwarded_for"'; #access_log /opt/var/log/nginx/access.log main; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; #gzip on; server { listen 192.168.1.1:81; server_name doku.5.mykeenetic.kz www.doku.5.mykeenetic.kz; #server_name 192.168.1.1; autoindex off; client_max_body_size 15M; client_body_buffer_size 128k; index index.html index.htm index.php doku.php; root /opt/share/nginx/html/dokuwiki; location / { try_files $uri $uri/ @dokuwiki; } location ~ ^/lib.*\.(gif|png|ico|jpg)$ { expires 30d; } location = /robots.txt { access_log off; log_not_found off; } location = /favicon.ico { access_log off; log_not_found off; } location ~ /\. { access_log off; log_not_found off; deny all; } location ~ ~$ { access_log off; log_not_found off; deny all; } location @dokuwiki { rewrite ^/_media/(.*) /lib/exe/fetch.php?media=$1 last; rewrite ^/_detail/(.*) /lib/exe/detail.php?media=$1 last; rewrite ^/_export/([^/]+)/(.*) /doku.php?do=export_$1&id=$2 last; rewrite ^/(.*) /doku.php?id=$1 last; } location ~ \.php$ { root /opt/share/nginx/html/dokuwiki; fastcgi_pass 192.168.1.1:9200; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; #fastcgi_param PATH_INFO /scripts$fastcgi_script_name; #necessary for URL rewrite include fastcgi_params; fastcgi_intercept_errors on; fastcgi_ignore_client_abort off; fastcgi_connect_timeout 60; fastcgi_send_timeout 180; fastcgi_read_timeout 180; fastcgi_buffer_size 128k; fastcgi_buffers 4 256k; fastcgi_busy_buffers_size 256k; fastcgi_temp_file_write_size 256k; } location ~ /(data|conf|bin|inc)/ { deny all; } location ~ /\.ht { deny all; } } } В результате веб сервер и dokuwiki запускаются, но страницы грузятся без стилей, голые. Очень неудобно пользоваться. Вопрос в следующем, что я сделал не так или вообще не сделал? Подскажите где найти информацию. Предполагаю, что некорректно настроены права доступа к папкам dokuwiki, потому-что смог запустить сайт только после экспериментов с правами доступа к папке dokuwiki. Quote Link to comment Share on other sites More sharing options...
TheBB Posted April 4, 2018 Share Posted April 4, 2018 В 03.04.2018 в 19:14, boez сказал: В результате веб сервер и dokuwiki запускаются, но страницы грузятся без стилей, голые... стиль у неё "спартанский". В 03.04.2018 в 19:14, boez сказал: ...Подскажите где найти информацию... на сайте проектов dokuwiki, nginx, php В 03.04.2018 в 19:14, boez сказал: ... некорректно настроены права доступа... совсем не настраивал (т.е., абсолютно, просто распаковал архив) В 03.04.2018 в 19:14, boez сказал: Вопрос в следующем, что я сделал не так или вообще не сделал? перестарались с конфигом. зачем надо было так усложнять? для домашнего пользования хватило б неск. правок дефолтного конфига nginx (хотя и с Вашим запустилось, ну-у, почти... сменил для php с порта прослушки на сокет, поменял порт сервера, поменял путь для root... ). Скрытый текст user nobody; worker_processes 1; #error_log /opt/var/log/nginx/error.log; #error_log /opt/var/log/nginx/error.log notice; #error_log /opt/var/log/nginx/error.log info; pid /opt/var/run/nginx.pid; events { worker_connections 64; } http { include mime.types; default_type application/octet-stream; #log_format main '$remote_addr - $remote_user [$time_local] "$request" ' # '$status $body_bytes_sent "$http_referer" ' # '"$http_user_agent" "$http_x_forwarded_for"'; #access_log /opt/var/log/nginx/access.log main; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; #gzip on; server { listen 88; # server_name doku.5.mykeenetic.kz www.doku.5.mykeenetic.kz; #server_name 192.168.1.1; autoindex off; client_max_body_size 15M; client_body_buffer_size 128k; index index.html index.htm index.php doku.php; root /opt/share/www; location / { try_files $uri $uri/ @dokuwiki; } location ~ ^/lib.*\.(gif|png|ico|jpg)$ { expires 30d; } location = /robots.txt { access_log off; log_not_found off; } location = /favicon.ico { access_log off; log_not_found off; } location ~ /\. { access_log off; log_not_found off; deny all; } location ~ ~$ { access_log off; log_not_found off; deny all; } location @dokuwiki { rewrite ^/_media/(.*) /lib/exe/fetch.php?media=$1 last; rewrite ^/_detail/(.*) /lib/exe/detail.php?media=$1 last; rewrite ^/_export/([^/]+)/(.*) /doku.php?do=export_$1&id=$2 last; rewrite ^/(.*) /doku.php?id=$1 last; } location ~ \.php$ { root /opt/share/www; fastcgi_pass unix:/var/run/php-fcgi.sock; fastcgi_index index.php; include fastcgi_params; fastcgi_intercept_errors on; fastcgi_ignore_client_abort off; fastcgi_connect_timeout 60; fastcgi_send_timeout 180; fastcgi_read_timeout 180; fastcgi_buffer_size 128k; fastcgi_buffers 4 256k; fastcgi_busy_buffers_size 256k; fastcgi_temp_file_write_size 256k; } location ~ /(data|conf|bin|inc)/ { deny all; } location ~ /\.ht { deny all; } } } Quote Link to comment Share on other sites More sharing options...
boez Posted April 5, 2018 Author Share Posted April 5, 2018 (edited) 8 часов назад, TheBB сказал: перестарались с конфигом. зачем надо было так усложнять? для домашнего пользования хватило б неск. правок дефолтного конфига nginx (хотя и с Вашим запустилось, ну-у, почти... сменил для php с порта прослушки на сокет, поменял порт сервера, поменял путь для root... ). Да, я не программист ни в коем разе. Просто есть роутер и желание запустить свой сайт. ))) С правками дефолтного конфига у меня не получалось запустить приложение, Nginx запускался. Вот и нашел инструкцию https://www.nginx.com/resources/wiki/start/topics/recipes/dokuwiki/. Проблемы с отображением стилей бывают видимо при несовместимости версий nginx+php+dokuwiki. Обсуждалось здесь Снесу php7 и попробую на php5 запустить. Подскажите какой комплект пакетов нужно установить? Может быть я здесь накосячил... Скрытый текст opkg install php7-fpm php7-mod-ctype php7-mod-curl php7-mod-dom \ php7-mod-exif php7-mod-fileinfo php7-mod-gd php7-mod-gettext php7-mod-hash \ php7-mod-iconv php7-mod-json php7-mod-mbstring php7-mod-mcrypt php7-mod-mysqli \ php7-mod-pdo-mysql php7-mod-session php7-mod-simplexml php7-mod-sockets \ php7-mod-xml php7-mod-xmlreader php7-mod-xmlwriter php7-mod-zip php7-fastcgi Edited April 5, 2018 by boez Quote Link to comment Share on other sites More sharing options...
TheBB Posted April 5, 2018 Share Posted April 5, 2018 5 часов назад, boez сказал: ... Просто есть роутер и желание запустить свой сайт... если "для дома, для семьи", то мне хватило нижеследующего конфига nginx (только ради тестирования). если для "выхода в свет", надо схему усложнять (постепенно, шаг за шагом). Скрытый текст user nobody; worker_processes 1; events { worker_connections 64; } http { include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; server { listen 81; location / { root /opt/share/www; index index.php index.html index.htm; } #error_page 404 /404.html; # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root /opt/share/nginx/html; } location ~ \.php$ { root /opt/share/www; fastcgi_pass unix:/var/run/php-fcgi.sock; fastcgi_index index.php; include fastcgi_params; } } } 5 часов назад, boez сказал: ... Снесу php7 и попробую на php5 запустить... плохая идея, т.к. в Entware, php5 "выведен из строя". тогда стоит смотреть в сторону Debian. 5 часов назад, boez сказал: ... Подскажите какой комплект пакетов нужно установить? Может быть я здесь накосячил... сойдёт. а, т.к. у меня уже стояла "доп. морда" (пакет "ext-ui-nginx-7"), ею и воспользовался, заменив конфиг на дефолтный и подправив его. Quote Link to comment Share on other sites More sharing options...
boez Posted April 5, 2018 Author Share Posted April 5, 2018 8 часов назад, TheBB сказал: сойдёт. а, т.к. у меня уже стояла "доп. морда" (пакет "ext-ui-nginx-7"), ею и воспользовался, заменив конфиг на дефолтный и подправив его. Установил пакет "ext-ui-nginx-7", конфиг взял ваш (последний) и вот, что выдает при запуске и нажатии на ту или иную кнопку кроме терминала, NDMS и справки: Папку с программой закинул сюда: /opt/share/www На запрос http://192.168.1.1:81/doku.php получаю ответ как на втором скрине. Quote Link to comment Share on other sites More sharing options...
TheBB Posted April 5, 2018 Share Posted April 5, 2018 упс... в файле `/opt/etc/init.d/S79php-fcgi` надо путь к сокету сменить, как в конфиге сервера nginx ARGS="-b /var/run/php-fcgi.sock &" или в конфиге сервера прописать правильный путь, как в файле `S79php-fcgi`, т.е. fastcgi_pass unix:/opt/var/run/php-fcgi.sock; Quote Link to comment Share on other sites More sharing options...
boez Posted April 6, 2018 Author Share Posted April 6, 2018 11 час назад, TheBB сказал: или в конфиге сервера прописать правильный путь, как в файле `S79php-fcgi`, т.е. fastcgi_pass unix:/opt/var/run/php-fcgi.sock; Прописал. Не помогло. Указал в конфиге конкретно путь до папки dokuwiki location / { root /opt/share/www/dokuwiki; и здесь location ~ \.php$ { root /opt/share/www/dokuwiki; После этого на запрос http://192.168.1.1:81/doku.php, открывается страничка, но без стилей. Такое ощущение, что php не видит файловую структуру папок и файлов... Quote Link to comment Share on other sites More sharing options...
TheBB Posted April 6, 2018 Share Posted April 6, 2018 значит надо включать в php.ini логирование ошибок, если не включено, и смотреть вывод. ... log_errors = On ... error_log = /opt/var/log/php_errors.log ... да и вывод ошибок сервера не помешает глянуть Quote Link to comment Share on other sites More sharing options...
boez Posted April 6, 2018 Author Share Posted April 6, 2018 (edited) 3 часа назад, TheBB сказал: значит надо включать в php.ini логирование ошибок, если не включено, и смотреть вывод. Включил логирование ошибок и поменял обратно в конфиге адрес на: root /opt/share/www/ . Лог по адресу /opt/var/log/php_errors.log не появился. Но теперь загружается Extended User Interface и работает. страница DokuWiki загружается только если зайти по адресу http://192.168.1.1:81/dokuwiki/doku.php. Загружается также без стилей Лог сервера Скрытый текст .... 2018/04/06 07:29:31 [crit] 29173#0: *1 connect() to unix:/opt/var/run/php-fcgi.sock failed (2: No such file or directory) while connecting to upstream, client: 192.168.1.19, server: , request: "GET /doku.php HTTP/1.1", upstream: "fastcgi://unix:/opt/var/run/php-fcgi.sock:", host: "192.168.1.1:81" 2018/04/06 07:29:48 [crit] 29173#0: *1 connect() to unix:/opt/var/run/php-fcgi.sock failed (2: No such file or directory) while connecting to upstream, client: 192.168.1.19, server: , request: "GET /addons/phpinfo.php HTTP/1.1", upstream: "fastcgi://unix:/opt/var/run/php-fcgi.sock:", host: "192.168.1.1:81", referrer: "http://192.168.1.1:81/menu.html" 2018/04/06 07:38:45 [crit] 29173#0: *9 connect() to unix:/opt/var/run/php-fcgi.sock failed (2: No such file or directory) while connecting to upstream, client: 192.168.1.19, server: , request: "GET /addons/phpinfo.php HTTP/1.1", upstream: "fastcgi://unix:/opt/var/run/php-fcgi.sock:", host: "192.168.1.1:81", referrer: "http://192.168.1.1:81/menu.html" 2018/04/06 07:38:59 [crit] 29173#0: *9 connect() to unix:/opt/var/run/php-fcgi.sock failed (2: No such file or directory) while connecting to upstream, client: 192.168.1.19, server: , request: "GET /doku.php HTTP/1.1", upstream: "fastcgi://unix:/opt/var/run/php-fcgi.sock:", host: "192.168.1.1:81" 2018/04/06 07:44:53 [crit] 29173#0: *12 connect() to unix:/opt/var/run/php-fcgi.sock failed (2: No such file or directory) while connecting to upstream, client: 192.168.1.19, server: , request: "GET /addons/phpinfo.php HTTP/1.1", upstream: "fastcgi://unix:/opt/var/run/php-fcgi.sock:", host: "192.168.1.1:81", referrer: "http://192.168.1.1:81/menu.html" 2018/04/06 07:44:55 [crit] 29173#0: *12 connect() to unix:/opt/var/run/php-fcgi.sock failed (2: No such file or directory) while connecting to upstream, client: 192.168.1.19, server: , request: "GET /addons/php.php HTTP/1.1", upstream: "fastcgi://unix:/opt/var/run/php-fcgi.sock:", host: "192.168.1.1:81", referrer: "http://192.168.1.1:81/menu.html" 2018/04/06 07:45:16 [crit] 29173#0: *12 connect() to unix:/opt/var/run/php-fcgi.sock failed (2: No such file or directory) while connecting to upstream, client: 192.168.1.19, server: , request: "GET /doku.php HTTP/1.1", upstream: "fastcgi://unix:/opt/var/run/php-fcgi.sock:", host: "192.168.1.1:81" 2018/04/06 07:45:41 [crit] 29173#0: *12 connect() to unix:/opt/var/run/php-fcgi.sock failed (2: No such file or directory) while connecting to upstream, client: 192.168.1.19, server: , request: "GET /doku.php HTTP/1.1", upstream: "fastcgi://unix:/opt/var/run/php-fcgi.sock:", host: "192.168.1.1:81" 2018/04/06 07:45:43 [crit] 29173#0: *12 connect() to unix:/opt/var/run/php-fcgi.sock failed (2: No such file or directory) while connecting to upstream, client: 192.168.1.19, server: , request: "GET /doku.php HTTP/1.1", upstream: "fastcgi://unix:/opt/var/run/php-fcgi.sock:", host: "192.168.1.1:81" 2018/04/06 07:46:07 [notice] 562#0: signal process started 2018/04/06 07:46:15 [crit] 565#0: *1 connect() to unix:/opt/var/run/php-fcgi.sock failed (2: No such file or directory) while connecting to upstream, client: 192.168.1.19, server: , request: "GET /addons/phpinfo.php HTTP/1.1", upstream: "fastcgi://unix:/opt/var/run/php-fcgi.sock:", host: "192.168.1.1:81", referrer: "http://192.168.1.1:81/menu.html" 2018/04/06 07:46:26 [crit] 565#0: *1 connect() to unix:/opt/var/run/php-fcgi.sock failed (2: No such file or directory) while connecting to upstream, client: 192.168.1.19, server: , request: "GET /info.php HTTP/1.1", upstream: "fastcgi://unix:/opt/var/run/php-fcgi.sock:", host: "192.168.1.1:81" 2018/04/06 07:48:25 [notice] 1091#0: signal process started 2018/04/06 09:23:27 [emerg] 22126#0: invalid number of arguments in "fastcgi_pass" directive in /opt/etc/nginx/nginx.conf:35 2018/04/06 10:42:24 [notice] 7143#0: signal process started 2018/04/06 10:49:09 [notice] 8728#0: signal process started 2018/04/06 12:07:53 [notice] 26199#0: signal process started 2018/04/06 12:29:29 [notice] 31008#0: signal process started 2018/04/06 12:32:38 [notice] 31713#0: signal process started 2018/04/06 13:13:58 [notice] 8445#0: signal process started Запущенные сервисы Edited April 6, 2018 by boez Quote Link to comment Share on other sites More sharing options...
TheBB Posted April 6, 2018 Share Posted April 6, 2018 Как не старался, повторить не удалось (и стили, и картинки, и... всё на месте). Даже с php-fpm запустилось и работает. Какая ФС на флешке/диске? Quote Link to comment Share on other sites More sharing options...
boez Posted April 6, 2018 Author Share Posted April 6, 2018 Диск SSD на 255Gb. ФС Ext4. Quote Link to comment Share on other sites More sharing options...
TheBB Posted April 7, 2018 Share Posted April 7, 2018 тогда совсем "печально"... остаётся проверить в разных браузерах (с "обвесом" из расширений и дополнений и без оных) или "раскатать" систему заново, установить и настроить, и "запечатать" в архив для установки. Quote Link to comment Share on other sites More sharing options...
boez Posted April 7, 2018 Author Share Posted April 7, 2018 (edited) Удалось запустить программу, после того как снес все и выполнил только установку сервера и пакетов php7 Скрытый текст opkg install php7-fpm php7-mod-ctype php7-mod-curl php7-mod-dom \ php7-mod-exif php7-mod-fileinfo php7-mod-gd php7-mod-gettext php7-mod-hash \ php7-mod-iconv php7-mod-json php7-mod-mbstring php7-mod-mcrypt php7-mod-mysqli \ php7-mod-pdo-mysql php7-mod-session php7-mod-simplexml php7-mod-sockets \ php7-mod-xml php7-mod-xmlreader php7-mod-xmlwriter php7-mod-zip php7-fastcgi ext-ui-nginx-7 php7-mod-mcrypt не установился. Видимо его в комплекте нет. Конфиг Скрытый текст user nobody; worker_processes 1; events { worker_connections 64; } http { include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; server { listen 81; location / { root /opt/share/www; index doku.php index.php index.html index.htm; } #error_page 404 /404.html; # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root /opt/share/nginx/html; } location ~ \.php$ { root /opt/share/www; fastcgi_pass unix:/opt/var/run/php-fcgi.sock; fastcgi_index index.php; include fastcgi_params; } } } дополнительные настройки которые рекомендовались в соседних темах, не делал. Правда работает dokuwiki на самых облегченных плагинах. С родным плагином все так же не загружаются стили. Думаю или "железо" не тянет или я чего то не допоставил из php Edited April 7, 2018 by boez Quote Link to comment Share on other sites More sharing options...
TheBB Posted April 7, 2018 Share Posted April 7, 2018 в OpenWRT: Цитата php7: update to 7.2.0 Also drop mcrypt module as it's deprecated. соотв., в Entware также. Вот теперь, когда запустилось, можно и усложнять схему (постепенно). Quote Link to comment Share on other sites More sharing options...
boez Posted April 7, 2018 Author Share Posted April 7, 2018 33 минуты назад, TheBB сказал: в OpenWRT: Киньте пж-та ссылку на инструкцию как это сделать. И еще вопрос, как ограничить доступ к Extended User Interface при подключении с "улицы" ? А то на одном порту сидят с doku и все на распашку. Quote Link to comment Share on other sites More sharing options...
TheBB Posted April 9, 2018 Share Posted April 9, 2018 вопрос совместного использования доп. "морды" с разл. движками не рассматривался. у ext-ui есть вкладка для включения защиты, но при таких настройках может не работать, т.к. конфиг состоит из 2-х частей (осн. лежит в /opt/etc/nginx/ доп. лежат в /opt/share/www/addons/passwd/) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.