Solved

Virtual Hosting

Posted on 2000-02-29
10
373 Views
Last Modified: 2013-12-05
what is virtual hosting?

I want to administrate 2 web sites in only one apache server, how to do it?
0
Comment
Question by:mwhuen
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +3
10 Comments
 
LVL 1

Expert Comment

by:hansendc
ID: 2569997
It takes a little bit more than can be explained here.  Have you even LOOKED at the Apache documentation?  It isn't an exceedingly difficult thing to do.  

Look at these docs:
http://www.apache.org/docs/vhosts/index.html
0
 
LVL 2

Expert Comment

by:EatEmAndSmile
ID: 2570103
It is quite simple. First you must assure that both web addresses point to your Apache's IP address. Then there are a few options to tweak in /usr/local/apache/conf/httpd.conf

 As our friend above said, it's not difficult to do it.
0
 
LVL 12

Expert Comment

by:j2
ID: 2570301
Eat: your suggested path is not correct for Debian, Redhat, SuSE, TurboLinux, Bestlinux. (Adn dont give me the "It is not my fault if they use a 'broken' distribution and they should all change to slackware") ;)
0
The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

 
LVL 1

Expert Comment

by:hansendc
ID: 2570310
Where do all the other distros put it?
0
 
LVL 12

Expert Comment

by:j2
ID: 2570426
RH / mandrake / SuSE uses

/etc/httpd/conf/httpd.conf and srm.conf for vhosting (and of cource access.conf)

not to sure about the others, but it is under the /etc structure.
0
 
LVL 17

Expert Comment

by:psimation
ID: 2571697
j2 , Eat is 100% correct about the path; provided that he mentioned that he installed his own apache server, and not selected to install apache during installation of the OS. This way is also in my view the best route to follow, for one reason alone, installing frontpage server extensions on your web is near impossible if you use apache from the OS install.
mwhuen, as others have mentioned, it is not "as" easy as some might suggest, there are a couple of things you need to do first. You need a static IP for your server box. (not just any IP you can think of, this IP must be unique on the internet) If you have such an IP, then you need a name server as well. The name server must then point any requests for webpages you want to host on your pc, to your pc's IP. For instance, if you want to host two pages www.1.com, and www.2.com, both need to point to the same IP. On your webserver box, you will then need to edit the httpd.conf file. If you install your own apache, it will be at /usr/local/apache/conf/httpd.conf, if it was installed with the OS, it will be in /etc/httpd/conf/httpd.conf
Don't edit the other *.conf files, you only need to edit the httpd.conf file.
You will add the virtual hosts right at the bottom of that file ( there will already be a sample of a virtual host, you just need to change it to match your needs). You will also need to ensure that the rest of the file is correct, eg. server name, and you should also add NameVirtualHost xxx.xxx.xxx.xxx :80
where xxx = your IP.
Then you will also need to ensure that the permisiions of your web files are set so that it can be accessed from outside, therefore, make it writeable to the owner of the web only, and all the other permissions can be set active.
0
 
LVL 2

Expert Comment

by:EatEmAndSmile
ID: 2572529
hansendc: I really don't know how many Linux distributions are there today, as I've found my favourite distribution already. Slackware puts it in /usr/local/apache, the place suggested by nobody else than the Apache developing team. Should we argue with them? :)

j2: As I'm developing e-commerce applications based on MySQL + PHP3 + Apache, I had to build Apache myself with support for these tools. As a good admin, I've installed Apache in the recommended path, that is /usr/local/apache. That is no surprise to me, as a good distribution like Slackware already puts it there. Also, srm.conf is deprecated (if you've ever built your own Apache, you'll see the message left by the Apache developing team in this same file) so you should find all configuration parameters inside /usr/local/apache/conf/httpd.conf.

psimation: I've forgot about those details! I mean, the real IP thing and DNS. I thought that was already well-known. Thanks!
0
 

Author Comment

by:mwhuen
ID: 2573470
Thanks for all you guys,
I learnt much in this question.
psimation said I need a name server as well,
can you guys give more information about it?

does linux include name server? how to configure it?
0
 
LVL 2

Expert Comment

by:EatEmAndSmile
ID: 2573536
Yes, named is the DNS server (name server) that comes with the BIND package. It's configured in /etc/named.conf. Configuring it is quite simple and you should have no trouble doing it as long as you have some free time to carefully read the DNS-HOWTO file included in your /usr/doc/Linux-HOWTOs directory. It won't take more than a few hours if you do it slowly and patiently.

 The DNS server is responsible for telling everybody who's holding the web addresses you plan on hosting. Just like: "Hey!! I'm the owner of www.mwhuen.com!!"

 Hope this get you where you want.

 Good luck!
0
 
LVL 1

Accepted Solution

by:
Sokka earned 10 total points
ID: 2576019
1. Make sure U have apache server installed in Ur PC

2. Then U will have a directory like /usr/local/apache or /usr/bin/apache

3. Go to that drectory

4. U can see a file called as httpd.conf

5. Opne the file

6. U can see the virtual hosting systax...

7. Remove the comment and give the virtual hosting of any number of domains

8. restart apache server

0

Featured Post

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

The purpose of this article is to demonstrate how we can use conditional statements using Python.
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question