Configurant un servidor per fer hosting compartit

Tal i com vaig comentar al anterior post, tinc un VPS contractat a Alemanya. El pas següent era crear un sistema de hosting compartit (per no barrejar projectes propis i per poder hostatjar amics meus). El primer pas es seguir el tutorial The perfect server per a ubuntu 8.04 LTS, no cal fer el referent a DNS (de moment faré servir els DNS de dynadot) ni email (google Apps funciona molt be), però amb un petit canvi, a la hora de instalar el apache es important instalar el paquet apache2-mpm-itk enlloc de  apache2-mpm-prefork. Aquest petit canvi ens permetrà utilitzar la directiva AssignUserId i assignar un usuari diferent (a nivell de Apache) per a cada virtual host. Si voleu enviar emails desde els vostres scripts en PHP també haureu de seguir la part de postfix.

Per afegir un usuari al meu “hosting” només cal fer adduser nom_usuar i crear un fitxer com el que us poso a continuació a /etc/apache2/sites-available. (després cal fer a2ensite nom_fitxer i executar /etc/init.d/apache2 force-reload).

<VirtualHost *>
DocumentRoot "/home/xorduna/alcim.net"
ServerName www.alcim.net
AssignUserId xorduna xorduna
<Directory "/home/xorduna/alcim.net">
allow from all
Options +Indexes
</Directory>
</VirtualHost>

<VirtualHost *>
ServerName alcim.net
RedirectPermanent / http://www.alcim.net/
</VirtualHost>

Evidentment encara em queden per polir alguns detalls. Preguntes als comentaris.


	

One thought on “Configurant un servidor per fer hosting compartit”

  1. Diets high in fat and protein are usually effective
    for people in losing weight. If the injury is not severe, the recovery should be fast.
    If you don’t know the cause of a pain, tap on the image of that pain and you’ll
    probably get a measure of relief.

Leave a Reply

Your email address will not be published.