virtual host

Forum for you who has PHP installation issues

Moderators: egami, macek, gesf

Post Reply
sheenlim08
New php-forum User
New php-forum User
Posts: 13
Joined: Sun Sep 01, 2019 1:17 pm

Hello, I am trying to move my development environment unto a ubuntu server.

10.0.0.1 - which has bitnami's LAMP running.
10.0.0.2 - is my coding workstation with Visual Studio Code running.

on 10.0.0.2 host file i have.
10.0.0.1 phptutorial.com

on 10.0.0.1 host file i have
10.0.0.1 phptutorial.com

The apache in lamp configuration is set to include the httpd-vhosts.conf

Code: Select all

sheenlim08@ubuntusrv: /opt/lampp/docs$ cat /opt/lampp/etc/httpd.conf | grep vhost
LoadModule vhost_alias_module modules/mod_vhost_alias.so
Include etc/extra/httpd-vhosts.conf
The /opt/lampp/etc/extra/httpd-vhosts.conf is shown below

Code: Select all

sheenlim08@ubuntusrv:/opt/lampp/docs$ cat /opt/lampp/etc/extra/httpd-vhosts.conf 
<VirtualHost phptutorial.com:80>
    DocumentRoot "/opt/lampp/htdocs/phptutorial.com"
    DirectoryIndex index.php
    ServerName phptutorial.com
    ServerAlias phptutorial.com
    ErrorLog "logs/phptutorial.com-error_log"
    CustomLog "logs/phptutorial.com-access_log" common
    <Directory /opt/lampp/htdocs/phptutorial.com>
        Options All
        Require all granted
        AllowOverride All
    </Directory>
</VirtualHost>
the phptutorial.com folder permissions are shown below

Code: Select all

sheenlim08@ubuntusrv:/opt/lampp/docs$ ls -la /opt/lampp/htdocs/
total 52
drwxr-xr-x  6 root   root     154 Nov 19 04:35 .
drwxr-xr-x 31 root   root    4096 Nov 12 01:50 ..
-rw-r--r--  1 root   root    3607 Aug 27  2019 applications.html
-rw-r--r--  1 root   root     177 Aug 27  2019 bitnami.css
drwxr-xr-x 21 root   root    4096 Nov 19 04:43 dashboard
-rw-r--r--  1 root   root   30894 May 11  2007 favicon.ico
drwxr-xr-x  2 root   root      65 Nov 12 01:46 img
-rw-r--r--  1 root   root     260 Jul  9  2015 index.php
drwxrwxr-x  2 daemon daemon    41 Nov 18 23:54 phptutorial.com
drwxr-xr-x  2 daemon daemon     6 Nov 12 01:46 webalizer
while the directory itself contains the following file.

Code: Select all

sheenlim08@ubuntusrv:/opt/lampp/docs$ ls -la /opt/lampp/htdocs/phptutorial.com/
total 4
drwxrwxr-x 2 daemon daemon  41 Nov 18 23:54 .
drwxr-xr-x 6 root   root   154 Nov 19 04:35 ..
-rw-rw-r-- 1 daemon daemon   0 Nov 18 23:54 index.html
-rw-rw-r-- 1 daemon daemon  26 Nov 12 11:16 index.php
However, when I visit the site phptutorial.com, it always redirects to phptutorial.com/dashboard/

any ideas why?
Post Reply