Solved

Virtual Hosting

Posted on 2000-02-29
10
368 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
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
 
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
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Can't get /etc/resolv.conf to configure after reboot 8 71
Kali Linux store / persist wireless password 3 45
cookies analysis tools 2 65
React or Angular? 6 51
Shoutout to Emily Plummer (http://www.experts-exchange.com/members/eplummer26.html) for giving me this article! She did most of it, I just finished it up and posted it for her :)    Introduction In a previous article (http://www.experts-exchang…
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.
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

943 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

4 Experts available now in Live!

Get 1:1 Help Now