Home
Installation
I tried to make the installation process as simple as possible, but if you
find it too difficult or you don't have the time to read the next rows you can order a
support.
In the description below I assume that your Apache DocumentRoot directory is /var/www/html.
Replace x.x with the version number.
1.Configure the following programs
1.1 Apache
If you intend to use the Apache module suexec (recommended) read
Security point 2.
Open Apache conf file and find the directives User and Group. If they
are "User nobody" and "Group nobody" change them to "User apache" and
"Group apache". If the apache user and group do not exist on your
system create them:
# groupadd apache
# useradd -g apache apache
Even if the user apache already exists change it's password:
# passwd apache
Make directory "include" in /etc/httpd/conf:
# mkdir -m 755 /etc/httpd/conf/include
touch the file include in the include directory:
# touch /etc/httpd/conf/include/include
Insert the row "include /etc/httpd/conf/include/include" at the end of the
Apache's conf file:
# echo "include
/etc/httpd/conf/include/include" >> /etc/httpd/conf/httpd.conf
Make two log directories for the WHT needs:
# mkdir -m 700 /var/log/wht
# mkdir -m 700 /var/log/wht/bytes
1.2 Sudo
Add the apache user to the /etc/sudoers file if it is not there already:
# echo "apache ALL = PASSWD: ALL"
>> /etc/sudoers
My /etc/sudoers file looks like that:
# sudoers file.
#
# This file MUST be edited with the 'visudo' command
as root.
#
# See the sudoers man page for the details on how to
write a sudoers file.
#
# Host alias specification
# User alias specification
# Cmnd alias specification
# Defaults specification
Defaults syslog=auth
# User privilege specification
root ALL=(ALL) ALL
# Uncomment to allow people in group wheel to run
all commands
# %wheel
ALL=(ALL) ALL
# Same thing without a password
# %wheel
ALL=(ALL) NOPASSWD: ALL
# Samples
# %users ALL=/sbin/mount /cdrom,/sbin/umount
/cdrom
# %users localhost=/sbin/shutdown -h now
apache ALL = PASSWD: ALL
1.3 BIND
Make directory "wht_named" in /etc:
# mkdir -m 755 /etc/wht_named
touch the file include in the wht_named directory:
# touch /etc/wht_named/include
Insert the row "include "/etc/wht_named/include";" at the end of
BIND's conf file:
# echo "include \"/etc/wht_named/include\";"
>> /etc/named.conf
2. Extract the tarball to the web directory:
# cp ./wht-x.x.tar.gz /var/www/html
# cd /var/www/html
# tar xvzf wht-x.x.tar.gz
# chown root:apache /var/www/html/wht/ -R
# chmod 750 /var/www/html/wht/
3. Create database:
# mysqladmin -u root -p create wht
# mysql -u root -p wht <
/var/www/html/wht/wht.sql
4. Add two scripts to crontab.
The first one will run every night at 2 a.m:
# echo "0 2 * * * root
/var/www/html/wht/wht_cron.php" >> /etc/crontab
The second every month - 1st 3 a.m. If you
specify another rotate period change the $rotate_months variable
in conf_inc.php:
# echo "0 3 1 * * root
/var/www/html/wht/wht_apache_log.php" >> /etc/crontab
What these scripts do?
Answer:
Apache and
bind
5. If you use vsftpd read 5.1. If you use proftpd read 5.2.
5.1. To allow users access only their home
directories add the row "chroot_local_user=YES" at the end of FTP
server's conf file (usually /etc/vsftpd/vsftpd.conf):
# echo "chroot_local_user=YES" >>
/etc/vsftpd/vsftpd.conf
My /etc/vsftpd/vsftpd.conf file looks like that:
# Example config file
/etc/vsftpd.conf
#
# The default compiled in settings are very paranoid. This sample file
# loosens things up a bit, to make the ftp daemon more usable.
#
# Allow anonymous FTP?
anonymous_enable=YES
#
# Uncomment this to allow local users to log in.
local_enable=YES
#
# Uncomment this to enable any form of FTP write command.
write_enable=YES
#
# Default umask for local users is 077. You may wish to change this to
022,
# if your users expect that (022 is used by most other ftpd's)
local_umask=022
#
# Uncomment this to allow the anonymous FTP user to upload files. This
only
# has an effect if the above global write enable is activated. Also,
you will
# obviously need to create a directory writable by the FTP user.
#anon_upload_enable=YES
#
# Uncomment this if you want the anonymous FTP user to be able to create
# new directories.
#anon_mkdir_write_enable=YES
#
# Activate directory messages - messages given to remote users when they
# go into a certain directory.
dirmessage_enable=YES
#
# Activate logging of uploads/downloads.
xferlog_enable=YES
#
# Make sure PORT transfer connections originate from port 20 (ftp-data).
connect_from_port_20=YES
#
# If you want, you can arrange for uploaded anonymous files to be owned
by
# a different user. Note! Using "root" for uploaded files is not
# recommended!
#chown_uploads=YES
#chown_username=whoever
#
# You may override where the log file goes if you like. The default is
shown
# below.
#xferlog_file=/var/log/vsftpd.log
#
# If you want, you can have your log file in standard ftpd xferlog
format
xferlog_std_format=YES
#
# You may change the default value for timing out an idle session.
#idle_session_timeout=600
#
# You may change the default value for timing out a data connection.
#data_connection_timeout=120
#
# It is recommended that you define on your system a unique user which
the
# ftp server can use as a totally isolated and unprivileged user.
#nopriv_user=ftpsecure
#
# Enable this and the server will recognize asynchronous ABOR requests.
Not
# recommended for security (the code is non-trivial). Not enabling it,
# however, may confuse older FTP clients.
#async_abor_enable=YES
#
# By default the server will pretend to allow ASCII mode but in fact
ignore
# the request. Turn on the below options to have the server actually do
ASCII
# mangling on files when in ASCII mode.
# Beware that turning on ascii_download_enable enables malicious remote
parties
# to consume your I/O resources, by issuing the command "SIZE
/big/file" in
# ASCII mode.
# These ASCII options are split into upload and download because you
may wish
# to enable ASCII uploads (to prevent uploaded scripts etc. from
breaking),
# without the DoS risk of SIZE and ASCII downloads. ASCII mangling
should be
# on the client anyway..
#ascii_upload_enable=YES
#ascii_download_enable=YES
#
# You may fully customise the login banner string:
#ftpd_banner=Welcome to blah FTP service.
#
# You may specify a file of disallowed anonymous e-mail addresses.
Apparently
# useful for combatting certain DoS attacks.
#deny_email_enable=YES
# (default follows)
#banned_email_file=/etc/vsftpd.banned_emails
#
# You may specify an explicit list of local users to chroot() to their
home
# directory. If chroot_local_user is YES, then this list becomes a list
of
# users to NOT chroot().
#chroot_list_enable=YES
# (default follows)
#chroot_list_file=/etc/vsftpd.chroot_list
#
# You may activate the "-R" option to the builtin ls. This is disabled
by
# default to avoid remote users being able to cause excessive I/O on
large
# sites. However, some broken FTP clients such as "ncftp" and "mirror"
assume
# the presence of the "-R" option, so there is a strong case for
enabling it.
#ls_recurse_enable=YES
pam_service_name=vsftpd
userlist_enable=YES
#enable for standalone mode
listen=YES
tcp_wrappers=YES
chroot_local_user=YES
5.2. To allow users access only their home
directories add the row "DefaultRoot ~" at the end of FTP
server's conf file (usually /etc/proftpd.conf):
# echo " DefaultRoot ~" >>
/etc/proftpd.conf
My /etc/proftpd file looks like that:
# This is a basic ProFTPD configuration
file.
# It establishes a single server and a single
anonymous login.
# It assumes that you have a user/group "nobody" and
"ftp"
# for normal/anonymous operation.
ServerName
"ProFTPD Default Installation"
ServerType
standalone
#ServerType
inetd
DefaultServer
on
# Port 21 is the standard FTP port.
Port
21
# Umask 022 is a good standard umask to prevent new
dirs and files
# from being group and world writable.
Umask
022
# To prevent DoS attacks, set the maximum number of
child processes
# to 30. If you need to allow more than 30
concurrent connections
# at once, simply increase this value. Note
that this ONLY works
# in standalone mode, in inetd mode you should use an
inetd server
# that allows you to limit maximum number of
processes per service
# (such as xinetd)
MaxInstances
30
# Set the user and group that the server normally
runs at.
User
nobody
Group
nobody
# This next option is required for NIS or NIS+ to
work properly:
#PersistentPasswd off
SystemLog
/var/log/proftpd.log
TransferLog
/var/log/xferlog
# Normally, we want files to be overwriteable.
<Directory /*>
AllowOverwrite
on
</Directory>
# A basic anonymous FTP server configuration.
# To enable this, remove the user ftp from
/etc/ftpusers.
<Anonymous ~ftp>
RequireValidShell
off
User
ftp
Group
ftp
# We want clients to be able to login with
"anonymous" as well as "ftp"
UserAlias
anonymous ftp
# Limit the maximum number of anonymous logins
MaxClients
50
# We want 'welcome.msg' displayed at login,
and '.message' displayed
# in each newly chdired directory.
DisplayLogin
welcome.msg
DisplayFirstChdir
.message
# Limit WRITE everywhere in the anonymous
chroot
<Limit WRITE>
DenyAll
</Limit>
# An upload directory that allows storing
files but not retrieving
# or creating directories.
# <Directory incoming/*>
# <Limit READ>
# DenyAll
# </Limit>
#
# <Limit STOR>
# AllowAll
# </Limit>
# </Directory>
</Anonymous>
DefaultRoot ~
WHT uses the FTP server to upload files in the File Manager section so
it can't function without it.
6. If you will use AWStats edit awstats/awstats.model.conf according to
your needs. Do not add LogFile, SiteDomain and HostAliases. WHT will
use this model file to generate configuration files for every domain.
This awstats.model.conf file is for version 5.6. If you are using newer version of AWStats
overwrite the awstats/awstats.model.conf file with the original AWStat's model file but
remove the variables LogFile, SiteDomain and HostAliases from it.
wht_awstats_update.php will update the statistic for all the sites. You
only have to add the file to crontab. You can choose whatever period
you want. This will run wht_awstats_update.php every hour
# echo "0 * * * * root
/var/www/html/wht/wht_awstats_update.php" >> /etc/crontab
7. If you will not use free hosting do not read 7.
To activate the free hosting type the following in the command line:
# /var/www/html/wht/install_free.php
# /var/www/html/wht/install_cgi_free.php
and answer the questions.
For more info read
free hosting.
8. Make sure that the directory set in the $userhomedir in the configuration file
(conf_inc.php) exists. By default it is /vat/www/home and do not exists. So create it:
# mkdir /var/www/home
9. Enable the user quotas.
10. That's it. Now
configuration.