Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fresh install: httpd.service: Unit not found

Currently I'm trying to follow this guide: https://marxtudor.com/how-to-install-wordpress-using-ssh-on-centos-vps/

I'm using Google Cloud Platform (free edition to test) and I've created a fresh CentOS 7 VM. The guide above are the first commands I fill in and I keep getting this error:

I've followed so many tutorials, created a new VM and all the time I bump into this error that it doesn't know the httpd command.. I even deleted the project and started all over, but still no luck.

[rsa-key-XXXXXX]$ sudo service httpd restart

Redirecting to /bin/systemctl restart httpd.service

Failed to restart httpd.service: Unit not found.


[rsa-key-XXXXXX]$ httpd -t

-bash: httpd: command not found

[rsa-key-XXXXXX]$

Could anyone please let me know what could be causing this ?

Thanks in advance!

like image 980
Y4551N3 Avatar asked Jun 29 '18 19:06

Y4551N3


People also ask

How do I force start httpd?

You can use the service or systemctl command to restart httpd server. Another option is use /etc/init. d/httpd service script under Linux or Unix-like systems.

Where do I find Httpd services?

The httpd daemon is configured to log to the /var/log/httpd directory by default, and a drop-in for logrotate is provided at /etc/logrotate. d/httpd to enable log file rotation. The httpd. service systemd unit is reloaded after a logrotate run.

What is httpd service Linux?

httpd is the Apache HyperText Transfer Protocol (HTTP) server program. It is designed to be run as a standalone daemon process. When used like this it will create a pool of child processes or threads to handle requests.


2 Answers

I was also getting the same error, this is how i resolved my issue.

After logging to the machine:

  • Step 1: Become the root user. command: sudo su
  • Step 2: Update Kernal command: yum update -y
  • Step 3: Install Apache command: yum install httpd -y
  • Step 4: Start Apache command: service httpd start
  • Step 5: Check Status of Service command: service httpd status

This should solve your problem. good luck

like image 184
Java_Explorer Avatar answered Sep 30 '22 20:09

Java_Explorer


Do you want to install WordPress for your Compute Engine VM instance, using CentOS 7?

If this is the case, you may do so by setting up LAMP for your VM, as described here [1], and then download the WordPress release of your choice [2] and install it on your VM.

I understand that you have successfully set up a VM instance using Centos 7, is this correct? Assuming this, and as you may see from [1], for CentOS 7, these would be the commands to perform this installation:

1) Update and install Apache and PHP:

sudo yum check-update
sudo yum -y install httpd php

2) Start the Apache service:

sudo service httpd start

sudo chkconfig httpd on

3) Install, configure and start DB:

sudo yum -y install httpd mariadb-server php php-mysql
sudo systemctl start mariadb

4) Configure MySQL (set a password for the root user if you want):

sudo mysql_secure_installation

5) Restart Apache sudo service httpd restart

Once MySQL is set up, you will have to create a database for your WordPress installation.

Following this procedure, you will have Apache, MySQL and PHP installed and running on your Compute Engine VM instance.

Then, you can download the WordPress release of your choice [2], unzip the file and install WordPress by visiting your IP address and the folder where WordPress was downloaded. For example, http://YOUR_PUBLIC_VM_IP_ADDRESS/wordpress.

You will be asked for a database name, the user and password. This will allow WordPress to create the wp-config.php file on your behalf and proceed with the installation.

At this point, you should have WordPress already installed on your Compute Engine VM instance using CentOS 7.

An easier way to install WordPress on Compute Engine VM instances, would be by using the Marketpĺace in the Cloud Platform Console. Go to your Products and Services menu > Marketplace, and search for "Wordpress". You will be presented with many different options to launch WordPress in a Compute Engine VM instance. Nevertheless, it seems that Debian is the deafult OS used for these options.


Links:

[1] https://cloud.google.com/community/tutorials/setting-up-lamp

[2] https://wordpress.org/download/

like image 40
Fabián García Avatar answered Sep 30 '22 18:09

Fabián García