I'm currently trying to install and run apache2, I could install it but not configure it using 'sudo systemctl status apache2' and this error appears:
systemd[1]: Starting The Apache HTTP Server...
apachectl[16656]: (98)Address already in use: AH00072: make_sock: could not bind to ad>
apachectl[16656]: (98)Address already in use: AH00072: make_sock: could not bind to ad>
apachectl[16656]: no listening sockets available, shutting down
apachectl[16656]: AH00015: Unable to open logs
apachectl[16646]: The Apache error log may have more information.
systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE
systemd[1]: apache2.service: Failed with result 'exit-code'.
systemd[1]: Failed to start The Apache HTTP Server.
lines 1-15/15 (END)
So, when I googled about this error I found maybe my port 80 was alredy been used and tried 'ss --listening --tcp --numeric --processes' to find out what is using port 80/tcp, I also kind of messed up using this command sudo kill -9, and now but none of the outputs say 80.
Thank you so much for your valuable help.
Hi, This error is most probably caused by another process in the port you are trying to run apache on. Or it can also be the fact that your firewall (ufw)
might be blocking apache.
To check if the firewall is blocking apache run: sudo ufw app list in your teminal. If apache is in the list then it might be another process. If apache is not in your app list run this command: sudo ufw allow apache2 and then restart apache using sudo systemctl start apache2.
Hope this was helpful
Related
I tried to install apache-kafka several times but I always had this problem. I'm using ubuntu on my virtual machine. When I'm trying to activate kafka service using sudo systemctl start kafka
and then controlling if it's working at first, the output is "active (running)", but if I double-check it and the output is "failed (Result: exit-code) ". And I tried sudo systemctl enable kafka but it didn't work.
This is the output:
● kafka.service
Loaded: loaded (/etc/systemd/system/kafka.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Wed 2021-05-26 05:40:22 PDT; 3s ago
Process: 8098 ExecStart=/bin/sh -c /home/kafka/kafka/bin/kafka-server-start.sh /home/kafka/kafka/co>
Main PID: 8098 (code=exited, status=1/FAILURE)
May 26 05:40:19 ubuntu systemd[1]: Started kafka.service.
May 26 05:40:22 ubuntu systemd[1]: kafka.service: Main process exited, code=exited, status=1/FAILURE
May 26 05:40:22 ubuntu systemd[1]: kafka.service: Failed with result 'exit-code'.
You can see the full output attached
I also tried journalctl -xe and it recommended using ./gradlew jar -PscalaVersion=2.13.5, and I download it, at first it seemed to work, but the following day I had the same problem ( kafka.service: Failed with result 'exit-code'.). And if I tried journalctl -xe I had an output that you can see attached.
With zookeeper I had no problem, it's always active.
Thank you in advance.
Open the file meta.properties.
In my case, it was located at the path /home/kafka/logs/meta.properties
Just comment the the cluster.id with a #
Restart zookeeper and kafka.
I had the same issue by following the tutorial from well known site. I fixed the problem by doing all from the scratch this way.
sudo apt update
sudo apt install default-jdk
I downloaded latest BINARY release from here https://kafka.apache.org/downloads. I used https://dlcdn.apache.org/kafka/3.0.0/kafka_2.13-3.0.0.tgz
sudo wget https://dlcdn.apache.org/kafka/3.0.0/kafka_2.13-3.0.0.tgz
Unpack and move
tar xzf kafka_2.13-3.0.0.tgz
mv kafka_2.13-3.0.0 /usr/local/kafka
edit zookeeper unit file
sudo vi /etc/systemd/system/zookeeper.service
add this content
[Unit]
Description=Apache Zookeeper server
Documentation=http://zookeeper.apache.org
Requires=network.target remote-fs.target
After=network.target remote-fs.target
[Service]
Type=simple
ExecStart=/usr/local/kafka/bin/zookeeper-server-start.sh /usr/local/kafka/config/zookeeper.properties
ExecStop=/usr/local/kafka/bin/zookeeper-server-stop.sh
Restart=on-abnormal
[Install]
WantedBy=multi-user.target
Edit Kafka systemd unit file
sudo vi /etc/systemd/system/kafka.service
and add the content below. Note: You must change JAVA_HOME=path to your path
[Unit]
Description=Apache Kafka Server
Documentation=http://kafka.apache.org/documentation.html
Requires=zookeeper.service
[Service]
Type=simple
Environment="JAVA_HOME=REPLACE-THIS-WITH-YOUR-PATH"
ExecStart=/usr/local/kafka/bin/kafka-server-start.sh /usr/local/kafka/config/server.properties
ExecStop=/usr/local/kafka/bin/kafka-server-stop.sh
[Install]
WantedBy=multi-user.target
Reload the systemd daemon to apply new changes.
sudo systemctl daemon-reload
Start zookeeper and kafka
sudo systemctl start zookeeper
sudo systemctl start kafka
check kafka status now, it should be running
sudo systemctl status kafka
All you need to do is to build kafka project before running it:
./gradlew jar -PscalaVersion=2.13.6
Note that you need to have Java installed
tried to install apache-kafka several times
Kafka doesn't come with Systemd scripts. Follow the official Apache Kafka website to see how you start it without systemctl
If you want to install on Ubuntu, Confluent Community edition allows you to do apt-get install to get both Kafka and Zookeeper
Your error shows an InconsistentClusterIdException, which means you need to wipe the data directories for Zookeeper and Kafka so that the broker will start in a fresh state
For me, I found out that the system actually has 2 folder kafka so when the service started, it said "exit-code"
-> My solution for my problem is delete 1 folder and keep folder /home/kafka
In my case Kafka didn't start in the first place, I reassigned a different logs folder to server.properties files and provided necessary rights to the folder, and restarted both the zookeeper and Kafka services, and then they seem to work.
in my case, I was using a Source Download
which I was : kafka-3.3.1-src.tgz
use binary version
Scala 2.13 - kafka_2.13-3.3.1.tgz
you can download it from https://kafka.apache.org/downloads
telnet is necessary in order to maintain compatibility with older software in this case. I'm working with the Yocto Rocko 2.4.2 distribution. when I try to telnet to the board I'm getting the oh so detailed message "connection refused".
Using the method here and the options here I modified the busybox configuration per suggestion. When the board is booted up and logged in, if you execute: telnet, it spits out usage info and a quick directory check shows that telnet is installed to /usr/bin/telnet. My guess is that the telnet client is installed but the telnet server is not running?
I need to get telnetd to start manually at least so I know it will work with an init script in place. The second reference link there suggests that 'telnetd will not be started automatically though...' and that there will need to be an init script. How can I start telnetd manually for testing?
systemctl enable telnetd
returns: Unit telnetd.service could not be found
UPDATE
telnetd in located in /usr/sbin/telnetd. I was able to manually start the telnetd service for testing from there. After manually starting the service telnet login now works. looking into writing a systemd init script to auto start the telnetd service, so I suppose this issue is closed. unless anyone would like to offer up detailed telnet busybox configuration and setup steps as an answer to 'How to configure telnet service for yocto image'
update
Perhaps there is something more? I created a unit file that looks like this:
[Unit]
Description=auto start telnetd
[Service]
ExecStart=/usr/sbin/telnetd
[Install]
WantedBy=multi-user.target
on reboot, systemd indicates the process executed and succeeded:
systemctl status telnetd
.
.
.
Process: 466 ExecStart=/usr/sbin/telnetd (code=exited, status=0/SUCCESS)
.
.
.
The service is not running however. netstat -l does not list it and telnet login fails. Something I'm missing?
last update...i think
so following this post, I managed to get telnet.socket service to startup on reboot.
systemctl status telnet.socket
shows that it is running and listening on 23. Now however, when I try to remote in with telnet I'm getting
Connection closed by foreign host
Everything I've read so far has been talking about xinetd service (which I do not have...). What is confusing is that, if I just navigate to /usr/sbin/ and execute telnetd, the server is up and running and I can telnet into the board, so I do not believe I'm missing any utilities or services (like the above mentioned xinetd), but something is still not being configured correctly. any ideas?
I'm editing a mongod.conf file to try and add a specific IP to be able to access the database with.
From what I've read I just need to edit this one file and add a second entry to bindIp
Like so:
net:
port: 27017
bindIp: 127.0.0.1, 11.222.333.44
Then save, close and run sudo systemctl restart mongod
Only when I run the restart I run into:
Job for mongod.service failed because the control process exited with error code. See "systemctl status mongod.service" and "journalctl -xe" for details.
But when I run mongo I'm able to connect to the mongo shell locally but unable to connect remotely as the IP binding failed.
If you are able to connect locally, you are most likely connecting to an old process which means either:
process restart didn't work in that it failed to terminate the old process
your configuration is invalid, and restart process identified this and stopped
you have a mongod process running on the default port that you started manually and systemd can't stop it
Verify:
your configuration is correct
you don't have any mongod processes running
Then (re)start again.
Also, review the logs using the commands indicated.
There are a lot of variations for this question, on different forums. I tried a lot of things to get it to work. I am using AWS EC2 and MEAN by Bitnami, I tried connecting using Node JS and I realized that my monogodb service is not running. I checked it by running on the terminal (connected using Putty)
service mongod status
This is the error I get
mongodb.service Loaded:not-found (Reason: No such file or directory)
Active: inactive(dead)
To try my luck, I tried
sudo service mongod restart
And I get this error:
Failed to restart mongod.service : Unit mongod.service not found
Now, just to probe more I tried looking if I have this service installed.
I ran this command: ls /lib/systemd/system
And it gave a huge list, but I couldn't find mongod.service anywhere.
My Ubuntu Ver: 16.04
I am guessing it's not present or maybe I am looking for the wrong stuff. Please let me know how do I get the service to run. I am sort of new to MongoDB and Bitnami.
Each Bitnami MEAN stack includes a control script that lets you easily stop, start and restart services.
The script is located at /opt/bitnami/ctlscript.sh.
To start all services:
sudo /opt/bitnami/ctlscript.sh start
To start a single service:
sudo /opt/bitnami/ctlscript.sh start <service name>
So to answer your question:
sudo /opt/bitnami/ctlscript.sh start mongod
You can obtain a list of available services and operations by running the script without any arguments:
sudo /opt/bitnami/ctlscript.sh
I am starting with a clean install of Fedora 15 on a VirtualBox VM and trying to install Zend Server CE. To install, I adding the Zend repo to yum and ran:
sudo yum install zend-server-ce-php-5.3
The installation itself seemed to go very well. I opened the browser at http://localhost:10081/ZendServer as directed. After clicking through the license page and entering an administative password I get the error:
Failed to access Web server. Please make sure that the Web server is running and listening to the correct port
The Applications, Rules Management and Administration tabs function properly but the Monitor and Server Setup tabs both display the above error. It is a fact that the web server is not running, but when I try to rectify that I get another error:
$ sudo service httpd start
[sudo] Password for XXXXX:
Starting httpd (via systemctl): Job failed. See system logs and 'systemctl status' for details.
[FAILED]
For what it's worth (not much, I'm guessing) here are the details the message refers to:
$ sudo tail /var/log/messages
....
Jan 17 17:24:18 M5 systemd[1]: httpd.service: control process exited, code=exited status=1
Jan 17 17:24:18 M5 systemd[1]: Unit httpd.service entered failed state.
$ systemctl status httpd.service
httpd.service - LSB: start and stop Apache HTTP Server
Loaded: loaded (/etc/rc.d/init.d/httpd)
Active: failed since Tue, 17 Jan 2012 17:24:18 -0500; 3min 44s ago
Process: 19500 ExecStart=/etc/rc.d/init.d/httpd start (code=exited, status=1/FAILURE)
CGroup: name=systemd:/system/httpd.service
The diagnostics don't seem very helpful. I've tried various things, such as installing and starting httpd before installing Zend Server CE, reinstalling httpd (no good: unistalling it caused Zend to uninstall too). The httpd config isn't causing the problem as the following output demonstrates:
$ /usr/sbin/apachectl configtest
Syntax OK
Is this a know problem? What's my next move? Do I start putting debug statements in the control script to see what's failing? I can do that, but I'm hoping someone out there has dealt with this problem and can give me a quick solution.
I was able to get better information on the cause of the problem by invoking the apachectl script directly rather than using the service:
$ sudo /usr/sbin/apachectl start
httpd: Syntax error on line 220 of /etc/httpd/conf/httpd.conf: Syntax error on line 6 of /etc/httpd/conf.d/zendserver_php.conf: Cannot load /usr/local/zend/lib/apache2/libphp5.so into server: /usr/local/zend/lib/apache2/libphp5.so: cannot enable executable stack as shared object requires: Permission denied
The syntax check on httpd.conf didn't catch this because it's not really a syntax error and it's not in httpd.conf either, but in the included zendserver_php.conf. A quick search shows that this error is the result of libphp5.so violating one of the constraints that SELinux enforces. SELinux is enabled by default in Fedora 15.
I don't like to reduce security, but that the only way I've seen this issue addressed. So I disabled SELinux temporarily with the command
$ sudo setenforce 0
I also edited /etc/selinux/config and changed SELINUX=enforced to SELINUX=disabled so SELinux would stay disabled on reboot. Now my web server starts without a hitch:
[mike#M5 ~]$ sudo service httpd start
Starting httpd (via systemctl): [ OK ]
I would like to think someone in the Zend development community is working on this shared library issue. Reducing security is not an acceptable work-around in a lot of cases. If anybody has a better solution, I'd still like to know it.