Configure Apache

Simon Leung
Simon Leung used Ask the Experts™
on
How to configure Apache server such that access to the public ip of the server will automatically redirect me to the ./web/index.php

vhost.conf
<VirtualHost *:80>
    ServerAdmin mis@abc.com
    ServerName abc.com
    ServerAlias www.abc.com
    DocumentRoot /var/www/html/mec/
    ##ErrorLog /var/www/html/example.com/logs/error.log
    ##CustomLog /var/www/html/example.com/logs/access.log combined
</VirtualHost>

Thx
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Fractional CTO
Distinguished Expert 2018
Commented:
Skip the auto redirect, as this is like a poor choice.

Instead, set this...

    DocumentRoot /var/www/html/mec/web

Open in new window


And your correct index.html page should serve.
Prabhin MPDevOps Engineer
Distinguished Expert 2018

Commented:
change  ServerName abc.com
   to  ServerName IP address

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial