Web Server Installation Error (RHEL) - webserver

my friend has been trying to install web server via RHEL, but this error has pop out, can anybody explain why does this happens? Is it because of the firewall/ports has not been open or am i using the wrong command?

Follow these steps.
Step 1: yum install httpd -y
This will install Apache
Step 2: systemctl enable httpd.service
Step 3: systemctl start httpd.service
Step 4: firewall-cmd --permanent --add-port=80/tcp
Step 5: firewall-cmd --reload
After all this steps are done open your web browser and goto http://localhost or http://127.0.0.1
Your commands looks OK. But it's weird it's not recognizing systemctl.
Can I know the what is this system is. Is it a test RHEL setup ?

Related

Cinder Db Sync Timeout Error in OpenStack Installation

I am trying to install OpenStack on CentOS 7 using PackStack. The commands I am using for installation are:
sudo systemctl disable NetworkManager
sudo systemctl stop NetworkManager
sudo systemctl disable firewalld
sudo systemctl stop firewalld
sudo systemctl enable network
sudo systemctl start network
sudo yum update -y
sudo yum install centos-release-openstack-train
sudo yum install -y openstack-packstack
After this I am editing Neutron Db Sync timeout form 300 to 900, by using the command:
sudo nano /usr/share/openstack-puppet/modules/neutron/manifests/db/sync.pp
The last command I am using for installation is
sudo packstack --allinone
All installation goes well, but in the end getting the following error:
ERROR : Error appeared during Puppet run: 10.0.2.15_controller.pp
Error: /Stage[main]/Cinder::Db::Sync/Exec[cinder-manage db_sync]: Failed to call refresh: Command exceeded timeout
You will find full trace in log /var/tmp/packstack/20210527-145513-WSj_DO/manifests/10.0.2.15_controller.pp.log
Please check log file /var/tmp/packstack/20210527-145513-WSj_DO/openstack-setup.log for more information
Additional information:
* Parameter CONFIG_NEUTRON_L2_AGENT: You have chosen OVN Neutron backend. Note that this backend does not support the VPNaaS or FWaaS services. Geneve will be used as the encapsulation method for tenant networks
* A new answerfile was created in: /root/packstack-answers-20210527-145514.txt
* Time synchronization installation was skipped. Please note that unsynchronized time on server instances might be problem for some OpenStack components.
The content of /var/tmp/packstack/20210527-145513-WSj_DO/manifests/10.0.2.15_controller.pp.log is uploaded here:
The content of /var/tmp/packstack/20210527-145513-WSj_DO/openstack-setup is uploaded here
Can someone help me out to resolve this error? Thanks in advance.

Cant enable service with systemctl

I made this service:
#!/bin/bash
node ../../home/NodeServer/server.js
All it should do is start the server on bootup, so i wanted to do
sudo systemctl enable startServer.service
But I got this error:
startServer.sh.service is not a native service, redirecting to systemd-sysv-insall.
Executing: /lib/systemd/systemd-sysv-install enable startServer.sh
update-rc.d: error: startServer.sh Default-Start contains no runlevels, aborting.
When i try to do
sudo systemctl start startServer.service
it works like intended.
I had the same problem. I solve it typing again the file because it seems that there was a strange character that was broken the parser. Hope this helps!
You want to execute a script, which is not the same as a service.
You can make a file called startServer.service and write the following into it:
[Unit]
Description=Start server that does a thing
[Service]
ExecStart=node /home/NodeServer/server.js
If you want to enable the service, do the following:
sudo ln -s /home/NodeServer/startServer.service /etc/systemd/system/
and now you should be able to start the service.

CentOS systemctl access denied

