I managed to install virtual host on LAMP server and created the config file
/etc/apache2/sites-available/site.com.conf
<Directory /home/ihab/Workspace/Webdev/site.com/public_html>
AllowOverride All
</Directory>
<VirtualHost *:80>
ServerName site.com
ServerAlias www.site.com
ServerAdmin webmaster@localhost
DocumentRoot /home/ihab/Workspace/Webdev/site.com/public_html
ErrorLog /home/ihab/Workspace/Webdev/site.com/logs/error.log
CustomLog /home/ihab/Workspace/Webdev/site.com/logs/access.log combined
</VirtualHost>
While I have mod_rewrite enabled I did link my virtual host file from the sites-available directory to the sites-enabled directory:
sudo a2ensite site.com.conf
and added the assigned virtual host domain to my host file /etc/hosts
:
127.0.1.1 site.com
127.0.1.1 www.site.com
I checked /site.com
folder permission, reported as following:
drwxrwxr-x 4 www-data www-data 4096 Jul 18 13:55 .
drwxr-xr-x 4 ihab www-data 4096 Jul 23 19:16 ..
drwxrwxr-x 2 www-data www-data 4096 Jul 18 13:56 logs
drwxrwxr-x 5 www-data www-data 4096 Jul 23 17:21 public_html
I went to my file explorer and discovered that directory site.com
has lock icon while I have 403 Forbidden error when I go to site.com
in browser.
Any help solving the issue is much appeciated :)