?
Solved

Appache - How to setup multi-hosting

Posted on 2006-05-17
8
Medium Priority
?
438 Views
Last Modified: 2012-06-21
Hi. I'm really new to Linux. I am required to setup a Linux box (I've chosen Debian - I understand is the most stable) and a Http server (for this purpose, I'll be going with Apache). The web server is suppose to support more than a single website. Basically, we are just providing the server to a company responsible for the hosting.

.: The hosting company will be providing Plesk as the administration front-end;
.: There will be more than one site hosted in this web server;

Now I have a couple of related questions:

1. Is Debian a good choice - I hear that Red-Hat is also good although, Debian is the one recommended for servers
2. I already know Appache is the best when it comes to web hosting servers. However, how can I achieve the scenario above, with a suitable level of security (so the OS should be consider as well - not only the web server). Also, I'm coming from the windows world - is there any GUI for administering the Appache server, under Debian?
3. Is there anything I should be aware of regarding Plesk??? Is there any specific config on the server or ports to open .... ???

I am computer literate (check my profile: http://www.experts-exchange.com/M_1080619.html) so you can be as technical as you can be. I'm just new to Linux - that's all! Therefore, I'm really looking for someone willing to help not only craving for the points. If I have to split the points, I will consider it very very carefully.

I know the answers I'm looking are quite difficult to get (specially when it comes to security) and that I might not be able to get very specific instructions. However, I'll be able to understand when someone is really doing his/her best to help me out with this.


Thanks in advance
0
Comment
Question by:rafael_acc
  • 3
  • 2
6 Comments
 
LVL 19

Accepted Solution

by:
alextoft earned 1000 total points
ID: 16698109
1. Debian is fine. RedHat is also fine, or SuSE, or well, anything really. They're all good solid distros with prompt and regular security update support.

2. Apache should run as a separate user, ie. not root. This is usually configured by default. You might want to read up on chrooting, which is essentially jailing a process to a certain area of the filesystem so that even if Apache were to be compromised the intruder would have no access to the rest of the machine.

Webmin is quite handy for administering service config files, although it really would be to your benefit to dive in and learn their workings and how to edit them via the console.

Multiple websites on Apache is easy. It can be done by IP, or as is more common, by servername. A quick example is:

<VirtualHost *:80>
    ServerAdmin your@email.com
    DocumentRoot /var/www/somedomain.com
    ServerName somedomain.com
    ErrorLog logs/some-domain.com-error_log
    CustomLog logs/some-domain.com-access_log common
</VirtualHost>

Which you can just drop in your httpd.conf, or in a separate config file which is loaded additionally by httpd.conf; doesn't matter which was you do it functionality wise, it can just be more tidy from a management perspective.

3. Plesk? Might take a little while to set up, but it's relatively straightforward and great for devolving power down to (l)users without giving them much oppportunity to make a mess of things.

Hope that's of some use.
0
 
LVL 11

Author Comment

by:rafael_acc
ID: 16699130
First, I appreciate for the reply.

"Multiple websites on Apache is easy. It can be done by IP, or as is more common, by servername." - What if there is a single IP and a single server. It can be done with IIS. Can't this be done with Linux/Appache?? I hope this is not one of those features available only in windows - I do hope so as usually people say so many good things about linux and appache

About Plesk: I'm not suppose to set it up. I suppose it would already be set up at the hosting company and basically, our server would just stand "behind" it for users to access it. Thus the question: is there any specific config I should use in order to easy their job?

Cheers
0
 
LVL 11

Author Comment

by:rafael_acc
ID: 16699226
One more thing: "(...) it really would be to your benefit to dive in and learn their workings and how to edit them via the console" - I really agree with that. However, when it comes to deadlines, we just don't get the time for digging ... :(

Cheers
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 19

Assisted Solution

by:Barthax
Barthax earned 1000 total points
ID: 16700421
To get multiple domains on a single address is an extension on Alex's comments.  You will need a NameVirtualHost setting prior to the VirtualHost entries - and multiple VirtualHost entries, each specifying the domain it refers to.  Note that for the NameVirtualHost entry, you need to use a domainname which has an A record the Apache server can recognise as it's own.  Alternatively you can use an IP address, but there must be a subsequent VirtualHost entry later to match the NameVirtualHost entry.

Example with domain name:

NameVirtualHost my.primary.domain:80

<VirtualHost my.primary.domain:80>
    ServerAdmin www@my.primary.domain
    DocumentRoot /usr/local/httpd/htdocs/my.primary.domain
    ServerName my.primary.domain
    ErrorLog logs/my.primary.domain-errors.log
    CustomLog logs/my.primary.domain-access.log combined
</VirtualHost>

<VirtualHost my.secondary.domain:80>
    ServerAdmin www@my.secondary.domain
    DocumentRoot /usr/local/httpd/htdocs/my.secondary.domain
    ServerName my.secondary.domain
    ErrorLog logs/my.secondary.domain-errors.log
    CustomLog logs/my.secondary.domain-access.log combined
</VirtualHost>

As you can see, the directories for the different domains are specified by the DocumentRoot field inside the VirtualHost.

Example with ip address (you point your ip address entry at the default):

NameVirtualHost 127.0.0.1:80

<VirtualHost 127.0.0.1:80>
    ServerAdmin www@my.primary.domain
    DocumentRoot /usr/local/httpd/htdocs/my.primary.domain
    ServerName my.primary.domain
    ErrorLog logs/my.primary.domain-errors.log
    CustomLog logs/my.primary.domain-access.log combined
</VirtualHost>

<VirtualHost my.primary.domain:80>
    ServerAdmin www@my.primary.domain
    DocumentRoot /usr/local/httpd/htdocs/my.primary.domain
    ServerName my.primary.domain
    ErrorLog logs/my.primary.domain-errors.log
    CustomLog logs/my.primary.domain-access.log combined
</VirtualHost>

<VirtualHost my.secondary.domain:80>
    ServerAdmin www@my.secondary.domain
    DocumentRoot /usr/local/httpd/htdocs/my.secondary.domain
    ServerName my.secondary.domain
    ErrorLog logs/my.secondary.domain-errors.log
    CustomLog logs/my.secondary.domain-access.log combined
</VirtualHost>

As you can see, the IP address-based VirtualHost points at the my.primary.domain entry & provides support for very ancient HTTP clients that don't understand how to specify the host they are looking for.
0
 
LVL 11

Author Comment

by:rafael_acc
ID: 16700516
Hmmm ... that's helpful I guess ... I'm still leaving this open to see if I get more input.
Thanks.
0
 
LVL 19

Expert Comment

by:Barthax
ID: 16706878
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
Screencast - Getting to Know the Pipeline
Suggested Courses

839 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