Solved

Virtual Hosting

Posted on 2000-02-29
10
366 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
  • 3
  • 2
  • 2
  • +3
10 Comments
 
LVL 1

Expert Comment

by:hansendc
Comment Utility
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
Comment Utility
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
Comment Utility
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
 
LVL 1

Expert Comment

by:hansendc
Comment Utility
Where do all the other distros put it?
0
 
LVL 12

Expert Comment

by:j2
Comment Utility
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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
LVL 17

Expert Comment

by:psimation
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
The viewer will learn how to dynamically set the form action using jQuery.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

772 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now