logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in  RSS Apache Lounge  


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.



Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: apache virtualhost redirect to default htdocs root
Author
alain.roger



Joined: 24 Feb 2016
Posts: 4
Location: Slovakia

PostPosted: Thu 03 Oct '19 12:51    Post subject: apache virtualhost redirect to default htdocs root Reply with quote

Hi,

i use XAMPP on ubuntu 19.04 and i'm trying to use virtualhost file to declare several virtualhost in order to have several websites to test on my local computer.

in my hosts file i declared:
Code:
127.0.0.1   test1.dev
127.0.0.1   test2.dev


in my httpd-vhosts.conf file i have:
Code:
<VirtualHost *:80>
    DocumentRoot "/opt/lampp/htdocs/test1.dev"
    ServerName www.test1.dev
    ServerAlias test1.dev
   <Directory "/opt/lampp/htdocs/test1.dev">
      Options Indexes FollowSymLinks Includes ExecCGI
           AllowOverride None
           Require all granted
   </Directory>
    ErrorLog "logs/test1.dev.com-error_log"
    CustomLog "logs/test1.dev.com-access_log" common
</VirtualHost>


and the same for test2.dev

in the browser if i type: http://test1.dev, browser directs me to root of htdocs and therefore to localhost/dashboard of XAMPP, while it should go to content of /opt/lampp/htdocs/test1.dev

What am i doing wrong ?
thx
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 6661
Location: Germany, Next to Hamburg

PostPosted: Fri 04 Oct '19 23:03    Post subject: Reply with quote

Did you restart apache ?

There should be a binaray apache or httpd or apache2. I'm not used to xampp on linux.

How ever

try
sudo /opt/xampp/path/to/httpd -S
or
sudo /opt/xampp/path/to/apache -S
or
sudo /opt/xampp/path/to/apache2 -S
Back to top


Reply to topic   Topic: apache virtualhost redirect to default htdocs root View previous topic :: View next topic
Post new topic   Forum Index -> Apache