install and run apache2 in centos 7 1. download the latest apache2 from http://httpd.apache.org/download.cgi 2. the current lastest version is https://www-eu.apache.org/dist//httpd/httpd-2.4.41.tar.gz 3. tar -zxvf httpd-2.4.41.tar.gz; cd httpd-2.4.41; ./configure; make; make install 4. the installed apache is located at /usr/local/apache2 5. to activate it, use /usr/local/apache2/bin/apachectl -f /usr/local/apache2/conf/httpd.conf 6. If you want your server to continue running after a system reboot, add a call to apachectl to your system startup files. This will start Apache at boot time. Refer to https://geekflare.com/systemd-start-services-linux-7/ for managing and starting processes on boot vi /etc/systemd/system/chat_server.service and then the following is needed. ################## [Unit] Description=Chat Server Service After=network.target [Service] Type=simple User=ankush ExecStart=/usr/local/apache2/bin/apachectl -f /usr/local/apache2/conf/httpd.conf Restart=on-abort [Install] WantedBy=multi-user.target ################## Save the file and the next step is to reload the systemd daemon systemctl daemon-reload and to start the service we just created: systemctl start chat_server check the selinux status (/etc/sysconfig/selinux) using sestatus refere to https://www.digitalocean.com/community/tutorials/iptables-essentials-common-firewall-rules-and-commands to set iptables refer to https://linuxize.com/post/how-to-install-iptables-on-centos-7/: yum install iptables-services firewall-cmd --state ## to check firewall state To check what zones are used by your network interface(s) type: firewall-cmd --get-active-zones firewall-cmd --zone=public --list-all must edit /etc/hosts so that it reads similar to 127.0.0.1 comsics comsics.usm.my localhost4 localhost4.localdomain4 ::1 comsics comsics.usm.my localhost6 localhost6.localdomain6 10.205.19.208 comsics comsics.usm.my