You are not logged in.
Not sure if this can be done. But here is my case:
Me and my colleague is writing some database applications for out employer. And this server runs Apache, PHP and MySQL.
We want to be able to access different vhosts using just the post after the server local IP-address. (I.e., 10.0.2.242:8080).
Because we want to use the same server for different projects, but we need some way to split this. And so far, a port name is the best.
Another way would be to use the DNS server, and redirect any request for example.com to that particular server. but since we have started to use OpenDNS, that can't be done.
My question is, can't this be achived? If I type 10.0.2.242:8080, i can be directed to /srv/http/test_vhost, where /srv/http is the server root.
Any reply is much apprecited. Since I could find an answear on Google.
Birger
Offline
Isn't there anyone with a tine soluton to my problem?
Birger
Offline
I don't know of a way to do this, but I see 2 solutions:
1) Create some virtual IP addresses on the server and access via the different IP addresses.
2) Named virtual hosts aren't that difficult. You can even add static entries to your hosts file to avoid having to setup your own DNS server:
dev-site1.server.local 10.0.2.242
dev-site2.server.local 10.0.2.243
dev-site3.server.local 10.0.2.244
dev-site4.server.local 10.0.2.245
etc...
(btw, OpenDNS is baaad.)
Are you familiar with our Forum Rules, and How To Ask Questions The Smart Way?
BlueHackers // fscanary // resticctl
Offline
Since I am not that techy, how can this be done? I want different ports to the devider. Not IP addresses, since I have only one IP for the server.
I run Windows at work. But I think I know to set a hosts different. But then I am not sure how apache is configed.
(OpenDNS sucks because? Better then the DNS server located inhouse. It is slooooow. OpenDNS is faster.)
Birger
Offline
sounds like you need a port based virtual host. all you need for that is a Listen directive with a 1.2.3.4:80 per vhost configuration, pointing you to a different DocumentRoot. here's the docs:
http://httpd.apache.org/docs/2.2/vhosts/examples.html
look under the section called Running different sites on different ports
Offline
I have tryed it. But when I added :8080 behind the IP, it would not direct to the correct folder.
(One quested, must I select another folder then one level inside the root folder. Or can I select whichever folder I choose to?)
Goind to post my httpd.conf and httpd-vhosts.conf file tomorrow. Since the server is located at work.
Thank you for the help so far
Birger
Offline
I run Windows at work. But I think I know to set a hosts different.
IIRC, C:\Windows\System32\drivers\etc\hosts
(OpenDNS sucks because? Better then the DNS server located inhouse. It is slooooow. OpenDNS is faster.)
It can screw you up because it *always* returns an IP address, which isn't so bad for web browsing, but when you're trying to do (or diagnose!) other things it can really screw with you.
I have tryed it. But when I added :8080 behind the IP, it would not direct to the correct folder.
Have you uncommented this line in httpd.conf?
#Include conf/extra/httpd-vhosts.conf
Are you familiar with our Forum Rules, and How To Ask Questions The Smart Way?
BlueHackers // fscanary // resticctl
Offline
Haha! I had forgot to include the vhost conf file. Thank you so much!!
Birger
Offline