Apache HTTP server is not running - apache

I have build a website on Ubuntu 18.04 and tried to install SSL (Let's Encrypt) for the domain. So I installed everything from the guides, but after it I could not access admin panel for my website, as well as cannot upload or download any files from FTP server.
So I decided to delete everything related to SSL (from some guides on internet) and I was thinking that somehow it will come back to previous situation. However, it did not happened.
Now I cannot upload anything to the FTP or download from it. Cannot access the admin page as well. I have a access to server root, so this is the only way (as I understand) to fix the problem.
I have tried to do this:
sudo certbot --apache -d domain.lt -d www.domain.lt
However I get the error:
Error while running apache2ctl configtest.
Action configtest failed. The Apache error log may have more information.apache2:
Syntax error on line 225 of /etc/apache2/apache2.conf: Syntax error on line 13 of /etc/apache2/sites-enabled/opencart-le-ssl.conf: Could not open configuration file /etc/letsencrypt/options-ssl-apache.conf: No such file or directory
I see that Apache is not running and do not know how to make it run.
● apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
Drop-In: /lib/systemd/system/apache2.service.d
└─apache2-systemd.conf
Active: failed (Result: exit-code) since Fri 2020-10-16 13:16:42 EEST; 11min ago
Process: 18181 ExecStop=/usr/sbin/apachectl stop (code=exited, status=1/FAILURE)
Process: 18186 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE)
Main PID: 366 (code=exited, status=0/SUCCESS)
Oct 16 13:16:42 domain.lt systemd[1]: Starting The Apache HTTP Server...
Oct 16 13:16:42 domain.lt apachectl[18186]: apache2: Syntax error on line 225 of /etc/apache2/apache2.conf: Syntax error on line 13 of /etc/apache2/sites-enabled/opencart-le-ssl.conf:
Oct 16 13:16:42 domain.lt apachectl[18186]: Action 'start' failed.
Any help how to enable ssl and make it work again is appreciated. I am not very good as sysadmin, just following the guides.

Managed to enter the website however still cannot log in into /admin panel. I am entering username and password, however nothing happens.
FTP still remains only for navigation, cannot upload or download files.

Related

How to restart redis server with authentication?

