DeveloperSide.NET Forums
July 06, 2020, 04:47:37 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: 1 [2] 3
  Print  
Author Topic: I am getting frustrated with setting up virtual hosts  (Read 30029 times)
0 Members and 2 Guests are viewing this topic.
cluce
Member
*
Posts: 16


View Profile Email
« Reply #15 on: August 09, 2007, 02:50:59 PM »

Edit the Windows HOSTs file, resolve all your VH domains to 127.0.0.1. Access as http://<domains>.

I had some help with my network admin on this.
OK, I think I know why the default website only pulls up because he has to set the DNS to point to those domains internally because this machine is on an internal network domain for testing.  I am not trying to publeish this to the outside. 
Logged
night2dark2
Jr. Member
**
Posts: 98


Yeah Dont really ask.

mfaiotto@msn.com
View Profile WWW
« Reply #16 on: August 09, 2007, 02:53:11 PM »

Admin you told me a different VHost conf.

The conf im using is

Code:
<VirtualHost *:80>
ServerName lalalala
DocumentRoot "/www/*****/"

<Directory "/www/***/">
   Order Allow,Deny
   allow from All
</Directory>

</VirtualHost>

I think it may be your conf thats the problem. iuno try this conf. but backup your current configuration.
Logged

Revolution Gamers Host.
Master of all Gunz Server Hosting Needs.
Revolution Gamers International Gaming Commmunity
cluce
Member
*
Posts: 16


View Profile Email
« Reply #17 on: August 09, 2007, 03:00:05 PM »

this may help clear something up....

for testing, can I pull up this virtual websites like this ??

http://osiweb/www/vhosts/kilopak
http://osiweb/www/vhosts/reagan
http://osiweb/www/vhosts/awi

or by domain name??

if this is the case I need to fix this to an internal address not the one published externally
Logged
admin
Administrator
Master of All Subjects
*****
Posts: 3272


View Profile WWW Email
« Reply #18 on: August 09, 2007, 03:02:32 PM »

Quote
OK, I think I know why the default website only pulls up because he has to set the DNS to point to those domains internally because this machine is on an internal network domain for testing.  I am not trying to publeish this to the outside.

Open a dos box [run cmd.exe] and type...
ping your-vhost-domain-name

Do this for each vhost domain. You should see those domains resolving to the IP address of the server Apache is on...
Logged

DeveloperSide.NET
Advanced PHP and MySQL Solutions for your Web Design and Development needs with Web.Developer Server Suite.
admin
Administrator
Master of All Subjects
*****
Posts: 3272


View Profile WWW Email
« Reply #19 on: August 09, 2007, 03:03:53 PM »

No, all that should be accessed as http://<ServerName>.

Unless all that somehow gets resolved to the LAN IP address of the Apache Server, AND sets the HOST header of the request to ServerName.
« Last Edit: August 09, 2007, 03:07:57 PM by admin » Logged

DeveloperSide.NET
Advanced PHP and MySQL Solutions for your Web Design and Development needs with Web.Developer Server Suite.
admin
Administrator
Master of All Subjects
*****
Posts: 3272


View Profile WWW Email
« Reply #20 on: August 09, 2007, 03:05:33 PM »

At this point I'm assuming you are accessing the domains from the same system that Apache is running from.

In that case, forget about your network admin and just edit the HOSTs file to resolve ServerName locally to 127.0.0.1.
« Last Edit: August 09, 2007, 03:08:39 PM by admin » Logged

DeveloperSide.NET
Advanced PHP and MySQL Solutions for your Web Design and Development needs with Web.Developer Server Suite.
cluce
Member
*
Posts: 16


View Profile Email
« Reply #21 on: August 09, 2007, 03:23:53 PM »

At this point I'm assuming you are accessing the domains from the same system that Apache is running from.

In that case, forget about your network admin and just edit the HOSTs file to resolve ServerName locally to 127.0.0.1.

actually Apache is on a stand alone PC called OSIWEB and I want to host these websites internally.  So they can be accessed via web on a local network.

I tried pinging kilopak.com and awi.com through DOS on the server PC and it timed out.
Logged
admin
Administrator
Master of All Subjects
*****
Posts: 3272


View Profile WWW Email
« Reply #22 on: August 09, 2007, 03:35:06 PM »

Than you should talk to your net admin about this. I would simply resolve the given domain names to the LAN IP of the Server under the local DNS Server and forget about those OSI URL paths, which probably would not work with VHosts anyways.
« Last Edit: August 09, 2007, 03:38:05 PM by admin » Logged

