I get this error when I changed the custom command from an application that prints to STDOUT to shell script that runs curl and produces the same output to STDOUT.
What's going on here?
I get this error when I changed the custom command from an application that prints to STDOUT to shell script that runs curl and produces the same output to STDOUT.
What's going on here?
I want to be able to specify the keys in 2 separate files, one user controlled, the other auto generated by a tool.
How can I make it so that a file like ~/.ssh/authorized_keys_generated
also gets checked for keys on login?
We are usually using ssh + keys to access our servers.
Recently I had to give a password to another person to enter into the login prompt in person at the client location, with monitor and keyboard and all. I wanted secure servers so I set all passwords to 50 random characters. Never actually tested that a normal person can enter them.
The problem is that shortly after you start entering the characters the password prompt resets. I'ts not that shortly, but its 50 characters...
Can I somehow get that timeout increased?
I'm trying to enable compression for a SPA application that is 99% JS and CSS.
Here is the nginx config that I'm using: (I have commented out some settings while testing, but even if enabled do not improve the situation.)
gzip on;
# gzip_disable "msie6";
# gzip_vary on;
# gzip_proxied any;
gzip_comp_level 6;
# gzip_http_version 1.1;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/vnd.ms-fontobject application/x-font-ttf font/opentype image/svg+xml image/x-icon application/javascript;
The resulting file sizes have increased by a tiny bit.
Here is what the browser says:
I can't see what the problem is...
I want to use brotli compression with nginx on Ubuntu 16.04.
I don't want to install all of the development and build packages or compile anything on our production severs.
Can it be done? Is there some package that can be installed?
I want to create virsh snapshot that does not create any files, just keeps it in the same .qcow2 file.
Basically the same thing that virt-manager does in the 'Manager VM Snapshots' page.
How can I do that?
I have a mongo instance running in a container named mongo1
that has exposed port 27017.
I can connect just fine from the host.
I have another container that is running an application that wants to connect to the mongo instance.
How can I connect the 2 containers so that the hostname mongo1
is exposed to the other container and it can connect to mongo1:27017
?
I have a systemd service that looks like this:
[Unit]
Description=Kcrypt Backend Webpack Bundler
After=network.target
[Service]
User=kenny
Environment=NODE_ENV=PROD
WorkingDirectory=/var/www/kcrypt-api/
ExecStart=/var/www/kcrypt-api/scripts/webpack.sh
[Install]
WantedBy=multi-user.target
The .sh file looks like this:
#!/usr/bin/env bash
export NODE_ENV=DEV
rm ./dist/* -rf
yarn start webpack --watch
The problem is that it cannot find yarn
.
My user is called kenny
. kenny
has a tool called nvm
installed that manages nodejs
versions. That tool adds a directory to the PATH
env variable by editing '~/.bashrc'.
That means that the yarn
command is only available if the user is logged in as kenny
.
I was left with the impression that if I set the systemd
's unit
's user to 'kenny', systemd
will take care of the rest, or I don't know what I was thinking.
Is there any way that I can import kenny
's PATH variable into the systemd
unit
?
I have a brand new VM with CenotOS 7 Minimal Installation.
What I want to happen is to configure Nginx to serve static files from a directory on localhost:80
.
My directory is /home/kenny/projects/kcrypt/dist/
.
Here are the contents of my /etc/nginx/nginx.conf
:
# this is set to root in order to rule out
# any permission related issues.
user root;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;
include /usr/share/nginx/modules/*.conf;
events {
worker_connections 1024;
}
http {
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 /var/log/nginx/access.log main;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
default_type application/octet-stream;
server {
listen 80 default_server;
listen [::]:80 default_server;
root /home/kenny/projects/kcrypt/dist/;
index index.html;
location / {
}
}
}
when I run curl http://localhost
I get this response:
<html>
<head><title>403 Forbidden</title></head>
<body bgcolor="white">
<center><h1>403 Forbidden</h1></center>
<hr><center>nginx/1.12.2</center>
</body>
</html>
I have tried giving all kinds of permissions to any directories that I can think of.
In the end I configured Nginx to run as root.
I have reinstalled the OS multiple times already and can't get it to work.
P.S.
This is what I found in /var/log/nginx/error.log
2018/02/27 21:33:19 [error] 15689#0: *1 open() "/home/kenny/projects/kcrypt/dist/index.html" failed (13: Permission denied), client: ::1, server: , request: "GET / HTTP/1.1", host: "localhost"
2018/02/27 21:33:35 [error] 15690#0: *2 open() "/home/kenny/projects/kcrypt/dist/index.html" failed (13: Permission denied), client: 127.0.0.1, server: , request: "GET / HTTP/1.1", host: "127.0.0.1"
2018/02/27 21:33:38 [error] 15690#0: *3 open() "/home/kenny/projects/kcrypt/dist/index.html" failed (13: Permission denied), client: ::1, server: , request: "GET / HTTP/1.1", host: "localhost"
I don't get what it wants... I have given it all the permissions that I can.
This is what I have in the root directory:
[root@vm3 dist]# ll
total 368K
drwxrwxrwx. 2 root root 98 Feb 26 23:16 .
drwxrwxrwx. 6 root root 234 Feb 27 21:26 ..
-rwxrwxrwx. 1 root root 1.2K Feb 26 23:16 favicon.ico
-rwxrwxrwx. 1 root root 1.7K Feb 26 23:16 index.html
-rwxrwxrwx. 1 root root 175K Feb 26 22:53 index.js
-rwxrwxrwx. 1 root root 297 Feb 26 23:16 manifest.json
-rwxrwxrwx. 1 root root 179K Feb 26 22:53 styles.css
P.S. 2
I have tried putting my static files in /var/www/kcrypt/dist/
, but with no result.
I still get the same error messages:
2018/02/27 23:18:11 [error] 16157#0: *1 open() "/var/www/kcrypt/dist/index.html" failed (13: Permission denied), client: ::1, server: , request: "GET / HTTP/1.1", host: "localhost"
2018/02/27 23:20:58 [error] 16535#0: *1 open() "/var/www/kcrypt/dist/index.html" failed (13: Permission denied), client: ::1, server: , request: "GET / HTTP/1.1", host: "localhost"
2018/02/27 23:21:30 [error] 16564#0: *1 open() "/var/www/kcrypt/dist/index.html" failed (13: Permission denied), client: ::1, server: , request: "GET / HTTP/1.1", host: "localhost"
I have an ASP.NET application that uses some long polling magic.
The problem comes when the server has accepted some requests and it's just waiting to return them. If I restart apache in that moment I get multiple instances of mod-mono-server4.exe that together use 100% of the CPU. It stays in that state until you restart the Ubuntu instance.
I can't replicate it consistently, it happens 1 in any 10-20 attempts and it happens in production too.
Does anybody know what the problem may be?