Jump to content
The Uniform Server Community
Sign in to follow this  
gratzo

Proper mod_vhost_alias.so install

Recommended Posts

I am attempting to host 3 very small sites (5 static pages each) on the UniformServer v3.2a, on a Windows2000-Pro box. The USv3.2a is up and running, and behind a router - has a dynamic IP of 192.168.1.105. (3 other XP boxes are running at the moment, 100, 101, 102). Internet access is via DSL, dynamic IP.

 

I have uploaded and installed in the modules the mod_vhost_alias.so file, also uncommented the load module portion relative to the mod_vhost in the httpd.config file.

 

I would like to create 3 folders as virtual hosts, something like

w:/www/site1

w:/www/site2

w:/www/site3

 

For example purposes, the domain name is "my-domain-for-siteX.com"

 

From reading at the very bottom of the httpd:config file, I would uncomment and type in the following:

 

<VirtualHost *>
  ServerAdmin webmaster@site1.my-domain-for-site1.com
  DocumentRoot /www/site1
  ServerName site1.my-name-for-site1.com
  ErrorLog logs/site1.my-domain-for-site1.com-error_log
  CustomLog logs/site1.my-domain-for-site1.com-access_log common
</VirtualHost>

<VirtualHost *>
  ServerAdmin webmaster@site2.my-domain-for-site2.com
  DocumentRoot /www/site2
  ServerName site2.my-name-for-site2.com
  ErrorLog logs/site2.my-domain-for-site1.com-error_log
  CustomLog logs/site2.my-domain-for-site2.com-access_log common
</VirtualHost>

<VirtualHost *>
  ServerAdmin webmaster@site3.my-domain-for-site3.com
  DocumentRoot /www/site3
  ServerName site3.my-name-for-site3.com
  ErrorLog logs/site3.my-domain-for-site3.com-error_log
  CustomLog logs/site3.my-domain-for-site3.com-access_log common
</VirtualHost>

 

I'm hoping this is correct - if not, can you guide me with the corrections. Also, is there anything that needs changing in the .htaccess file?

 

thanks,

 

g

Share this post


Link to post
Share on other sites

Yap, thats it. Just make sure to replace my-domain-for-siteX.com with your Ip or domain name.

 

To test it, replace it with localhost and test it by going to http://site1.localhost ...

 

If it works, then you are set for a GO ;) :blink:

Share this post


Link to post
Share on other sites
Yap, thats it. Just make sure to replace my-domain-for-siteX.com with your Ip or domain name.

 

To test it, replace it with localhost and test it by going to http://site1.localhost ...

 

If it works, then you are set for a GO :) :blink:

1535[/snapback]

 

I'm trying a much simpler form of virtual host, and wondering if anyone with some experience can guide me - as I may be trying something that can't be done with the UniformServer v3.2.

 

The overall goal of what I'm trying to achieve is this:

1. create multiple "sites" or domains on one server, we'll call them "site1, site2, site3"

2. be able to access the folders, "site1", "site2", "site3" from the Internet.

3. be able to access the 3 sites from other systems on the LAN, and ftp to them

 

So far, here's the success I've had w/the mod_vhost_alias.so, and the steps I took to get there:

 

1. create 3 folders within the "www" folder, each with a simple index.php file for testing.

2. modify the httpd.config file with the following code:

 

NameVirtualHost *:80

<VirtualHost *:80>
   DocumentRoot /www/site1
   ServerName site1
</VirtualHost>

<VirtualHost *:80>
   DocumentRoot /www/site2
   ServerName site2
</VirtualHost>

<VirtualHost *:80>
   DocumentRoot /www/site3
   ServerName site3
</VirtualHost>

 

3. modified C:\Windows\System32\drivers\etc\HOSTS file with the following mods, so the system is not looking out on the Internet for the URL's.

 

127.0.0.1  site1
127.0.0.1  site2

 

4. Finally, when I enter http://site1, I get served the site1 folder index.php file, same success as if I enter http://site2, etc. That part works fine.

 

Here's where I must be doing something wrong - when I go over to another system on the LAN and try to access the server box, I get an apache error "URL not found on this server". The server at this moment is on machine 192.168.1.100 (Windows XP).

 

The URL I'm typing in is "http://192.168.1.100/site1" - I've tried several variations, even entered the 127.0.0.1 site1 settings in the HOST file, and still getting a URL not found error. I've enabled .htaccess in the "site1" and "site2" folders, and then completely removed them thinking that that may be the problem. Still no access.

 

Is this something that can be done?

 

Apologies for the long post - sure seems like this is something that many people are doing now - so here are the 2 questions:

 

1. what different should be put in the httpd.config file to accomplish this

2. what exactly is the URL that should be typed to get to the "site1" from another box?

 

When I'm done with this, I'm writing a tutorial!! (if I can get it to work... ;)

 

g

Share this post


Link to post
Share on other sites
lol.. this is the big part cause those sites are fake so... hm.. i have to look into this .. research :blink:

 

Try http://site1.192.168.1.100 ...

 

Does http://192.168.1.100/site1 ... work?

1551[/snapback]

 

I studied every example in the Apache virtual hos examples page, and I finally got it working using the code in one of the tutorials that are referenced from the forum.

 

Here's the part that was missing:

<VirtualHost *:80>
   DocumentRoot  /www/
   ServerName  localhost
<VirtualHost>

 

After I entered that, I was able to do the following:

 

1. from the box the server is on - type http://site1 - and get the index of site1

2. from another box on the LAN - type http://192.168.1.100/site1 - and get index of site1.

3. from the box the server is on - type http://localhost - and get the index of the www folder (just as if you didn't have the mod_vhost module running)

 

The tutorial can be found at AppTools.com - virutal host tutorial. Without that last little bit of code - typing http://localhost fails.

 

Again, when I get this all figured out, I'd like to write a tutorial for anyone that may be trying to do what I am, which is, have a test environment within my LAN, using an old (former Win95 converted to Win2000 - but use whatever is lying around the office) computer (as my server), ftp access to that server (just as if I were uploading to a commercial hosting provider, then go "Live" with the site utilizing a dynamic dns service. I have the domain names already, just working on this last piece, and how to get the rest of the world to see these small "mini" sites through my router.

 

I understand port forwarding is in order, as well as setting up one of the dynamic dns clients - my next task!

 

Thanks for all of your advise so far...just wish you weren't the only one responding to all (well, most of) my questions - hoping that someone with some experience doing this can step in so you don't get burned out answering everyone's questions.

Share this post


Link to post
Share on other sites

:blink: I have experience in Virtual Hosts, just that i don't use it much ;)

 

You can submit the tutorial to the wiki: http://wiki.uniofrmserver.com/Virtual_server

 

It is down now, but should be up soon. Upgrading the system.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...