configure multiple public_html directories with a single IP
Moderator: General Moderators
configure multiple public_html directories with a single IP
I've got a fresh installation of xampp. (http://apachefriends.org/en/) Anyway I'd like to configure it to run over a network with more than one web directory(public_html). I only have one ip address. It's been suggested that I run them to different ports. Can someone give me apache directives example for this? Or just how do I go about doing it?
Thanks
Thanks
at the bottom of httpd.conf, there should be something like this:
Just add another as so (change the 8080 to whatever you want):
To get to that addy, though, the user would have to type in the address bar:
example.com:8080
You should do subdomains instead:
Code: Select all
<VirtualHost *:80>
ServerName example.com
DocumentRoot /path/to/public_html
</VirtualHost>Code: Select all
<VirtualHost *:8080>
ServerName example.com
DocumentRoot /path/to/public_html2
</VirtualHost>example.com:8080
You should do subdomains instead:
Code: Select all
<VirtualHost *:80>
ServerName subdomain.example.com
DocumentRoot /path/to/subdomain_html
</VirtualHost>The problem is I don't have a dns or .com address. It's localhost with a single IP over a n intranet.
I've gotten it to work so far with this:
My only problem is that when I hit http://192.168.0.100:8080/ it doesn't load index.php. It tries to load xampp/splash.php -- Any clues where to look to get rid of this annoying option? What directive would make this happen. I don't think the above works with localhost in place of the ip address.
I've gotten it to work so far with this:
Code: Select all
#First tell apache to listen to a port
Listen 8080
...
#Tell it what port to get
<VirtualHost 192.168.0.100:8080>
ServerName 192.168.0.100:8080
DocumentRoot c:/webserver/xampp/htdocs/xampp/rwu/www
</VirtualHost>
Last edited by neophyte on Tue Jun 14, 2005 4:35 pm, edited 1 time in total.
ah. you can get a domain as cheap as 4 USD per year.
Using an IP shouldn't change it, though.
You don't need the port again on ServerName.
Just so you know (I'm sure you do), this is only accessible via your local network. 192.* is a local IP.
Using an IP shouldn't change it, though.
Code: Select all
<VirtualHost 192.168.0.100:8080>
ServerName 192.168.0.100
DocumentRoot c:/webserver/xampp/htdocs/xampp/rwu/www
</VirtualHost>Just so you know (I'm sure you do), this is only accessible via your local network. 192.* is a local IP.
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
I suggest you get an account with no-ip.org (it's free) and then set up virtual hosts by name.
That's easy too (you can have them all on port 80 like they should be).
That's easy too (you can have them all on port 80 like they should be).
Code: Select all
NameVirtualHost *:80
<VirtualHost *:80>
ServerName daliup.no-ip.org
DocumentRoot /home/daliup/public_html/
</VirtualHost>
<VirtualHost *:80>
ServerName corbyn.no-ip.org
DocumentRoot /srv/www/htdocs/
</VirtualHost>
<VirtualHost *:80>
ServerName w3style.co.uk
ServerAlias www.w3style.co.uk
DocumentRoot /home/d11wtq/public_html/.w3style_files/
</VirtualHost>
Last edited by Chris Corbyn on Tue Jun 14, 2005 5:18 pm, edited 1 time in total.
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
neophyte wrote:Any ideas of what directive to look at to make index.php the default instead of xampp/splash.php?
Code: Select all
# List of resources to look for when the client requests a directory
DirectoryIndex index.php index.php3 index.html index.htm index.plBtw, you don't need to buy domain name(s).
Simply edit your /etc/hosts or c:/windows/system32/drivers/etc/hosts
Now i can surf to localhost and to test
Simply edit your /etc/hosts or c:/windows/system32/drivers/etc/hosts
Code: Select all
127.0.0.1 localhost testNow i can surf to localhost and to test
Code: Select all
NameVirtualhost *:80
<VirtualHost *:80>
ServerName localhost
DocumentRoot "e;F:/websites/localhost"e;
<Directory "e;F:/websites/localhost"e;>
AllowOverride All
Options All
</Directory>
</Virtualhost>
<VirtualHost *:80>
ServerName test
DocumentRoot "e;F:/websites/test"e;
<Directory "e;F:/websites/test"e;>
AllowOverride All
Options All
</Directory>
</Virtualhost>