Multiple Vhost issues

Problems with the Linux version of XAMPP, questions, comments, and anything related.

Multiple Vhost issues

Postby Swiftarrow01 » 12. May 2009 06:50

hey, im running a website from home, and im wanting to run two wordpress blogs on it. so far, i have managed to get 1 running and have been using it for quite some time.

the issue now, is ive copied another wordpress file into the htdocs, where the other is, theyre named differently too, obviously, so i made a vhost go to the first and 2nd one. yet when i go to http://www.swiftarrowsworld.com/woe it shows it as non existant? and http://www.swiftarrowsworld.com still works.

the only way to get wordpress2 working is to change the first vhost document root to wordpress2...

current vhost setup
Code: Select all

NameVirtualHost *:80

<VirtualHost *:80>
        ServerName swiftarrowsworld.com/
        DocumentRoot /opt/lampp/htdocs/wordpress
</VirtualHost>

<VirtualHost *:80>
        ServerName swiftarrowsworld.com/woe
        DocumentRoot /opt/lampp/htdocs/wordpress2
</VirtualHost>

Swiftarrow01
 
Posts: 8
Joined: 12. May 2009 06:41

Re: Multiple Vhost issues

Postby Wiedmann » 12. May 2009 07:01

ServerName swiftarrowsworld.com/woe

"/woe" is an URI path, and not part of a hostname (which only can be used in "ServerName".
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: Multiple Vhost issues

Postby Swiftarrow01 » 12. May 2009 07:05

and so how do i get the vhost act as so if i was to type in swiftarrowsworld.com/woe, it would go to wordpress2?
Swiftarrow01
 
Posts: 8
Joined: 12. May 2009 06:41

Re: Multiple Vhost issues

Postby Wiedmann » 12. May 2009 07:18

how do i get the vhost act as so if i was to type in swiftarrowsworld.com/woe,

Not possible with VHosts, because for VHosts you need different Hostnames (VHosts) / ServerNames. (Like "www1.example.com" and "www2.example.com")

In your case, just don't use different VHosts (or VHosts at all), just move the folder "/opt/lampp/htdocs/wordpress2" to "/opt/lampp/htdocs/wordpress/woe" and you can access it with "http://swiftarrowsworld.com/woe". (Or make an Alias to the current dir)
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: Multiple Vhost issues

Postby Swiftarrow01 » 12. May 2009 07:20

so with aliases, i think ive tried using those before. but whenever i do it tricks wordpress and screws it up. but, i guess ill go with the first idea and just throw it into the wordpress file.

thanks :)
Swiftarrow01
 
Posts: 8
Joined: 12. May 2009 06:41

Re: Multiple Vhost issues

Postby Swiftarrow01 » 12. May 2009 07:36

ok wel maybe i wont go the directoryy method... how does one make an alias that doesnt mess everything up?

also, can you get on irc?
Swiftarrow01
 
Posts: 8
Joined: 12. May 2009 06:41

Re: Multiple Vhost issues

Postby Wiedmann » 12. May 2009 08:01

how does one make an alias

An Alias can be:
Code: Select all
Alias /woe /opt/lampp/htdocs/wordpress2

(BTW VHosts, can't you use different hostnames?)

that doesnt mess everything up?

Can you describe "mess everything up"?

BTW:
If you just copy your 1st installation to another location, you must also adjust the configuration for the 2nd installation. But:
How to run 2 wordpress installations on the same server, should be better ask in a Wordpress forum.
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: Multiple Vhost issues

Postby Swiftarrow01 » 12. May 2009 08:04

so where do i put that string you gave me about the alias? do i just throw it intto httdp.conf?
Swiftarrow01
 
Posts: 8
Joined: 12. May 2009 06:41

Re: Multiple Vhost issues

Postby Wiedmann » 12. May 2009 08:15

its as if it changed the document root of everything to the place i aliased to...

Only a VHost is changing the DocumentRoot (that's a principal task of VHosts)

An Alias is working similar to symlinks in the filesystem.

Maybe you want test your setup first with simple html files (to be sure a worpress problem is not involved)
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: Multiple Vhost issues

Postby Swiftarrow01 » 12. May 2009 08:19

i cant use different host names because godaddy.com is too complcated when it comes to them. also, can you get on irc? that would be easier for the two of us :)

also, where do i put the alias string?

thanks :)
Swiftarrow01
 
Posts: 8
Joined: 12. May 2009 06:41

Re: Multiple Vhost issues

Postby Wiedmann » 12. May 2009 08:26

where do i put the alias string?

If you are using no VHosts, somewhere (maybe at the end) in the "httpd.conf".

If you are using VHosts:
- should this Alias work for all VHosts? --> see above (outside any VirtualHost container)
- should this Alias only work for a specific VHost? --> inside the VirtualHost container
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: Multiple Vhost issues

Postby Swiftarrow01 » 12. May 2009 08:38

thanks :) im using a vhost to declare where i want the document root to be, so i can still access the xampp config files through localhost, and i got an alias for the /woe.

thanks again :)
Swiftarrow01
 
Posts: 8
Joined: 12. May 2009 06:41


Return to XAMPP for Linux

Who is online

Users browsing this forum: No registered users and 9 guests