Closed TimoHess closed 4 years ago
Hm, I have no experience with installing a Laravel app in a sub-folder.
Could you post the value for APP_URL
in your .env
-file?
I think this should be domain.tld/screeenly
.
The npm install
problem seems to be permission based.
permission denied, mkdir '/var/www/screeenly/node_modules/puppeteer/.local-chromium'
Can you manually create the folder?
Here a litte overview what I´ve tested:
```
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2019-09-16T20_55_55_114Z-debug.log
root@nextcloud:/var/www/screeenly# service apache2 restart
root@nextcloud:/var/www/screeenly# mkdir /var/www/screeenly/node_modules/puppeteer/.local-chromium
mkdir: cannot create directory '/var/www/screeenly/node_modules/puppeteer/.local-chromium': No such file or directory
root@nextcloud:/var/www/screeenly# mkdir /var/www/screeenly/node_modules/puppeteer/.local-chromium
mkdir: cannot create directory '/var/www/screeenly/node_modules/puppeteer/.local-chromium': No such file or directory
root@nextcloud:/var/www/screeenly# mkdir /var/www/screeenly/node_modules/
Display all 702 possibilities? (y or n)
root@nextcloud:/var/www/screeenly# mkdir /var/www/screeenly/node_modules/pu
public-encrypt/ pump/ pumpify/ punycode/ purgecss/ purgecss-webpack-plugin/
root@nextcloud:/var/www/screeenly# mkdir /var/www/screeenly/node_modules/pu
public-encrypt/ pump/ pumpify/ punycode/ purgecss/ purgecss-webpack-plugin/
root@nextcloud:/var/www/screeenly# mkdir /var/www/screeenly/node_modules/puppeteer
root@nextcloud:/var/www/screeenly# mkdir /var/www/screeenly/node_modules/puppeteer/.local-chromium
root@nextcloud:/var/www/screeenly# npm install
puppeteer@1.20.0 install /var/www/screeenly/node_modules/puppeteer
node install.js
ERROR: Failed to download Chromium r686378! Set "PUPPETEER_SKIP_CHROMIUM_DOWNLOAD" env variable to skip download.
{ Error: EACCES: permission denied, mkdir '/var/www/screeenly/node_modules/puppeteer/.local-chromium'
-- ASYNC --
at BrowserFetcher.
```
I also get the permission error. How you see even after creating the directories.
After chown www-data:www-data /var/www/screeenly/ it finally looks like it.
But now I get the problem, that only the design is back, but the 4 links on the page gives 404 back. https://screen.DOMAIN.tld/try for example.
Thanks for your logs.
The error during npm install
is puppeteer related; so it's probably better to search for solutions on their repo.
A quick search gave me the following possible solutions:
Running the following command seems to fix the problem.
sudo npm install puppeteer --unsafe-perm=true
Concerning links pointing not to the sub-directory: All links in the navigation are hardcoded to use /
at the beginning. See the try-link here.
You would have to manually update the _navigation.blade.php
-file on your server, or fork the project.
I just forgot to add this to vhost configuration:
<Directory /var/www/screeenly/>
Options +FollowSymlinks
AllowOverride All
</Directory>
Thanks for your help with npm install puppeteer.
Then I guessed how the github callback link is defined.
For all others:
GITHUB_REDIRECT_URL=https://DOMAIN.tld/oauth/github/handle
Glad everything works now. 👍🚀
I thought it is working now. But when I try to reach the ".tld/api/v1" I got a 404. Any ideas?
When I do composer install and npm install, all works fine.
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
ServerName screen.DOMAIN.TLD
ServerAdmin admin@DMN.TLD
DocumentRoot /var/www/screeenly/public
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
<Directory /var/www/screeenly/>
Options +FollowSymlinks
AllowOverride All
</Directory>
RewriteEngine on
RewriteCond %{SERVER_NAME} =screen.DOMAIN.TLD
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
Is it, because I´m using subdomain?
The API endponit is /api/v1/fullsize
not just /api/v1
. (Docs)
Could you test your installation with the correct endpoint?
What exactly do you mean with "When I do composer install and npm install, all works fine."?
Are you trying to run the application without running these commands? Do you delete vendor
and node_modules
regularly?!
Is it, because I´m using subdomain?
This shouldn't have any impact.
/var/www/screeenly# node -v v11.15.0 /var/www/screeenly# npm -v 6.7.0
I want it reachable under DOMAIN.TLD/screeenly
I followed the guide and I came to the point:
/etc/apache2/sites-avaible/screeenly.conf looks like:
Looks like this:
The hyperlinks are going to Domain.tld/[try]
[for example] and not to Domain.tld/screeenly/try
Thx for help