I am trying to restart a redis server using the following command:
service redis-server restart
And I am getting the error:
Failed to restart redis-server.service: Interactive authentication required.
See system logs and 'systemctl status redis-server.service' for details.
I know the redis password but I am not sure how to pass it in in the line of code that I mentioned.
The recommended logs are like this and not very helpful:
● redis-server.service - Advanced key-value store
Loaded: loaded (/lib/systemd/system/redis-server.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Tue 2022-04-05 13:31:23 UTC; 12min ago
Docs: http://redis.io/documentation,
man:redis-server(1)
Process: 358704 ExecStart=/usr/bin/redis-server /etc/redis/redis.conf (code=exited, status=1/FAILURE)

cannot login into Rstudio server (open source) in Ubuntu 20.04

I installed Rstudio server in ubuntu server 20.04 LTS. The login page appears, but i am not able to login.
I checked /etc/pam.d/other and /etc/pam.d/rstudio looks alright. Installed java as well.
sudo restudio-server status
● rstudio-server.service - RStudio Server
Loaded: loaded (/lib/systemd/system/rstudio-server.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2021-03-02 11:34:34 UTC; 1h 47min ago
Process: 845 ExecStart=/usr/lib/rstudio-server/bin/rserver (code=exited, status=0/SUCCESS)
Main PID: 956 (rserver)
Tasks: 3 (limit: 7031)
Memory: 31.8M
CGroup: /system.slice/rstudio-server.service
└─956 /usr/lib/rstudio-server/bin/rserver
Can anyone please help?
Thanks
Java installation is important and the browser shall be either MS edge or Google Chrome.
With me the problem was the internet explorer which didn't allow me to log in.

Cloudstack KVM installation failed

I'm installing cloudstack on ubuntu 20.04 by following this document.
I installed qemu-kvm and cloudstack-agent successfully but I'm not able to start libvirtd.service, on seeing the status I'm getting following errors
● libvirtd.service - Virtualization daemon
Loaded: loaded (/lib/systemd/system/libvirtd.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Tue 2021-03-16 18:00:09 IST; 1min 28s ago
TriggeredBy: ● libvirtd-admin.socket
● libvirtd.socket
● libvirtd-ro.socket
Docs: man:libvirtd(8)
https://libvirt.org
Process: 232313 ExecStart=/usr/sbin/libvirtd $libvirtd_opts (code=exited, status=6)
Main PID: 232313 (code=exited, status=6)
Mar 16 18:00:09 host systemd[1]: libvirtd.service: Scheduled restart job, restart counter is at 5.
Mar 16 18:00:09 host systemd[1]: Stopped Virtualization daemon.
Mar 16 18:00:09 host systemd[1]: libvirtd.service: Start request repeated too quickly.
Mar 16 18:00:09 host systemd[1]: libvirtd.service: Failed with result 'exit-code'.
Mar 16 18:00:09 host systemd[1]: Failed to start Virtualization daemon.
on seeing the log of journalctl -xe it is showing cloudstack-usage.service: Failed with result 'exit-code'
can any one suggest what whould be the issue.
Are you trying this on a virtualised VM, or baremetal host, or on a raspberrypi? This means some other service hasn't started which libvirtd may depend on. See if you can run "systemctl daemon-reload" and try to start libvirtd manually "systemctl start libvirtd", and then try rest. The cloudstack-usage service can be started once the mysql server is running. If you've further questions I encourage you to join the CloudStack users mailing list and ask questions there - http://cloudstack.apache.org/mailing-lists.html
I got that same error message when following the official install guide when starting the mysql server. The problem was for me that [mysqld] was missing in the my.conf file before the config snippet. The documentation is misleading in that case (like the secion header is only relevant when editing that alternative mysql config file mentioned later there).

Apache2 crash on boot, but not when started manually

I got a wired problem that I don't understand at all:
I have a home server with an Apache2 installation on Ubuntu 18.04. My problem is that Apache2 keeps crashing on system reboot.
systemctl status apache2 gives me:
● apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
Drop-In: /lib/systemd/system/apache2.service.d
└─apache2-systemd.conf
Active: failed (Result: exit-code) since Sat 2020-05-23 13:42:31 CEST; 3min 52s ago
Process: 1183 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)
Main PID: 1224 (code=exited, status=1/FAILURE)
mai 23 13:42:30 potato-server systemd[1]: Starting The Apache HTTP Server...
mai 23 13:42:30 potato-server systemd[1]: Started The Apache HTTP Server.
mai 23 13:42:31 potato-server systemd[1]: apache2.service: Main process exited, code=exited, status=1/FAILURE
mai 23 13:42:31 potato-server systemd[1]: apache2.service: Failed with result 'exit-code'.
What's super weird is that when I do a manual sudo systemctl start apache2, the server starts. And apache2ctl configtest gives me:
Syntax OK
Any idea of where the problem can come from?
I got some updates:
It seems that my bug is due to that fact I changed the group and user of Apache2 in /etc/apache2/envvar, according to this post: https://www.simplified.guide/apache/change-user-and-group
If I change back user and user group to www-data, it works again. However I would like to run Apache2 from an other user than www-data. Is this possible ?

SELinux permission denied to Phusion Passenger for redmine

I am trying to install Redmine on CentOS 6.3 but I continue to get this error in the log file
Passenger could not be initialized because of this error: Unable to start
the Phusion Passenger watchdog (/usr/lib/ruby/gems/1.8/gems/passenger-4.0.20/buildout
/agents/PassengerWatchdog): Permission denied (errno=13)
I have been looking online and cannot find this error anywhere or any way to fix it. I have tried changing permissions to the folder to 777 and apache:apache but neither work.
The only solution that I have come up with to get redmine to work is to set SELinux to disabled or permissive (which I do not want to do).
Does anyone have another way to fix this problem that leaves SELinux enabled?
Found the SELinux log file under /var/log/messages
here is the end of the file
Oct 16 14:07:30 localhost pulseaudio[2329]: alsa-util.c: Disabling timer-based scheduling because running inside a VM.
Oct 16 14:07:30 localhost rtkit-daemon[2183]: Sucessfully made thread 2331 of process 2329 (/usr/bin/pulseaudio) owned by '500' RT at priority 5.
Oct 16 14:07:30 localhost pulseaudio[2329]: alsa-util.c: Disabling timer-based scheduling because running inside a VM.
Oct 16 14:07:30 localhost rtkit-daemon[2183]: Sucessfully made thread 2332 of process 2329 (/usr/bin/pulseaudio) owned by '500' RT at priority 5.
Oct 16 14:07:31 localhost rtkit-daemon[2183]: Sucessfully made thread 2427 of process 2427 (/usr/bin/pulseaudio) owned by '500' high priority at nice level -11.
Oct 16 14:07:31 localhost pulseaudio[2427]: pid.c: Daemon already running.
Oct 16 14:08:04 localhost kernel: type=1400 audit(1381957684.726:5): avc: denied { execute_no_trans } for pid=2663 comm="httpd" path="/usr/lib/ruby/gems/1.8/gems/passenger-4.0.20/buildout/agents/PassengerWatchdog" dev=dm-0 ino=1048752 scontext=unconfined_u:system_r:httpd_t:s0 tcontext=unconfined_u:object_r:lib_t:s0 tclass=file
Oct 16 14:08:04 localhost kernel: type=1400 audit(1381957684.760:6): avc: denied { execute_no_trans } for pid=2668 comm="httpd" path="/usr/lib/ruby/gems/1.8/gems/passenger-4.0.20/buildout/agents/PassengerWatchdog" dev=dm-0 ino=1048752 scontext=unconfined_u:system_r:httpd_t:s0 tcontext=unconfined_u:object_r:lib_t:s0 tclass=file
Oct 16 14:09:11 localhost pulseaudio[2329]: alsa-sink.c: ALSA woke us up to write new data to the device, but there was actually nothing to write!
Oct 16 14:09:11 localhost pulseaudio[2329]: alsa-sink.c: Most likely this is a bug in the ALSA driver 'snd_intel8x0'. Please report this issue to the ALSA developers.
Oct 16 14:09:11 localhost pulseaudio[2329]: alsa-sink.c: We were woken up with POLLOUT set -- however a subsequent snd_pcm_avail() returned 0 or another value < min_avail.
any suggestions?
So, you can fix this by using audit2allow (yum install audit-libs-python audit-libs).
SELinux logs to /var/log/audit/audit.log. If you tail and capture the output from restarting the web service (service httpd restart) you can then run the new output through audit2allow and make a module to install under selinux...
So, assuming you have captured it into a file called "audit_tmp":
cat audit_tmp | audit2allow -D -M passenger
This will create a file called passenger.pp which you can apply using:
semodule -i passenger.pp
Doing this will unblock the first thing that was stopping passenger from loading - but be aware that there will probably be more so you will need to repeats the process again until it works. I hope that makes sense!
Take a look at /var/log/syslog. That file contains SELinux error messages, which tell you how to fix up any permission problems.