FORUMula1.com - F1 Forum

Discuss the sport you love with other motorsport fans

For computing and gaming discussion (incl. batracer)
User avatar
By Jabberwocky
#243955
Has anyone used it in virtual host mode so it will host more than one web site? I have looked around online and can still not get it to work.... grrr
User avatar
By myownalias
#243957
Have you tried using the machine IP address instead of the hostname; e.g:

Code: Select all
<VirtualHost 192.168.1.2>
ServerName www.domain.ext
ServerAdmin [email protected]
DocumentRoot /www/domain
</VirtualHost>

I know sometimes DNS can be a problem; resolving to an IP address usually fixes that issue, I could be completely wrong; it's been some years since I actively used Apache, I believe that was 1.3.x.
User avatar
By Denthúl
#243958
Having any specific problems?

This is generally the setup I use on my servers if I'm using Apache, although I've moved to lighttpd at the moment.

Code: Select all
NameVirtualHost *:80

<VirtualHost *:80>
   ServerAdmin [email protected]
   DocumentRoot "/srv/http/mydomain.com"
   ServerName mydomain.com
   ServerAlias www.mydomain.com
</VirtualHost>

<VirtualHost *:80>
   ServerAdmin [email protected]
   DocumentRoot "/srv/http/otherdomain.com"
   ServerName otherdomain.com
   ServerAlias www.otherdomain.com
</VirtualHost>


Whereabouts are you placing your configuration options?
User avatar
By Jabberwocky
#243960
I have been placing it at the bottom of the .conf file

I seem to get 2 types of fail on the many attempts I have tried.
Either the service will not start, or I get an Access Denied page.
User avatar
By Jabberwocky
#243961
Have you tried using the machine IP address instead of the hostname; e.g:

Code: Select all
<VirtualHost 192.168.1.2>
ServerName www.domain.ext
ServerAdmin [email protected]
DocumentRoot /www/domain
</VirtualHost>

I know sometimes DNS can be a problem; resolving to an IP address usually fixes that issue, I could be completely wrong; it's been some years since I actively used Apache, I believe that was 1.3.x.


If I try this then the server appears to do nothing. I have assumed that the virtual host name is an IP address I want to give it on the network. I also have to rely on Dynamic DNS from my ISP so using DynDNS which complicates it a bit more.
User avatar
By Denthúl
#243962
If you get an access denied page, then that's because the permissions aren't set right on the folders for your virtual host. They need read and execute permissions set for the user/group that runs the Apache service. Are you running this on a Linux or Windows box?
Have you tried using the machine IP address instead of the hostname; e.g:

Code: Select all
<VirtualHost 192.168.1.2>
ServerName www.domain.ext
ServerAdmin [email protected]
DocumentRoot /www/domain
</VirtualHost>

I know sometimes DNS can be a problem; resolving to an IP address usually fixes that issue, I could be completely wrong; it's been some years since I actively used Apache, I believe that was 1.3.x.


If I try this then the server appears to do nothing. I have assumed that the virtual host name is an IP address I want to give it on the network. I also have to rely on Dynamic DNS from my ISP so using DynDNS which complicates it a bit more.


Try <VirtualHost *> instead, just to see if it works that way. :)
User avatar
By Jabberwocky
#243963
Having any specific problems?

This is generally the setup I use on my servers if I'm using Apache, although I've moved to lighttpd at the moment.

Code: Select all
NameVirtualHost *:80

<VirtualHost *:80>
   ServerAdmin [email protected]
   DocumentRoot "/srv/http/mydomain.com"
   ServerName mydomain.com
   ServerAlias www.mydomain.com
</VirtualHost>

<VirtualHost *:80>
   ServerAdmin [email protected]
   DocumentRoot "/srv/http/otherdomain.com"
   ServerName otherdomain.com
   ServerAlias www.otherdomain.com
</VirtualHost>


Whereabouts are you placing your configuration options?


This is where I got to last night, this came up with an access denied page. not sure how to give the page access as it is pointed to a folder in httpd specified area
User avatar
By Denthúl
#244003
Could you load web pages in the default directory before you started trying out the virtual host set-up?
User avatar
By Jabberwocky
#244024
yes it was all going well hosting one site lol

I had the sites linked

/url/index (had a button to connect to the phpbb part)

/url/phpbb3/index


I have tried to set the v.hosts as one site being
/url/
and the other
/url/phpbb3/
User avatar
By Jabberwocky
#244196
some improvement made overnight


Can now run the the vhosts and have 1 of the sites working (the one that is /)

where as the /php is causing issues with the access denied, have changed the settings and still the same problem.
User avatar
By Jabberwocky
#244234
Can you take a screenshot of the relative permission lists for those two folders?


I can do when I get home.

I can still link to it from the 1st website, but not the second.
User avatar
By Jabberwocky
#244490
Cheers for you help guys, I sorted it out. well I have got it working, I have ended up using the absolute address instead of the web root address. if that makes sense.

    See our F1 related articles too!