skal en være en windows servr eller linu server ??
du skriver Linux webserver
http://www.yolinux.com/TUTORIALS/LinuxTutorialWebSiteConfig.html rpm -q httpd bind bind-chroot bind-utils system-config-bind xinetd vsftpd
RPMs added FC2+: system-config-httpd
RPMs added FC3+: httpd-suexec
•Red Hat 9.0
rpm -q httpd bind xinetd vsftpd,
•Red Hat 8.0
rpm -q httpd bind xinetd wu-ftpd•Red Hat 7.x:
rpm -q apache bind inetd wu-ftpdUse wu-ftpd version 2.6.2 or later to avoid security problems.
•SuSE 9.3:
rpm -ivh apache2 apache2-prefork bind bind-chrootenv bind-utils vsftpd
apache2-MPM is needed by apache2-2.0.53-9Also see Apache.org: MPMs
•Ubuntu (natty 11.04) / Debian:
apt-get install apache2
apt-get install bind9
apt-get install vsftpd
•Ubuntu (dapper 6.06/hardy 8.04) / Debian:
apt-get install apache2 apache2-common apache2-mpm-prefork apache2-utils
apt-get install bind9
apt-get install vsftpd
The Apache web server configuration file is: /etc/httpd/conf/httpd.conf
Linux distribution
Red Hat 7.x-9, Fedora Core, Red Hat Enterprise 4/5/6, CentOS 4/5/6 /var/www/html/
Red Hat 6.x and older /home/httpd/html/
Suse 9.x /srv/www/htdocs/
Ubuntu (dapper 6.06) / Debian /var/www/html
Ubuntu (hardy 8.04/natty 11.04) / Debian
/var/www
default configuration will allow one to have multiple user accounts under one domain by using a reference to the user account:
http://www.domain.com/~user1/. If no domain is registered or configured, the IP address may also be used:
http://XXX.XXX.XXX.XXX/~user1/. Directory />
2 Options None
3 AllowOverride None
4 </Directory>
DocumentRoot "/var/www/html"
2
3 <Directory "/var/www/html">
4 Options Indexes FollowSymLinks
5 AllowOverride None
6 Order allow,deny
7 Allow from all
8 </Directory>
File: /etc/httpd/conf/httpd.conf
LoadModule userdir_module modules/mod_userdir.so
...
...
<IfModule mod_userdir.c>
#UserDir disable - Add comment to this line
#
# To enable requests to /~user/ to serve the user's public_html
# directory, remove the "UserDir disable" line above, and uncomment
# the following line instead:
UserDir public_html # Uncomment this line
</IfModule>
...
...
<Directory /home/*/public_html>
AllowOverride FileInfo AuthConfig Limit
Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
<Limit GET POST OPTIONS>
Order allow,deny
Allow from all
</Limit>
<LimitExcept GET POST OPTIONS>
Order deny,allow
Deny from all
</LimitExcept>
</Directory>
NameVirtualHost XXX.XXX.XXX.XXX
<VirtualHost XXX.XXX.XXX.XXX> ServerName
www.your-domain.com - CNAME (bind DNS alias www) specified in Bind configuration file (/var/named/...)
ServerAlias your-domain.com - Allows requests by domain name without the "www" prefix.
ServerAdmin user1@your-domain.com
DocumentRoot /home/user1/public_html ErrorLog logs/your-domain.com-error_log
TransferLog logs/your-domain.com-access_log
</VirtualHost>
NameVirtualHost XXX.XXX.XXX.XXX
NameVirtualHost 192.168.XXX.XXX
<VirtualHost XXX.XXX.XXX.XXX 192.168.XXX.XXX>
...
..
<Directory "/var/www/html">
... This part remains the same
..
</Directory>
# Default for when no domain name is given (i.e. access by IP address)
<VirtualHost *:80>
ServerAdmin user1@your-domain.com
DocumentRoot /var/www/html
ErrorLog logs/error_log
TransferLog logs/access_log
</VirtualHost>
# Add a VirtualHost definition for your domain which was once the system default.
<VirtualHost XXX.XXX.XXX.XXX> ServerName
www.your-domain.com ServerAlias your-domain.com
ServerAdmin user1@your-domain.com
DocumentRoot /var/www/html
ErrorLog logs/error_log
TransferLog logs/access_log
</VirtualHost>
<VirtualHost XXX.XXX.XXX.XXX>
02 ServerName supercorp.com
03 ServerAlias
www.supercorp.com 04 ServerAdmin webmaster@localhost
05
06 DocumentRoot /home/supercorp/public_html/home
07 <Directory "/">
08 Options FollowSymLinks
09 AllowOverride None
10 </Directory>
11 <Directory /home/supercorp/public_html/home>
12 Options Indexes FollowSymLinks MultiViews
13 IndexOptions SuppressLastModified SuppressDescription
14 AllowOverride All
15 Order allow,deny
16 allow from all
17 </Directory>
18
19 ScriptAlias /cgi-bin/ /home/supercorp/cgi-bin/
20 <Directory "/home/supercorp/cgi-bin/">
21 AllowOverride None
22 Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
23 Order allow,deny
24 Allow from all
25 </Directory>
26
27 ErrorLog /var/log/apache2/supercorp.com-error.log
28
29 # Possible values include: debug, info, notice, warn, error,
30 # crit, alert, emerg.
31 LogLevel warn
32 CustomLog /var/log/apache2/supercorp.com-access.log combined
33 ServerSignature On
34 </VirtualHost>
Enable domain:
•Create soft link:
◦Manually: ln -s /etc/apache2/sites-available/supercorp /etc/apache2/sites-enabled/supercorp
◦Use Ubuntu scripts a2ensite/a2dissite. Type command and it will prompt you as to which site you would like to enable or disable.
•Restart Apache:
◦apache2ctl graceful
or
◦/etc/init.d/apache2 restart
or
◦/etc/init.d/apache2 reload
Also note that Apache modules can also be enabled/disabled with scripts a2enmod/a2dismod.
Man pages:
•a2ensite/a2dissite (Ubuntu: Apache 2 enable/disable site)
•apache2ctl
Configuring an "IP based" virtual host:
One may assign multiple IP addresse to a single network interface. See the YoLinux networking tutorial: Network Aliasing. Each IP address may then be it's own virtual server and individual domain. The downside of the "IP based" virtual host method is that you have to possess multiple/extra IP addresses. This usually costs more. The standard name based virtual hosting method above is more popular for this reason.
NameVirtualHost * - Indicates all IP addresses
<VirtualHost *>
ServerAdmin user0@default-domain.com
DocumentRoot /home/user0/public_html
</VirtualHost>
<VirtualHost XXX.XXX.XXX.101>
ServerAdmin user1@domain-1.com
DocumentRoot /home/user1/public_html
</VirtualHost>
<VirtualHost XXX.XXX.XXX.102>
ServerAdmin user1@domain-2.com
DocumentRoot /home/user2/public_html
</VirtualHost>