Questions about linux - domain setup and mailbox set up

Hi,

I want to learn about the ‘mechanics’ of setting up domain space and mailboxes on a linux server as well as setting up each clients ‘tools’ eg webaliser,mod_perl, php etc, just as would normally be done in Plesk, for example. (edit - Those packages are already on the server).

I have searched without success for a tutorial so I would be very grateful if anyone could give me a link or to respond to my questions below so that I can remove a load of duplication between running my own db and that of Plesk.

  1. when I create a new domain folder for www.example.com, is that as simple as mkdir? does the detail of that dir need to be stored anywhere on the server or is it enough just to create it?

  2. when setting up a mailbox, where do I save it? is it just a normal directory located in a specific server directory?

  3. Where do I set the features that a domain has access to? eg mod perl, php, fast CGI etc.

  4. If all this data is to be stored in a MySQL-type database, where should I set the connection params on the server so it knows which db to connect to?

bazz

Hi, you’re using Linux so I’m assuming apache here.

  1. when I create a new domain folder for www.example.com, is that as simple as mkdir? does the detail of that dir need to be stored anywhere on the server or is it enough just to create it?
  • Technically, yes. But you do have to configure the webserver to understand that that folder is associated with a host. You do this by adding a host configuration, probably for a virtualhost. Here you tell the webserver which domainname is associated with which settings and data.
  1. when setting up a mailbox, where do I save it? is it just a normal directory located in a specific server directory?
  • Usually maildata is saved in a user’s home directory (/home/joe/Maildir in case of IMAP, for instance) but this can be configured in your particular mailserver configuration file, like /etc/postfix (mail) /etc/dovecot (imap) it really depends.
  1. Where do I set the features that a domain has access to? eg mod perl, php, fast CGI etc.
  • This is done in the (virtual)host configuration, as per point one.
  1. If all this data is to be stored in a MySQL-type database, where should I set the connection params on the server so it knows which db to connect to?
  • Usually the webapplication that needs to access the data has to know about this, so you’d set PHP (for instance) up to talk to the MySQL DB.

I hope I’m clear enough - the apache/lighttpd/etc docs are a great resource. Feel free to ask more if you’re unsure about things.

OK, sorry for not coming back to this sooner.

OK, I have read up some ore on virtual hosts. What (I trhink) I am trying to do is to tell the httpd.conf file wghere to get the data it needs from.

Instead of adding this section <below), to the bottom of the httpd.conf file for each domain, I want to store whatever is necessary in a mysql db and have the httpd.conf file read it in when it needs to.

so I want to ‘include’ (if that is the correct term), instead of


<VirtualHost www.smallco.com>
ServerAdmin webmaster@mail.smallco.com
DocumentRoot /groups/smallco/www
ServerName www.smallco.com
ErrorLog /groups/smallco/logs/error_log
TransferLog /groups/smallco/logs/access_log
</VirtualHost>

I can’t seem to find anywhere that shows me how to do it but I expect it can be done.

I can’t use control panel or plesk because this is for an environment where there are multiple servers connected through a RAID array, where some webservers are active slaves so that they take over if/when a live one fails.

bazz

Tricky. If you want to store such config settings in a DB and create vhosts on the fly, you want to have control over your webserver from inside a webapplication, probably. Such things are possible with mod_perl. Perhaps also with mod_php, I am not sure.

Thanks, I’ll look those up.

I just checked section 3 of my httpd.conf file and this is the end of it.


#<VirtualHost *:80>
#    ServerAdmin webmaster@dummy-host.example.com
#    DocumentRoot /www/docs/dummy-host.example.com
#    ServerName dummy-host.example.com
#    ErrorLog logs/dummy-host.example.com-error_log
#    CustomLog logs/dummy-host.example.com-access_log common
#</VirtualHost>

AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

Is this anything to do with where the scripts are that get the data from the db used by Plesk?

bazz

You might want to take a look at Mass Virtual Hosting.

Thanks Scallio. I think I have been there but, I’ll stick at it. :wink:

bazz