HOWTO - Create your homepage with apache virtualhost
From wiki.morphey.org
This mini-howto he explains to great lines as to create a dominion as virtualhost of Apache.
We create a space for the consumer "tuodominio" (I have omitted the. it because the name consumer cannot contain special characters and therefore we won't use us 7 characters):
adduser tuodominio passwd tuodominio <you insert the password and from the I Send > rm -rf php.ini ; touch php.ini cd /home/tuodominio mkdir public_html mkdir logs chown tuodominio:tuodominio public_html chown tuodominio:tuodominio logs chmod 711 ~tuodominio chmod 711 public_html
Ok, the space is created. In this way (launching a file server FTP on your file server) every consumer of the dominion can connect in ftp on your file server and to directly publish the pages php, html, images and other of the dominion in public_html.
We now edit the file httpd.conf, (generally inside /etc/httpd/conf/httpd.conf). You go at the end of the file and you insert this code:
NameVirtualHost *:80
This serves to Apache to virtually put on in listening (it must clearly be written once only in the whole file of configuration).
Now for every dominion, in this case I have written that for tuodominio.it, we insert the directives to make to aim him to the briefcase that we have created:
<VirtualHost *:80>
ServerAdmin info@tuodominio.it
DocumentRoot /home/tuodominio/public_html
ServerName tuodominio.it
ServerAlias www.tuodominio.it
ErrorLog /home/tuodominio/logs/error_log
CustomLog /home/tuodominio/logs/access_log common
</VirtualHost>
Don't serve a lot of explanations: we have inserted the email that goes out out on the pages of error, the DocumentRoot (the principal briefcase to which stings tuodominio.it), an alias www and the directories with the files of error and access.
