why i get problem while running apache2 in ubuntu? - apache

Here is my details about the apache error, hope you will can find out the problems
apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; disabled; vendor preset: enabled)
Drop-In: /lib/systemd/system/apache2.service.d
└─apache2-systemd.conf
Active: failed (Result: exit-code) since Tue 2020-02-25 12:06:14 +0545; 13min ago
Process: 25134 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE)

Please check first : /var/log/apache2/error.log
After you have comprehended which procedure utilizes port 80, you can choose in the event that you need to end it or on the off chance that you have an unsupported setup and can't utilize Apache on port 80
To check for that:- netstat -anp | grep ':80\s'

Related

Redis Won't Start Scheduled restart job, restart counter is at 5

My working and functional redis server 5.0.7 installation on Ubuntu 20.04, simply refuses to start without any changes having be made to the config file. It is identical to a config on a different different server running redis that starts, therefore I think the error message is systemd related
● 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 Sat 2022-07-30 23:09:49 HKT; 32s ago
Docs: http://redis.io/documentation,
man:redis-server(1)
Process: 8141 ExecStart=/usr/bin/redis-server /etc/redis/redis.conf (code=exited, status=1/FAILURE)
redis-server.service: Control process exited, code=exited, status=1/FAILURE
redis-server.service: Failed with result 'exit-code'.
Failed to start Advanced key-value store.
redis-server.service: Scheduled restart job, restart counter is at 5.
Stopped Advanced key-value store.
redis-server.service: Start request repeated too quickly.
redis-server.service: Failed with result 'exit-code'.
Failed to start Advanced key-value store.
Any ideas?
Thanks

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)

Apache HTTP server is not running

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.

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 ?

How to use Rabbitmq to communicate with SSL?

I installed rabbitmq on Ubuntu and would like to communicate with ssl. There is no /etc/rabbitmq/rabbitmq.conf file, what should I write to the file when I create it myself? What are the operation steps?
I would suggest to follow the relevant docs TLS Support
thanks, I created the rabbitmq.conf file in the / etc / rabbitmq directory. I used https://github.com/rabbitmq/rabbitmq-server/blob/master/docs/rabbitmq.conf.example inside the file. I wrote the certificates I created with TLS-GEN but failed when I restarted them. Error message:
● rabbitmq-server.service - RabbitMQ broker
Loaded: loaded (/lib/systemd/system/rabbitmq-server.service; enabled; vendor preset: enabled)
Active: activating (auto-restart) (Result: exit-code) since Fri 2019-10-25 06:51:01 PDT; 6s ago
Process: 73072 ExecStart=/usr/lib/rabbitmq/bin/rabbitmq-server (code=exited, status=64)
Main PID: 73072 (code=exited, status=64)
Oct 25 06:51:01 ubuntu systemd[1]: rabbitmq-server.service: Failed with result 'exit-code'.
Oct 25 06:51:01 ubuntu systemd[1]: Failed to start RabbitMQ broker.
Inside the RabbitMQ.conf file
listeners.tcp.local = 127.0.0.1:5672
listeners.ssl.default = 5671
ssl_options.verify = verify_peer
ssl_options.fail_if_no_peer_cert = false
ssl_options.cacertfile= /home/ekrem/tls-gen/basic/result/ca_certificate.pem
ssl_options.certfile= /home/ekrem/tls-gen/basic/result/server_certificate.pem
ssl_options.keyfile= /home/ekrem/tls-gen/basic/result/server_key.pem