Kiyarash
Kiyarash

Reputation: 2578

How start apache in centOS 7

I was starting Apache using this command : service httpd start in centOS6


Today I did download centOS7-64bit-minimal and wanted to start Apache after installing this.
When I use service httpd start, os will show me a message says:

Redirecting to /bin/systemctl start httpd.service


Should I use [root@localhost#] /bin/systemctl start httpd.service??

I tried [root@localhost#] systemctl start httpd.service and it seems it's OK, but in the centOS6, there was starting status with something like [OK] or [FAILED] after starting httpd or something like that, but in this version, there is no report...
Am I in right way?
Is httpd started correctly after this command :
[root@localhost#] systemctl start httpd.service ?

Thanks in advance...

Upvotes: 3

Views: 9999

Answers (3)

Raghuttam
Raghuttam

Reputation: 1

Triggering the httpd service start must be changed.. Suggested way:

systemctl start httpd.service

This would help in Linux EC2 instances.. Helped me though

Upvotes: 0

Nitin1706
Nitin1706

Reputation: 659

you are doing it right. It sends your command to httpd service. You can use this command to see status of last command sent:

service httpd status

Upvotes: 5

Micah Elliott
Micah Elliott

Reputation: 10264

Welcome to Systemd! This has replaced service in recent Red Hat ilk, such as CentOS 7. You are on the right track with systemctl. Now, instead of checking logs in /var/log/messages/, you use journalctl to view logs. To look at logs specific to “httpd”, you can look at the “unit” with:

journalctl -u httpd

Other useful things to do with journalctl:

alias jc='journalctl -xa'  # make a friendly alias for ease of typing
jc -f  # follow the current events

Upvotes: 3

Related Questions