Tagged: apache

After a restart, apache return ERR_CONNECTION_TIMED_OUT in CentOS 7

Problem: Before the restart, everything works fine on all websites and apache.

Solution: Try below solution, something must be re-enabled if you choose AWS or other web service provider

  • Allow incoming traffic on port 80:
iptables -A INPUT -p tcp --dport 80 -j ACCEPT
  • Disable firewall
systemctl stop firewalld
  • Disable SELINUX

First edit /etc/selinux/config, then replace SELINUX= to SELINUX=disabled

sudo nano /etc/selinux/config


Then restart

reboot -h now

Block IP in phpmyadmin

problem: block IP in phpmyadmin (or allow some IP only)

Solution: edit /etc/phpmyadmin/apache.conf file (Ubuntu) to restrict access in PHPMyAdmin. In apache.conf file, find “/usr/share/phpmyadmin” in the file and change to below

<Directory /usr/share/phpmyadmin>
Order allow,deny
Allow from

save it and restart apache

sudo service apache2 restart

Restrict directory access in Apache by allow some ip only

problem: Want to protect specific web directory in a simple way in the testing server

Solution: build conf file to restrict access in Apache. Go to /etc/apache2/sites-available/ , create your conf file in this website, for example, itdocumentation.com.conf. Then add below code:

<Directory /var/www/html/itdocumentation/>
Order allow,deny
Allow from

Then enable this Virtual Host configuration file:

a2ensite itdocumentation.com.conf

save it and restart apache

sudo service apache2 restart