Some Linux Tips




LINKS

Some Debian Tips
awardspace.com "free webhost"
drivehq.com "free storage"
spideroak.com "free storage"
dnsexit dynamic dns server
freedns.afraid dynamic dns server
dns.he.net dynamic dns server




index   Previous   Next


To setup a web server the apache2 must be installed or insall with aptitude insall apache2.
Create a directory:

mkdir   /home/www/example.net/htdocs
mkdir   /home/www/example.net/cgi-bin

mkdir   /home/www/example.mydyn.net/htdocs
mkdir   /home/www/example.mydyn.net/cgi-bin


Copy the html documents to the htdocs of every server and set permissions to:

chmod -R 0755 www

Now to configure the /etc/httpd/conf/httpd.conf for the virtual hosts, change these lines for your web server:

ServerAdmin = admin@example.net
ServerName = www.example.net


Now add the virtual hosts to the end of the httpd.conf as:

<VirtualHost *:80>
ServerAdmin webmaster@example.net
ServerName example.net
ServerAlias www.example.net

# Indexes + Directory Root.
DirectoryIndex index.html
DocumentRoot /home/www/example.net/htdocs/

# CGI Directory
ScriptAlias /cgi-bin/ /home/www/example.net/cgi-bin/
<Location /cgi-bin>
Options +ExecCGI
</Location>

# Logfiles
ErrorLog /home/www/example.net/logs/error.log
CustomLog /home/www/example.net/logs/access.log combined
</VirtualHost>


The hostname should be resolved by the DNS server dnsmasq, restart the httpd server.
Download the httpd.conf.