DeveloperSide.NET
Advanced PHP and MySQL Solutions for your Web Design and Development needs with Web.Developer Server Suite.
cluce
Member
*
Posts: 16


View Profile Email
« Reply #23 on: August 09, 2007, 03:48:25 PM »

Than you should talk to your net admin about this. I would simply resolve the given domain names to the LAN IP of the Server under the local DNS Server and forget about those OSI URL paths, which probably would not work with VHosts anyways.
This is probaly why I can only pull up the default website via web and not the virtual ones through the osi url.  The network admin said I needed to change the domains to work with our company's local domain name so they can be pulled up internally via web.

I just thought I could pull up each virtual websites by the location of the web files such as,

http://osiweb/www/vhosts/kilopak
http://osiweb/www/vhosts/reagan
http://osiweb/www/vhosts/awi

I guess this wont work.
Logged
admin
Administrator
Master of All Subjects
*****
Posts: 3272


View Profile WWW Email
« Reply #24 on: August 09, 2007, 03:57:35 PM »

No, it this case you do not need to use vhosts at all.

Just give simple dir permissions, and you should be able to access per the above URLs.
« Last Edit: August 09, 2007, 04:02:26 PM by admin » Logged

DeveloperSide.NET
Advanced PHP and MySQL Solutions for your Web Design and Development needs with Web.Developer Server Suite.
admin
Administrator
Master of All Subjects
*****
Posts: 3272


View Profile WWW Email
« Reply #25 on: August 09, 2007, 04:00:29 PM »

Just take out all the vh code and use something like this...
Code:
Alias /awi /www/vhosts/awi

<Directory "/www/vhosts/awi">
Options All
AllowOverride All
order allow,deny
allow from all

AddType text/html .php .phps
AddHandler application/x-httpd-php .php
AddHandler application/x-httpd-php-source .phps
</Directory>

Access as http://osiweb/awi
Logged

DeveloperSide.NET
Advanced PHP and MySQL Solutions for your Web Design and Development needs with Web.Developer Server Suite.
cluce
Member
*
Posts: 16


View Profile Email
« Reply #26 on: August 09, 2007, 04:29:55 PM »

yes, That would work if I wanted to view and lists each file but in order to view the web like it should I would think it needs to be hosted.  Because when I click on a web page the links on that page are broken and not under the same directory.

I guess I need to set up loacl domain names to and set it up virtually in order to host multiple websites properly (such as 4 websites)         
Logged
admin
Administrator
Master of All Subjects
*****
Posts: 3272


View Profile WWW Email
« Reply #27 on: August 09, 2007, 04:54:55 PM »

Quote
yes, That would work if I wanted to view and lists each file but in order to view the web like it should I would think it needs to be hosted.

List of index is dependent on the use of an index.html/php file, regardless of whether you are using vhosts or dirs.

You could also code your sites to use a ./ base for any link.

Quote
I guess I need to set up loacl domain names to and set it up virtually in order to host multiple websites properly (such as 4 websites)

If you only want to test from the same system that the server is on, just edit the HOSTs files. This will not work with serving to other systems on the local network, but will work for localhost.
« Last Edit: August 09, 2007, 04:57:33 PM by admin » Logged

DeveloperSide.NET
Advanced PHP and MySQL Solutions for your Web Design and Development needs with Web.Developer Server Suite.
cluce
Member
*
Posts: 16


View Profile Email
« Reply #28 on: August 09, 2007, 05:08:38 PM »

"List of index is dependent on the use of an index.html/php file, regardless of whether you are using vhosts or dirs."

oh OK well I added the dir to the end of my httpd file, you had in the previuos post and my links were broken as a result my pages did not view properly.

Although, it did list all the web files in the browser like a server does for each website.

"You could also code your sites to use a ./ base for any link"
I am not sure what you mean by this?
Logged
admin
Administrator
Master of All Subjects
*****
Posts: 3272


View Profile WWW Email
« Reply #29 on: August 09, 2007, 05:20:22 PM »

Quote
Although, it did list all the web files in the browser like a server does for each website.

Was there an index.html or index.php file under this directory? That is what Apache will serve if it can find it... And if not, it will list the contents.
Logged

DeveloperSide.NET
Advanced PHP and MySQL Solutions for your Web Design and Development needs with Web.Developer Server Suite.
Pages: 1 [2] 3
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.9 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!