CentOS 7 + Lighttpd, web server not working altough running - linux

I have installed lighttpdon my new CENOS 7.
When I'm trying to access my IP, it is loading than eventually says that the site can't be reached, (ERR_CONNECTION_TIMED_OUT).
WHen runnig systemctl status lighttpd -l, It looks like the service is up and running.
Any idea?
[root#myvps ~]# systemctl status lighttpd -l
● lighttpd.service - Lightning Fast Webserver With Light System Requirements
Loaded: loaded (/usr/lib/systemd/system/lighttpd.service; enabled; vendor preset: disabled)
Active: active (running) since Tue 2020-02-11 09:50:53 CET; 19min ago
Main PID: 7559 (lighttpd)
CGroup: /system.slice/lighttpd.service
└─7559 /usr/sbin/lighttpd -D -f /etc/lighttpd/lighttpd.conf
Feb 11 09:50:53 myvps.mydomain.net systemd[1]: Stopped Lightning Fast Webserver With Light System Requirements.
Feb 11 09:50:53 myvps.mydomain.net systemd[1]: Started Lightning Fast Webserver With Light System Requirements.
Feb 11 09:50:53 myvps.mydomain.net lighttpd[7559]: 2020-02-11 09:50:53: (network.c.162) warning: please use server.use-ipv6 only for hostnames, not without server.bind / empty address; your config will break if the kernel default for IPV6_V6ONLY changes
Feb 11 09:50:53 myvps.mydomain.net lighttpd[7559]: 2020-02-11 09:50:53: (server.c.1437) can't have more connections than fds/2: 1024 1024
[root#myvps ~]#

Solved by running
firewall-cmd --permanent --add-service=http
success
[root#myvps~]# firewall-cmd --reload
success
found it somewhere on the web.

Related

Request timeout when pinging aws Linux instance

So i m trying to install a jenkins server on the free instance provided by aws, so I can test things out, problem is that I can connect via ssh using putty to the public ip and my key, but when I try to access the jenkins portal using the public DNS address and the port a timeout is returned
Also if i try to ping the machine from my laptop it returns "Request time out" every time.
Also jenkins server seems to be running and active:
[ec2-user#ip-1235 ~]$ sudo systemctl status jenkins
● jenkins.service - LSB: Jenkins Automation Server
Loaded: loaded (/etc/rc.d/init.d/jenkins; bad; vendor preset: disabled)
Active: active (running) since Mon 2021-11-22 16:14:42 UTC; 7min ago
Docs: man:systemd-sysv-generator(8)
Process: 3693 ExecStart=/etc/rc.d/init.d/jenkins start (code=exited, status=0/SUCCESS)
CGroup: /system.slice/jenkins.service
└─3697 /etc/alternatives/java -Djava.awt.headless=true -DJENKINS_H...
Nov 22 16:14:42 ip-1234.us-east-2.compute.internal systemd[1]: Start...
Nov 22 16:14:42 ip-1234.us-east-2.compute.internal jenkins[3693]: St...
Nov 22 16:14:42 ip-1234.us-east-2.compute.internal systemd[1]: Start...
Hint: Some lines were ellipsized, use -l to show in full.

Systemd enabled services not starting at boot anymore

I made some custom systemd services long time ago, all have the same configuration (except for the ExecStart of course)
This configuration worked for years, I have ubuntu up and running since version 18.04 LTS, but now looks like some of these systemd services aren't starting at boot at all, the configuration is as follow (myapp.service):
[Unit]
Description="myapp"
After=syslog.target network-online.target
Wants=network-online.target
[Service]
Restart=always
RestartSec=10
User=root
Group=root
WorkingDirectory=/opt/myapp
ExecStart=/usr/local/bin/myapp
KillMode=control-group
[Install]
WantedBy=multi-user.target
The service is enabled:
$ sudo systemctl enable myapp
Created symlink /etc/systemd/system/multi-user.target.wants/myapp.service → /lib/systemd/system/myapp.service.
If i do "systemctl status myapp" after a reboot:
● myapp.service - "myapp"
Loaded: loaded (/lib/systemd/system/myapp.service; enabled; vendor preset: enabled)
Active: inactive (dead)
If i do "journalctl -u myapp -f" after a reboot:
Jan 13 12:10:06 myhost systemd[1]: Started myapp.
Jan 17 07:15:03 myhost systemd[1]: Stopping myapp...
Jan 17 07:15:09 myhost systemd[1]: Stopped myapp.
What's wrong with my configuration?
If I manually start /usr/local/bin/myapp there are no errors on the script and I've also tried running it with tmux, now it's 3 days running in bg and no errors. But systemd just won't start it after a reboot.
Today, i've also tried to install a new service that require a systemd config, the package is zram-config and by default it is enabled at boot.
But after a: apt install zram-config && sudo reboot:
$ sudo systemctl status zram-config
● zram-config.service - Initializes zram swaping
Loaded: loaded (/lib/systemd/system/zram-config.service; enabled; vendor preset: enabled)
Active: inactive (dead)
but if now i do:
$ sudo systemctl start zram-config
$ sudo systemctl status zram-config
● zram-config.service - Initializes zram swaping
Loaded: loaded (/lib/systemd/system/zram-config.service; enabled; vendor preset: enabled)
Active: active (exited) since Mon 2020-01-27 12:25:55 CET; 1s ago
Process: 5541 ExecStart=/usr/bin/init-zram-swapping (code=exited, status=0/SUCCESS)
Main PID: 5541 (code=exited, status=0/SUCCESS)
Jan 27 12:25:55 myhost systemd[1]: Starting Initializes zram swaping...
Jan 27 12:25:55 myhost init-zram-swapping[5541]: Setting up swapspace version 1, size = 985,7 MiB (1033568256 bytes)
Jan 27 12:25:55 myhost init-zram-swapping[5541]: nessuna etichetta, UUID=4ac5c2cd-0c68-4f6d-a5c0-d8f91a509c71
Jan 27 12:25:55 myhost init-zram-swapping[5541]: Setting up swapspace version 1, size = 985,7 MiB (1033568256 bytes)
Jan 27 12:25:55 myhost init-zram-swapping[5541]: nessuna etichetta, UUID=83a4f201-d591-4222-89a6-5bc5aebedef4
Jan 27 12:25:55 myhost init-zram-swapping[5541]: Setting up swapspace version 1, size = 985,7 MiB (1033568256 bytes)
Jan 27 12:25:55 myhost init-zram-swapping[5541]: nessuna etichetta, UUID=1f6f742e-6fb8-4332-b226-bf6918f7ee28
Jan 27 12:25:55 myhost init-zram-swapping[5541]: Setting up swapspace version 1, size = 985,7 MiB (1033568256 bytes)
Jan 27 12:25:55 myhost init-zram-swapping[5541]: nessuna etichetta, UUID=a5509c55-46f5-4112-8fe1-68171f31409e
Jan 27 12:25:55 myhost systemd[1]: Started Initializes zram swaping.
I really don't understand what's wrong with systemd on my Ubuntu install, is it better I do a fresh reinstall of whole OS?
Thanks
Check the full output of journalctl for a message about cycles, like:
Job <your.service> deleted to break ordering cycle starting with <something else>
I had the similar issue. It was due to ordering cycles, which was very hard to debug and fix.

Puppet Server not starting up in Centos7

I have recently installed puppet5 in Centos7 (Running in VirtualBox). After installation I tried starting it which thrown the below message.
Is there anything should I do with configuration?
[root#puppet ~]# systemctl status puppetserver -l
● puppetserver.service - puppetserver Service
Loaded: loaded (/usr/lib/systemd/system/puppetserver.service; enabled; vendor preset: disabled)
Active: activating (start) since Thu 2018-01-25 13:59:44 IST; 32s ago
Control: 10284 (bash)
CGroup: /system.slice/puppetserver.service
├─10284 bash /opt/puppetlabs/server/apps/puppetserver/cli/apps/start
├─10291 java -Xms2g -Xmx2g -XX:MaxPermSize=256m -Djava.security.egd=/dev/urandom -XX:OnOutOfMemoryError=kill -9 %p -cp /opt/puppetlabs/server/apps/puppetserver/puppet-server-release.jar:/opt/puppetlabs/server/apps/puppetserver/jruby-1_7.jar:/opt/puppetlabs/server/data/puppetserver/jars/* clojure.main -m puppetlabs.trapperkeeper.main --config /etc/puppetlabs/puppetserver/conf.d --bootstrap-config /etc/puppetlabs/puppetserver/services.d/,/opt/puppetlabs/server/apps/puppetserver/config/services.d/ --restart-file /opt/puppetlabs/server/data/puppetserver/restartcounter
└─10366 sleep 1
Jan 25 13:59:44 puppet systemd[1]: Starting puppetserver Service...
Journal Logs:
Jan 25 14:01:29 puppet puppetserver[10419]: Background process 10426 exited before start had completed
Jan 25 14:01:29 puppet systemd[1]: puppetserver.service: control process exited, code=exited status=1
Jan 25 14:01:29 puppet systemd[1]: Failed to start puppetserver Service.
-- Subject: Unit puppetserver.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit puppetserver.service has failed.
--
-- The result is failed.
It looks like the VM has insufficient memory to run the server.
Edit the file /etc/default/puppetserver and lower the values of
JAVA_ARGS=" -Xms2g -Xmx2g ...
to:
JAVA_ARGS="-Xms1g -Xmx1g ...
The VM must have at least 1GB RAM configured with the edited settings.

cant connect to Datastax OpsCenter after brand new install

Can anyone help, I did a fresh install of Datastax OpsCenter/Lifecylce Manager, installed via apg-get on clean Ubuntu VMs. But, I can not connect via browser, "site not found", on port 8888.
ps returns a running process and Status seems started. Any ideas?
root#unigmadevdse1:/var/log/opscenter# ps -ef | grep opscenter root
19381 1890 0 20:49 pts/0 00:00:00 grep --color=auto opscenter
root#unigmadevdse1:/var/log/opscenter# service opscenterd status ●
opscenterd.service - LSB: Cassandra cluster manager Loaded: loaded
(/etc/init.d/opscenterd; bad; vendor preset: enabled) Active:
active (exited) since Tue 2017-03-07 20:39:54 UTC; 9min ago
Docs: man:systemd-sysv-generator(8) Process: 18848 ExecStart=/etc/init.d/opscenterd start (code=exited, status=0/SUCCESS)
Mar 07 20:39:53 unigmadevdse1.unigmagroup.com systemd[1]: Starting
LSB: Cassandra cluster manager...
Mar 07 20:39:54 unigmadevdse1.unigmagroup.com systemd[1]: Started LSB: >Cassandra cluster manager.
Have a look in the opscenter.log file for any error messages [if you are not sure, run a find / -iname opscenter.log
or try a service opscenter start -f [will output to screen]

Cannot connect to nginx server on fedora linux (digitalocean)

I tried to set up nginx on a brand new fedora box on DigitalOcean. These are my steps
$ yum install nginx
$ systemctl enable nginx
$ systemctl restart nginx
However, it doesn't seem to work. I get the following output when running systemctl status nginx
[root#inspiredev ~]# systemctl status nginx -l
nginx.service - The nginx HTTP and reverse proxy server
Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled)
Active: active (running) since Fri 2014-11-07 14:26:33 EST; 1s ago
Process: 958 ExecStop=/bin/kill -s QUIT $MAINPID (code=exited, status=1/FAILURE)
Process: 967 ExecStart=/usr/sbin/nginx (code=exited, status=0/SUCCESS)
Process: 966 ExecStartPre=/usr/sbin/nginx -t (code=exited, status=0/SUCCESS)
Main PID: 970 (nginx)
CGroup: /system.slice/nginx.service
├─970 nginx: master process /usr/sbin/ngin
└─971 nginx: worker proces
Nov 07 14:26:33 inspiredev systemd[1]: Starting The nginx HTTP and reverse proxy server...
Nov 07 14:26:33 inspiredev nginx[966]: nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
Nov 07 14:26:33 inspiredev nginx[966]: nginx: configuration file /etc/nginx/nginx.conf test is successful
Nov 07 14:26:33 inspiredev systemd[1]: Failed to read PID from file /run/nginx.pid: Invalid argument
Nov 07 14:26:33 inspiredev systemd[1]: Started The nginx HTTP and reverse proxy server.
I can't seem to figure out or where I went wrong. It'd be great if someone can help with this.
EDIT: When I go to the box's IP address, I got nothing, which is why I feel like something is not working right.
From the systemd logs, nginx service appears to be running. (the warning about the pid file not found seems endemic to many distributions).
On fedora 19/20 (systemd based), open the firewall with the following commands:
firewall-cmd --permanent --zone=public --add-service=http
systemctl restart firewalld.service
or alternatively:
firewall-cmd --permanent --zone=public --add-port=80/tcp
systemctl restart firewalld.service
The second version syntax lets you open any port/protocol combination.

Resources