Jump to content

Virtual Hosting


_Ray

Recommended Posts

Hey,

Currently I am hosting a 2 websites (well, same website really) on 2 computers in my house, both on the same IP via NAT on my router.

One website is www.domain.tld and references the computer 192.168.1.80 on my internal network.

The other site is www.domain.tld:port and references the computer 192.168.1.81 on my internal network.

I'm looking for a better way to do this other than creating a link to another port, and I've already registered a sub domain but I'm confused on how to set up virtual hosts and DNS records don't let you specify port numbers.

Some way or another, I would like to have my main domain reference the server at 192.168.1.80 just like it does now, but then rather than having a separate port number, having a subdomain (sub.domain.tld) reference the server at 192.168.1.81 on my network.

Both computers are using HFS 2.2f.

http://www.rejetto.com/hfs/

Is this possible to set up without Apache?

Thanks,

Raybob

Link to comment
Share on other sites

Why not? Let me try and explain this (keep in mind I'm just trying to help)...

There are two main web servers that people use. There's Apache, and there's lighttpd. People use these two web servers because they are the best and they are well supported. They aren't the most popular web servers for no reason.

It's very hard to support you if you're using some obscure web server that is really unpopular and is only made for Windows, and the website suggests using it in Wine if you're on Linux... I suggest installing XAMPP and going from there.

Also, your knowledge of web design has absolutely no affect on choosing a server. The server cannot help you become a better web designer.

Link to comment
Share on other sites

Why not? Let me try and explain this (keep in mind I'm just trying to help)...

There are two main web servers that people use. There's Apache, and there's lighttpd. People use these two web servers because they are the best and they are well supported. They aren't the most popular web servers for no reason.

It's very hard to support you if you're using some obscure web server that is really unpopular and is only made for Windows, and the website suggests using it in Wine if you're on Linux... I suggest installing XAMPP and going from there.

Also, your knowledge of web design has absolutely no affect on choosing a server. The server cannot help you become a better web designer.

If I used Apache then wouldn't I have to manually write every page and update all the files on my own?

I'm just trying to build a simple file server that manages files automatically and has its own side scripting and this one seems to do it well . . . Why do you not like HFS? Because it's hard to support or because it just sucks?

I know HFS can't do virtual servers but I was wondering if some other program could or if I could somehow use Apache over it, with one host that references HFS on another port on the main domain and then another virtual server that references my other computer on the subdomain.

BTW as for web design I know some XHTML (Transitional) and CSS and the very basic basics of javascript and that's about it.

Link to comment
Share on other sites

If I used Apache then wouldn't I have to manually write every page and update all the files on my own?

What do you mean? Are you saying you don't want to drag and drop a file into the htdocs directory? Since you're on a local network then just save it directly into it, or use an FTP client to automatically upload the new file whenever it has been touched (modified).

I'm just trying to build a simple file server that manages files automatically and has its own side scripting and this one seems to do it well . . .

Can you explain further? I don't understand what you mean by this.

Why do you not like HFS? Because it's hard to support or because it just sucks?

Those two go together, usually.

I know HFS can't do virtual servers but I was wondering if some other program could or if I could somehow use Apache over it, with one host that references HFS on another port on the main domain and then another virtual server that references my other computer on the subdomain.

You could probably do that I guess, you'd need a DNS server. I've never used a Windows DNS server.

BTW as for web design I know some XHTML (Transitional) and CSS and the very basic basics of javascript and that's about it.

Yeah but that doesn't have to do with the server.

Link to comment
Share on other sites

I'm just trying to build my own little mediafire for use by myself and some of my friends.

HFS allows uploads and updates the pages based on whatever people put on there, Apache would force me to do EVERYTHING manually, which just wouldn't work.

It would be like I upload a file to mediafire and one of their people has to go in and change my page to show the file I just uploaded rather than their software updating the page automatically.

Are there any programs I could you on top of HFS as a DNS server like Stunnel goes over top of Apache or HFS?

A microsoft DNS server if I'm not mistaken requires Windows Server 2003 which I obviously can't afford plus I have no clue how to work it.

Link to comment
Share on other sites

A microsoft DNS server if I'm not mistaken requires Windows Server 2003 which I obviously can't afford plus I have no clue how to work it.

No, just go to add/remove programs and install IIS, which also sucks because you'd have to install PHP, mySQL and PHPmyAdmin if needed manually. Any server can do the job, like mediafire, I bet Mediafire uses Apache or lighttpd, some sites even use IIS but that's another story. What you need is a decent working website script so it uploads files to a certain folder, you'll always have access to them by FTP or locally but you'd have to script a website first, so it could upload. The only thing you must change manually is the max upload size on php.ini to what you wish, nothing more? :blink:

Edited by Spider-Vice
Link to comment
Share on other sites

A microsoft DNS server if I'm not mistaken requires Windows Server 2003 which I obviously can't afford plus I have no clue how to work it.

No, just go to add/remove programs and install IIS, which also sucks because you'd have to install PHP, mySQL and PHPmyAdmin if needed manually. Any server can do the job, like mediafire, I bet Mediafire uses Apache or lighttpd, some sites even use IIS but that's another story. What you need is a decent working website script so it uploads files to a certain folder, you'll always have access to them by FTP or locally but you'd have to script a website first, so it could upload. The only thing you must change manually is the max upload size on php.ini to what you wish, nothing more? :blink:

I guess I will just use HFS until I sufficiently learn PHP and more javascript then somehow port over to XAMPP ^_^

If I ever choose to really use a subdomain I guess I'll just buy hosting and direct it to there because this doesn't matter enough to me to take a bunch of time to figure it out lol

Link to comment
Share on other sites

Wow, there seems to be a TON of confusion in this topic.

HFS is a neat little web server, it serves up pages and files in a nice easy way. Apache is a very powerful web server, it serves up HTML files. You then need PHP to turn PHP files into HTML pages for Apache to serve up. IIS does the same thing, serving up HTML files, and ASP.net converts ASP files to HTML when serving up.

Apache is huge and confusing. You seem to be a bit of a computerist, so I'd recommend learning it, but it is really tricky. You can run it on Windows, but I've not tried that in a long time.

If you just want a few files from your PC to be on the web, stick with HFS. If you want to run a website, get Apache, MySQL and PHP. I'd recommend doing that on Linux, but they can run on Windows too.

A DNS server simply tells the user the IP address for the domain you request. It can NOT tell you the port number to use. So you could use it to say www.domain.com is at IP 1.2.3.4 whereas blog.domain.com is at 5.6.7.8 - you can't use it to say blog.domain.com should be at 1.2.3.4:8080. DNS servers can not show/fetch pages or redirect users or anything - it just tells them an IP.

What you need is a reverse proxy server. This is where one proxy server (on your network) can request pages from other servers, but serve them to the user as if it came from the proxy (on the same ip/port).

So you would have both domains pointing to your IP, and forwarding port 80 to the main web server, which you will use as your proxy. No need for a second port forward to the other server. The web server on your proxy (such as apache) then decides what to send to the user: either a page from somewhere on that server, or a page from another server. Of course the proxy server would need to be turned on for any of it to work.

Apache can do this, using the mod_proxy module, but I don't think HFS can. You would need to use some additional reverse proxy server software, such as squid.

(This is sort-of similar to web proxies which request other pages then send it back to you, but it works differently, and it's completely transparent to the user)

The way big companies with a big website do this is that all their domains point to a group of DNS servers. They then send the user to different groups of dedicated squid proxy servers. They then pull the information from separate web servers (which get their information from separate database servers) and return it to the user. Files and images are sent from separate web servers. You're doing a very condensed version of this all on one/two servers.

Link to comment
Share on other sites

Thanks for the insight Gerard!

I will definitely do some research on Squid and Reverse Proxies . . .

Like I said though my knowledge is very limited so until I learn PHP and SQL I'm gonna just have to stick with HFS and basic XHTML and CSS. Before I do anything serious though, yeah I'll definitely have to get a real web server.

Thanks for the info!

Link to comment
Share on other sites

I apologize, I've looked more into HFS. I assumed it was just another shitty server that was trying to be like Apache/lighttpd.

If you are using it for that specific purpose I say it's a great idea! So, yeah, I'd look into more information on DNS servers and if you get stuck somewhere come back here -- DNS servers are not currently my specialty, but I'm sure someone can help.

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...