Andreas
Andreas

Reputation: 1261

Set up apache with multiple virtualhosts

I'm having problem getting virtual hosts to work as I want to. I've been searching for the last hours but it feels like I'm more lost than before.

So basically I want the following setup:

  1. http://test.localhost => D:\xampp\htdocs\test\site
  2. http://test.localhost/call => D:\xampp\htdocs\test\back\call.pl
  3. And possibly add other stuff like /whatever that points to some other .pl script

Could anyone give me a hint? I must have missed something obvious...

Upvotes: 1

Views: 131

Answers (2)

cakan
cakan

Reputation: 2117

For localhost subdomains you must add that subdomain to /etc/hosts

127.0.0.1       localhost       test.localhost

Upvotes: 1

Pi Horse
Pi Horse

Reputation: 2430

Did you try editing your apache conf file?

Something like this

# vi /usr/local/apache2/conf/extra/httpd-vhosts.conf
NameVirtualHost *:80

<VirtualHost *:80>
 ServerAdmin [email protected]
 DocumentRoot "/usr/local/apache2/docs/thegeekstuff"
 ServerName thegeekstuff.com
 ServerAlias www.thegeekstuff.com
 ErrorLog "logs/thegeekstuff/error_log"
 CustomLog "logs/thegeekstuff/access_log" common
</VirtualHost>

<VirtualHost *:80>
 ServerAdmin [email protected]
 DocumentRoot "/usr/local/apache2/docs/top5freeware"
 ServerName top5freeware.com
 ServerAlias www.top5freeware.com
 ErrorLog "logs/top5freeware/error_log"
 CustomLog "logs/top5freeware/access_log" common
</VirtualHost>

Upvotes: 0

Related Questions