By using this website, you agree to the use of cookies as described in our Privacy Policy.

Configure Virtual Hosting

{ This guide was written for CentOS 7/8 and Apache. }

First of all to configure your virtual host you should add your new custom host

sudo vim /etc/hosts

Add the following line

127.0.0.1 SERVER-NAME.com

Then edit the httpd Apache configuration file

sudo vim /opt/lampp/etc/httpd.conf

Be sure to un-comment removing the # on this line

Includes etc /extra/httpd-vhosts.conf

Now that you have enabled the reading of the virtual host configuration file, let's add at the bottom the following lines:

<VirtualHost *: 80>
   DocumentRoot "/ YOUR / PATH /"
   ServerName SERVER-NAME.com

<Directory "/ YOUR / PATH /">
   FallbackResource /index.php
   AllowOverride All
   Order allow, deny
   Allow from all
   Require all granted
</ Directory>
</ VirtualHost>

It is important to enter the parameters

AllowOverride All
Order allow, deny
Allow from all
Require all granted

So you don't have permission issues.

Restart Apache server and check the result:

http://SERVER-NAME.com/

Issues:

In the event despite the parameters

AllowOverride All
Order allow, deny
Allow from all
Require all granted
chmod o+x $HOME

Now everything is ready, enjoy!