При установке на VPS - ошибки Mongo
-
при проверке статуса Монго выдает такое
root@vps-33479:~# sudo systemctl status mongod
● mongod.service - MongoDB Database Server
Loaded: loaded (/lib/systemd/system/mongod.service; disabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Wed 2020-04-01 21:33:47 EEST; 11s ago
Docs: https://docs.mongodb.org/manual
Process: 24605 ExecStart=/usr/bin/mongod --config /etc/mongod.conf (code=exited, status=2)
Main PID: 24605 (code=exited, status=2)Apr 01 21:33:47 vps-33479.vps-default-host.net systemd[1]: Started MongoDB Database Server.
Apr 01 21:33:47 vps-33479.vps-default-host.net mongod[24605]: Error parsing YAML config file: yaml-cpp: error at line 11, column 4: end of map
Apr 01 21:33:47 vps-33479.vps-default-host.net mongod[24605]: try '/usr/bin/mongod --help' for more information
Apr 01 21:33:47 vps-33479.vps-default-host.net systemd[1]: mongod.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Apr 01 21:33:47 vps-33479.vps-default-host.net systemd[1]: mongod.service: Failed with result 'exit-code'.# mongod.conf # for documentation of all options, see: # http://docs.mongodb.org/manual/reference/configuration-options/ # Where and how to store data. storage: dbPath: /var/lib/mongodb journal: enabled: true engine: wiredTiger # mmapv1: # wiredTiger: # where to write logging data. systemLog: destination: file logAppend: true path: /var/log/mongodb/mongod.log # network interfaces net: port: 27017 bindIp: 0.0.0.0 # how the process runs processManagement: timeZoneInfo: /usr/share/zoneinfo security: authorization: enabled #operationProfiling: #replication: #sharding: ## Enterprise-Only Options:
-
В общем было две проблемы.
- По какой-то причине при запросе по домену Nginx не смотрел локальный IP-адрес. Возможно на сервере включен IPv6. Решение:
В конфиге Nginx убрать IP-адрес, чтобы получилось:
server { listen 80; ...
- Была PHP-ошибка, которая говорила что-то вроде "При подключении к MongoDB нужен username". В этом случае открываем файл "/config/parameters.yaml" и вводим значение "root" (username по умолчанию) в параметре "mongodb_user". После этого удаляем папку кэша "/var/cache/prod".
Но эту проблему я постараюсь изучить и исправить.
- По какой-то причине при запросе по домену Nginx не смотрел локальный IP-адрес. Возможно на сервере включен IPv6. Решение:
-
@Alex18
Пишите в ЛС. -
@Admin давайте я дам доступ через TeamVieawer
-
Пользователь @Admin написал в При установке на VPS - ошибки Mongo:
rm -rf /var/www/freyamebel/var/cache/prod
root@vps-33479:~# cat /var/www/freyamebel/var/log/prod.log cat: /var/www/freyamebel/var/log/prod.log: No such file or directory root@vps-33479:~# rm -rf /var/www/freyamebel/var/cache/prod root@vps-33479:~# /etc/init.d/nginx restart [ ok ] Restarting nginx (via systemctl): nginx.service. root@vps-33479:~#
-
cat /var/www/freyamebel/var/log/prod.log
Что показывает?
Кэш чистили?
rm -rf /var/www/freyamebel/var/cache/prod
-
Пользователь @Admin написал в При установке на VPS - ошибки Mongo:
/etc/init.d/php7.3-fpm status
root@vps-33479:~# /etc/init.d/php7.3-fpm status ● php7.3-fpm.service - The PHP 7.3 FastCGI Process Manager Loaded: loaded (/lib/systemd/system/php7.3-fpm.service; enabled; vendor preset: enabled) Active: active (running) since Wed 2020-04-01 21:07:07 EEST; 1 weeks 2 days ago Docs: man:php-fpm7.3(8) Main PID: 23257 (php-fpm7.3) Status: "Processes active: 0, idle: 2, Requests: 142, slow: 0, Traffic: 0req/sec" Tasks: 3 (limit: 2313) CGroup: /system.slice/php7.3-fpm.service ├─23257 php-fpm: master process (/etc/php/7.3/fpm/php-fpm.conf) ├─23277 php-fpm: pool www └─23278 php-fpm: pool www Apr 01 21:07:07 vps-33479.vps-default-host.net systemd[1]: php7.3-fpm.service: Failed with result 'core-dump'. Apr 01 21:07:07 vps-33479.vps-default-host.net systemd[1]: Stopped The PHP 7.3 FastCGI Process Manager. Apr 01 21:07:07 vps-33479.vps-default-host.net systemd[1]: Starting The PHP 7.3 FastCGI Process Manager... Apr 01 21:07:07 vps-33479.vps-default-host.net systemd[1]: Started The PHP 7.3 FastCGI Process Manager. root@vps-33479:~#
-
/etc/init.d/php7.3-fpm status
?
-
root@vps-33479:~# ls /etc/php 5.6 7.0 7.1 7.2 7.3 7.4 root@vps-33479:~# ls /etc/php/7.3 cli fpm mods-available root@vps-33479:~#
-
ls /etc/php
ls /etc/php/7.3
Что показывает?
-
Пользователь @Admin написал в При установке на VPS - ошибки Mongo:
ls /var/www/freyamebel/public
root@vps-33479:~# ls /var/www/freyamebel/public admin app_build bundles check.php css favicon.ico img index.php js node_modules package.json uploads webpack.config.js root@vps-33479:~#
-
ls /var/www/freyamebel/public
Что показывает?
-
Пользователь @Admin написал в При установке на VPS - ошибки Mongo:
chmod -R 0775 /var/www/freyamebel
2020/04/10 20:34:59 [error] 28106#28106: *7 FastCGI sent in stderr: "Unable to open primary script: /index.php (No such file or directory)" while reading response header from upstream, client: 91.242.192.156, server: freyamebel.com, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.3-fpm.sock:", host: "freyamebel.com" root@vps-33479:~# chown -R www-data:www-data /var/www/freyamebel root@vps-33479:~# chmod -R 0775 /var/www/freyamebel root@vps-33479:~# /etc/init.d/nginx restart [ ok ] Restarting nginx (via systemctl): nginx.service. root@vps-33479:~#
пока ничего не изменилось
Не удается получить доступ к сайту
Сайт freyamebel.com не позволяет установить соединение. -
Рестарт произошел удачно, ошибок не было?
cat /var/log/nginx/shopkeeper4_error.log
Что в ответе?
Ещё надо сделать так:
chown -R www-data:www-data /var/www/freyamebel
chmod -R 0775 /var/www/freyamebel
-
Пользователь @Admin написал в При установке на VPS - ошибки Mongo:
/etc/init.d/nginx restart
Не удается получить доступ к сайтуСайт freyamebel.com не позволяет установить соединение.
Попробуйте сделать следующее:Проверьте подключение к Интернету.
Проверьте настройки прокси-сервера и брандмауэра.
ERR_CONNECTION_REFUSED -
Сделайте так:
rm /etc/nginx/sites-enabled/default
/etc/init.d/nginx restart
-
@Admin это на 1 и 2 команд
root@vps-33479:~# ls /etc/nginx/sites-available/ default shopkeeper4.conf root@vps-33479:~# ls /var/www/freyamebel bin changelog.txt composer.json config frontend public shopker-4.1.6.zip src templates translations var vendor
а это на 3
root@vps-33479:~# cat /etc/nginx/sites-available/default ## # You should look at the following URL's in order to grasp a solid understanding # of Nginx configuration files in order to fully unleash the power of Nginx. # https://www.nginx.com/resources/wiki/start/ # https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/ # https://wiki.debian.org/Nginx/DirectoryStructure # # In most cases, administrators will remove this file from sites-enabled/ and # leave it as reference inside of sites-available where it will continue to be # updated by the nginx packaging team. # # This file will automatically load configuration files provided by other # applications, such as Drupal or Wordpress. These applications will be made # available underneath a path with that package name, such as /drupal8. # # Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples. ## # Default server configuration # server { listen 80 default_server; listen [::]:80 default_server; # SSL configuration # # listen 443 ssl default_server; # listen [::]:443 ssl default_server; # # Note: You should disable gzip for SSL traffic. # See: https://bugs.debian.org/773332 # # Read up on ssl_ciphers to ensure a secure configuration. # See: https://bugs.debian.org/765782 # # Self signed certs generated by the ssl-cert package # Don't use them in a production server! # # include snippets/snakeoil.conf; root /var/www/html; # Add index.php to the list if you are using PHP index index.html index.htm index.nginx-debian.html; server_name _; location / { # First attempt to serve request as file, then # as directory, then fall back to displaying a 404. try_files $uri $uri/ =404; } # pass PHP scripts to FastCGI server # #location ~ \.php$ { # include snippets/fastcgi-php.conf; # # # With php-fpm (or other unix sockets): # fastcgi_pass unix:/var/run/php/php7.0-fpm.sock; # # With php-cgi (or other tcp sockets): # fastcgi_pass 127.0.0.1:9000; #} # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # #location ~ /\.ht { # deny all; #} } # Virtual Host configuration for example.com # # You can move that to a different file under sites-available/ and symlink that # to sites-enabled/ to enable it. # #server { # listen 80; # listen [::]:80; # # server_name example.com; # # root /var/www/example.com; # index index.html; # # location / { # try_files $uri $uri/ =404; # } #}
-
ls /etc/nginx/sites-available
ls /var/www/freyamebel
cat /etc/nginx/sites-available/default
Покажите что выводят эти команды.
-
Пользователь @Admin написал в При установке на VPS - ошибки Mongo:
/etc/init.d/nginx restart
root@vps-33479:~# ln -s /etc/nginx/sites-available/shopkeeper4.conf /etc/nginx/sites-enabled/shopkeeper4.conf ln: failed to create symbolic link '/etc/nginx/sites-enabled/shopkeeper4.conf': File exists root@vps-33479:~# /etc/init.d/nginx restart [ ok ] Restarting nginx (via systemctl): nginx.service. root@vps-33479:~#
такие файлы созданы
-
ln -s /etc/nginx/sites-available/shopkeeper4.conf /etc/nginx/sites-enabled/shopkeeper4.conf
Это сделали? Nginx рестартнули после этого?
/etc/init.d/nginx restart