I would disable Ctrl-Alt-Delete in my CentOS server so I tried:
systemctl mask ctrl-alt-delete.target
but I got:
Failed to execute operation: Access Denied
What can I do ?
PS: I'm root on the server
This can happen when you try to enable a service that does not exist, but is not specific to 'systemctl mask ctrl-alt-delete.target':
> systemctl enable blabla
Failed to execute operation: Access denied
Looks like this is a Centos / Fedora etc. issue.
If you run 'setenforce 0' you will get a better error:
> setenforce 0
> systemctl enable blabla
Failed to execute operation: No such file or directory
Don't forget to re-enable:
> setenforce 1
> getenforce
Enforcing
In Ubuntu you will get the above error without running setenforce 0
Please execute the following commands in order:
sudo systemctl daemon-reexec
sudo systemctl daemon-reload
Worked for me.
During the upgrade of Debian or Ubuntu server you may encounter strange failing of scripts which are restarting services.
For some reason it’s not possible to call systemcl and any operation fails with Access denied even for root.
Here is example:
systemctl list-units
Failed to list units: Access denied
The fix to this problem it is sufficient to send TERM signal to process with PID #1:
kill -TERM 1
Credits: https://georgik.rocks/systemctl-failed-to-list-units-access-denied/
i have meet it in arch linux, when i use common user to run systemctl enable, it's like Access denied, when i use a root user to run it's, i resolve it, place.
Run below command and try again. We will be found a new way if this not worked
su -
Use systemctl daemon-reexec
It's safer than setenforce 0

Setup issues using the hw watchdog with systemd

I'm trying to create a post using the hardware watchdog on a Raspberry Pi running Jessie. I have created a post on the raspberry Pi forum, but up until now no replies with help.
Rather than repeating everything here, this is the link with my setup woes.
Raspi Forum post
The setup procedure is complicated, awkward, poorly documented and confusing. I would like to solicit help to get it right, or pointers to where I should direct a bug report. (watchdog itself works, so does systemd, where do I go for these integration issues?)
Thanks!
Paulv's link and post explains how to do this - check it out for explanations and more info.
If you just want the setup do this:
Install the watchdog package
sudo apt-get install watchdog
Add a line to the watchdog service file
sudo nano /lib/systemd/system/watchdog.service
insert after [install]
WantedBy=multi-user.target
Enable on boot
sudo systemctl daemon-reload
sudo systemctl enable watchdog
Reboot and check status
sudo systemctl status watchdog
I'd repeat what Paulv said, and I think you will also need to enable the Broadcom watchdog module (bcm2835_wdt) in modules:
sudo modprobe bcm2835_wdt
echo "bcm2835_wdt" | sudo tee -a /etc/modules

flocker-docker-plugin not working on centos7.2

I am trying to integrate flocker with docker, for that I found plugin flocker-docker-plugin. I installed it by using the commands on my flocker agents.-
$ yum install -y clusterhq-flocker-docker-plugin
$ systemctl enable flocker-docker-plugin
$ systemctl restart flocker-docker-plugin
It shows flocker-docker-plugin is running. However after few seconds when I checked status by using $ systemctl status flocker-docker-plugin, I got error saying
flocker-docker-plugin.service: main process exited, code=killed, status=11/SEGV
Based on the information you have given there could be multiple reasons for this error:
Check if you can reach the flocker control service and more so if your node-agents can reach the control-service.
Check if the flocker-dataset-agent and the flocker-container-agent are running on your nodes.
Check if you have provided certificates for the flocker-docker-plugin as mentioned on their site (https://docs.clusterhq.com/en/latest/docker-integration/generate-api-plugin.html).
While installing flocker i also got the same error as we have just installed the docker plugin and by default it does't start's up.
First use the command systemctl start flocker-docker-plugin and then check the running status of flocker using systemctl status flocker-docker-plugin
Make sure the control service and dataset agent are running correctly first, you can find logs by looking in /var/log/flocker/, journalctl -u flocker-dataset-agent or running flocker-diagnostics.
Read through any error in these logs such as communication with control service issues, certificates issues, agent.yml config issues etc, or feel free to post them for more help.
You can also find flocker-docker-plugin logs the same way to see specific errors that may be occurring.
Here is more information about how to debug flocker.