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>
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>
Remember to replace / YOUR / PATH with the path of your web application and SERVER-NAME.com with the name you would like to give to your new address.
It is important to enter the parameters
AllowOverride All
Order allow, deny
Allow from all
Require all granted
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
Order allow, deny
Allow from all
Require all granted
You still have permission issues, give execute permissions to your home directory
chmod o+x $HOME
Now everything is ready, enjoy!