As of May 31, 2023, we have updated our Code of Conduct.
62 votes
Accepted

nginx: [emerg] "stream" directive is not allowed here

stream needs to be on the same level as http block so like http { foo } stream { bar } My guess is your include for /etc/nginx/conf.d/*.conf is located in the http {} block and not outside of it. ...
Mike's user avatar
  • 22.3k
48 votes
Accepted

Switch from PHP 7.2 to 7.1 on Ubuntu 16.04, Apache

Below is a description of what I did. I hope this information can help someone else: I installed PHP 7.1 along side PHP 7.2. I also installed most of the needed extensions for PHP 7.1. I then did ...
Pegues's user avatar
  • 901
48 votes
Accepted

Best way to run python 3.7 on Ubuntu 16.04 which comes with python 3.5

It would be wise to use pyenv to safely manage multiple versions of Python installed on the same system. Nonetheless, this should get you up and running with Python 3.7.10 on Ubuntu 16.04 # WARNING: ...
Sn3akyP3t3's user avatar
31 votes

Switch from PHP 7.2 to 7.1 on Ubuntu 16.04, Apache

for display enabled php version in terminal by php -v. we need to set update cli version of php. use below command to update php cli version // change terminal (cli) version (7.2 to 7.1) sudo update-...
Chirag Goti's user avatar
29 votes
Accepted

"Excess arguments." while doing "systemd daemon-reload" during MongoDB configuration

I guess you should use "systemctl daemon-reload" instead of "systemd daemon-reload".
Ha Hacker's user avatar
  • 406
28 votes

How do view older journalctl logs (after a rotation maybe?)

It could be because you are trying to review the journal since the last boot, which seems likely to be the case inside a docker image. On Ubuntu 16.04, the journal storage defaults to being in-...
Mark Stosberg's user avatar
26 votes
Accepted

How to allow a user to use journalctl to see user-specific systemd service logs?

On older systemd versions, you'll have to use journalctl --user --user-unit=SERVICENAME (on newer versions journalctl --user -u SERVICENAME will work fine). However, this only works if the Storage ...
D Schlachter's user avatar
23 votes
Accepted

How do view older journalctl logs (after a rotation maybe?)

The reason this happens is because of defaults on the size of journald files stored. There is more detail about this in the docs. It's worth reading the whole section I have linked to, but the ...
jdf's user avatar
  • 871
20 votes

systemd script for starting my app server - Unknown lvalue 'StartLimitIntervalSec' in section 'Unit'

You are likely comparing systemd docs you've read online for a different version instead using the docs on your system that match your version. Check man systemd.unit on your own system. You may ...
Mark Stosberg's user avatar
19 votes

OpenVPN for certain IPs, eth0 for everything else

The "Use this connection only for resources on its network" checkbox in nm-connection-editor controls whether NetworkManager should add a default route through the VPN. If it is checked, as you did, ...
bengal's user avatar
  • 291
18 votes
Accepted

Disabling rp_filter on one interface

Info there: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/tree/Documentation/networking/ip-sysctl.txt?h=v4.9#n1090 Note the last sentence that would explain your attempts: ...
A.B's user avatar
  • 10.4k
18 votes
Accepted

switch apache from prefork to event in Ubuntu 16, get php 7 working

ezra-s suggests a good approach but it doesn't include some details that might be confusing for folks who rely on package managers. NOTE: I'm not sure if these steps are exact. If anyone encounters ...
S. Imp's user avatar
  • 516
17 votes
Accepted

command KLogPermitNonKernelFacility is currently not permitted

Is is a known bug. Bug#1531622 KLogPermitNonKernelFacility - it's legacy parameter which is no longer used. To remove the error, locate and comment out the following line $...
Slipeer's user avatar
  • 3,295
17 votes
Accepted

varnish daemon not listening on configured port

You need to change the varnish start parameters in the systemd service definition as well. You could edit the line starting with ExecStart in the service defintion file: sudo vi /lib/systemd/system/...
Gerald Schneider's user avatar
15 votes
Accepted

Create daemon on ubuntu 16.04

Adding to @Juanjo Aguilella Marés answer, and once you have copied/linked your script to /etc/systemd/system, you may want to automatically start it when the server starts: sudo systemctl daemon-...
Andres's user avatar
  • 274
15 votes
Accepted

How to enable and use the serial terminal of a HP Microserver Gen9?

The ILO port on the HP server by default asks for an IP via DHCP. So you just need to plug it into a network that has a DHCP server running. It will announce itself with a host name like ILOCZ12345678 ...
nh2's user avatar
  • 788
15 votes

Ubuntu cron job every workday

These syntaxes are valid for all working days a 8:00 AM : 0 8 * * 1-5 /path/to/command >/dev/null 2>&1 0 8 * * 1,2,3,4,5 /path/to/command >/dev/null 2>&1 as you said @aleksandar-...
Maximilien D's user avatar
15 votes
Accepted

What does locking a password using `passwd -l` mean?

Why don't you just read the man page for passwd? -l, --lock Lock the password of the named account. This option disables a password by changing it to a value which matches no possible ...
Sven's user avatar
  • 98.4k
14 votes
Accepted

I accidentally deleted /var/log/syslog, Now rsyslog Won't Log anything

rsyslog should re-create the file (with correct permissions)after restarting: # mv /var/log/syslog /tmp/ # /etc/init.d/rsyslog restart [ ok ] Restarting rsyslog (via systemctl): rsyslog.service. # ...
Server Fault's user avatar
  • 3,624
14 votes

Switch from PHP 7.2 to 7.1 on Ubuntu 16.04, Apache

@pegues: Your above mentioned method worked well for apache to switch the different version. By running following commands will change the php from terminal as well. Actually you just need to change ...
khichar.anil's user avatar
13 votes

Create daemon on ubuntu 16.04

I solved the problem: a) Create a file crawler.service in /etc/systemd/system with this code: [Unit] Description=Crawler cache Service After=network.target [Service] User=root Restart=always Type=...
Juanjo Aguilella Marés's user avatar
13 votes

How to automatically switch to home directory when switching user?

Try to us su - otheruser command which starts the shell as a login shell with an environment similar to a real login: it clears all the environment variables except TERM it initializes the ...
dsmsk80's user avatar
  • 5,807
13 votes
Accepted

Postfix - Untrusted TLS connection

Is there an easy way to gain a Trusted TLS connection instead of untrusted, do I need to buy something or this free certificate should work? This is not about your certificate, so you don't need to ...
gxx's user avatar
  • 5,561
12 votes

How Uninstall pip and python

In order to remove it type: sudo apt-get remove python-pip python-dev If you're not sure which switch to use, you can add the --help switch to almost if not every Linux command to get details about ...
Itai Ganot's user avatar
  • 10.6k
12 votes
Accepted

Why does Ubuntu want to reboot so often after installing updates?

Ubuntu will suggest a restart after the update if it can't restart the affected components in a meaningful way. In a nutshell: Things like editors or command line tools don't need any kind of ...
Sven's user avatar
  • 98.4k
12 votes

Getting Ubuntu 16.04 on a ZFS root on a Hetzner dedicated server

The basic idea is to get Ubuntu installed on a small partition on the harddrive, partition the hard-drive to use the remainder of the space for ZFS, and then copy the installation over. I'm mainly ...
TinkerTank's user avatar
11 votes

Install of MySQL hangs on Ubuntu 16.04

Same problem, found fix at https://omgdebugging.com/2016/09/04/fixing-hung-up-mysql-installation-on-ubuntu-16-04-lts/. I ran (as root) (sleep 200; killall mysqld)& then immediately apt-get install ...
Iiridayn's user avatar
  • 304
11 votes

What does memory_limit = -1 mean in a PHP.ini file?

From the official documantation here: This sets the maximum amount of memory in bytes that a script is allowed to allocate. This helps prevent poorly written scripts for eating up all available ...
Vikelidis Kostas's user avatar
11 votes
Accepted

Why is ALPN not supported by my server?

As @AlexyTen pointed out, the root cause was that, although I had OpenSSL 1.0.2g installed, NGINX needed to be built with OpenSSL and it was built with 1.0.1f which does not support ALPN. NGINX needs ...
Godwin's user avatar
  • 401
11 votes
Accepted

Start service after AWS user-data has run

Use [Unit] … After=cloud-final.service … [Install] WantedBy=cloud-init.target I ran into this as well. journalctl showed user data stuff running after multi-user and before the target cloud-init was ...
vlfig's user avatar
  • 226

Only top scored, non community-wiki answers of a minimum length are eligible