Link to home
Start Free TrialLog in
Avatar of ubixtech
ubixtechFlag for United States of America

asked on

Guidance with CentOS 7 startup basics

I have been charged with the responsibility of rolling out a few Centos 7 based webservers based on the bitnami wordpress stack. I have everything working well expect for the following items I am stuck on.

1. How do I make it so the apache and mySQL services run at startup? If i run this command by hand it works until the next reboot.

$ ./ctlscript.sh start

2. How do I open up web traffic (port 80) using firewallld.

I am familiar with doing this with CentOS 6 using iptables and init.d but this new version is very different. Any guidance is appreciated.
Avatar of gheist
gheist
Flag of Belgium image

1) nothing changed:
chkconfig httpd on
chkconfig mysqld on
2) i dont know about firewalld, probrbly it has to be edited in xml files in /etc/firewalld
you can install system-config-firewall and uninstall firewalld and work like on RHEL6 (at least I did so)
SOLUTION
Avatar of Zephyr ICT
Zephyr ICT
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of pxh
pxh

1) as spravtek said, use "systemctl" , if you use chkconfig as gheist says, CentOS 7 tells you what commands it is using instead.

2) You can continue using iptables.

So systemctl stop firewalld / systemctl disable firewalld and then systemctl enable iptables / systemctl start iptables, before that you should put your iptables config into /etc/sysconfig/iptables
1) it prints commands both ways. There are still some services that are old type and systemctl shows chkconfig command
2) you can use system-config-network like in EL6
Avatar of ubixtech

ASKER

Thanks for all the replies.

(Worked) chkconfig httpd on
(Did not work) chkconfig mysqld on

However they did not persist upon reboot. I am assuming since this is a lamp stack and the software isnt technically installed as a service.

I think my solution to this is to simple have the command
"./opt/wordpress/ctlscript.sh start"
Launch at system startup. What is the best way to approach this with CentOS 7?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks for the assistance. I was able to modify the start-up script and get things rolling. All of your suggestions helped me achieve a resolution.