aoline.com simple non technical information

Setting up a new web account on Debian

Setting up a new web user account on a Linux system is quite straightforward. This is my proceedure:

Log in or su to root and run this command

adduser newusername

Follow the prompts to set the name and password and confirm that the details are correct.

The home directory is probably set to /home/newusername

Exit from root and log in as the new user and you'll arrive straight into your home directory. Run these commands

mkdir htdocs
mkdir logs

Now log in or su back to root and run this command

vi /etc/apache2/apache2.conf

Scroll down to the end of the document and look for any existing <VirtualHost> statements. If non exist they may be in an included file but it is safe to add them here.

<VirtualHost *>
    ServerName newusername.com
    ServerAlias *.newusername.com
    UseCanonicalName Off
    DocumentRoot /home/newusername/htdocs
    CustomLog /home/newusername/logs/access_log Common

    DirectoryIndex index.php

    <Directory /home/newusername/htdocs>
        AllowOverride All
    </Directory>
</VirtualHost>

Exit vi with ESC + :wq and reload the apache configuration with this command

/etc/init.d/apache2 reload

You are now set to direct the DNS for your web domain newusername.com to the IP for this server and documents from the /htdocs folder will be served to the browser.

Additional information on the Apache .conf can be found here:

http://httpd.apache.org/docs/2.0/vhosts/examples.html