Apache

You need at least the following setup:


  ServerName example.com
  ServerAlias example.com www.example.com
  ServerAdmin [email protected]
  DocumentRoot /var/www/html/example_com
  ErrorLog /var/log/httpd/example_com_error
  CustomLog /var/log/httpd/example_com_access common
  
    Options FollowSymLinks Indexes
    AllowOverride All
    Order Allow,Deny
    Allow from all
    DirectoryIndex index.php
   

Note: if got AH01630: client denied by server configuration error. Please use below:


  ServerName example.com
  ServerAlias example.com www.example.com
  ServerAdmin [email protected]
  DocumentRoot /var/www/html/example_com
  ErrorLog /var/log/httpd/example_com_error
  CustomLog /var/log/httpd/example_com_access common
  
    Options FollowSymLinks Indexes
    AllowOverride All
    Require all granted
    DirectoryIndex index.php
   

Credit: @ProjectPatatoe