apt-get install lighttpd php5 php5-mysql php5-sqlite php5-cli php5-cgi apache2 mysql-server mysql-client pure-ftpd-mysql awstats bind9 sudo squirrelmail phpmyadmin
pure-ftpd-mysql fails in debian configuring as standalone. I recommend to install as INETD and then edit /etc/inetd.conf and comment line as here:
#comment line #ftp stream tcp nowait root /usr/sbin/tcpd /usr/sbin/pure-ftpd-wrapper #delete init.d script rm -f /etc/init.d/pure-ftpd-mysql
qmail and vpopmail must be compiled I recommend http://billslinuxqmail.sourceforge.net
cd /usr/local tar xfz baifox.tar.gz groupadd baifox useradd -g baifox -s /bin/false -c "Panel control baifox" baifox passwd baifox [PLAINT TEXT PASSWORD FOR BAIFOX USER] chown -R baifox.baifox /usr/local/baifox
cp -f /usr/local/baifox/panel/admin_panel/config/main_config_debian.php /usr/local/baifox/panel/admin_panel/config/main_config.php
Replace /usr/local/baifox/panel/admin_panel/config/main_config.php variables with your configuration
[VAR_BAIFOXCONFIG_EMAIL] //Contact email [VAR_MYSQLBAIFOX_PASSWORD] //Mysql user password from baifox_panel database [VAR_BLOWFISH_PASSWORD] //I word to make random passwords, write anything [VAR_BAIFOXCONFIG_DOMINIO] //Your main domain [VAR_BAIFOXCONFIG_NS] //Your main DNS for this server [VAR_BAIFOXCONFIG_IP] //The ip from your server [VAR_MYSQLSERVER_PASSWORD] //Mysql root password [VAR_VIRTUAL_UID] //UID from virtual user for pure-ftpd [VAR_VIRTUAL_GID] //GID from virtual user for pure-ftpd
cp -f /usr/local/baifox/etc/lighttpd-debian.conf /etc/lighttpd/lighttpd.conf
apt-get install sudo echo "[PLAINT TEXT PASSWORD FROM BAIFOX USER]" > /usr/local/baifox/panel/admin_panel/config/.htpasswd chown baifox.baifox /usr/local/baifox/panel/admin_panel/config/.htpasswd chmod 600 /usr/local/baifox/panel/admin_panel/config/.htpasswd
modify the /etc/sudoers file to include the next line
echo "baifox ALL=PASSWD:ALL" >>/etc/sudoers
rm -f /etc/apache2/sites-available/default chgrp baifox /etc/apache2/sites-enabled chmod 775 /etc/apache2/sites-enabled ln -s /usr/share/awstats/ /var/www/awstats ln -s /usr/share/squirrelmail/ /var/www/squirrelmail echo "<VirtualHost *:80>" > /etc/apache2/conf.d/baifox.conf echo " #For use only with mod_redirecciones module" >> /etc/apache2/conf.d/baifox.conf echo " AliasMatch (.*) /usr/local/baifox/scripts/baifox_redireccion.php" >> /etc/apache2/conf.d/baifox.conf echo " ServerName redirect.dominio.com" >> /etc/apache2/conf.d/baifox.conf echo "</VirtualHost>" >> /etc/apache2/conf.d/baifox.conf echo "<VirtualHost *:80>" >> /etc/apache2/conf.d/baifox.conf echo " ServerName webmail.dominio.com" >> /etc/apache2/conf.d/baifox.conf echo " DocumentRoot /var/www/squirrelmail" >> /etc/apache2/conf.d/baifox.conf echo "</VirtualHost>" >> /etc/apache2/conf.d/baifox.conf echo "<VirtualHost *:80>" >> /etc/apache2/conf.d/baifox.conf echo " ServerName mysql.dominio.com" >> /etc/apache2/conf.d/baifox.conf echo " DocumentRoot /var/www/phpmyadmin" >> /etc/apache2/conf.d/baifox.conf echo "</VirtualHost>" >> /etc/apache2/conf.d/baifox.conf
NameVirtualHost *:80 # Include the virtual host configurations: Include /etc/apache2/sites-enabled/
chgrp baifox /etc/awstats/ chmod 775 /etc/awstats/ touch /usr/local/bin/actualizar_estadisticas chgrp baifox /usr/local/bin/actualizar_estadisticas chmod 760 /usr/local/bin/actualizar_estadisticas touch /etc/awstats/.htpasswd chgrp baifox /etc/awstats/.htpasswd chmod 664 /etc/awstats/.htpasswd echo "<VirtualHost *:80>" > /etc/apache2/conf.d/awstats.conf echo " ServerName estadisticas.dominio.com" >> /etc/apache2/conf.d/awstats.conf echo " DocumentRoot /var/www/awstats" >> /etc/apache2/conf.d/awstats.conf echo " ScriptAlias /cgi-bin/awstats.pl \"/usr/lib/cgi-bin/awstats.pl\"" >> /etc/apache2/conf.d/awstats.conf echo " <Directory \"/usr/lib/cgi-bin\">" >> /etc/apache2/conf.d/awstats.conf echo " AuthType basic" >> /etc/apache2/conf.d/awstats.conf echo " AuthName \"Estadisticas\"" >> /etc/apache2/conf.d/awstats.conf echo " AuthUserFile /etc/awstats/.htpasswd" >> /etc/apache2/conf.d/awstats.conf echo " <Files awstats.pl>" >> /etc/apache2/conf.d/awstats.conf echo " Require valid-user" >> /etc/apache2/conf.d/awstats.conf echo " </Files>" >> /etc/apache2/conf.d/awstats.conf echo " </Directory>" >> /etc/apache2/conf.d/awstats.conf echo "</VirtualHost>" >> /etc/apache2/conf.d/awstats.conf
mkdir /home/estadisticas chgrp baifox /home/estadisticas chmod 775 /home/estadisticas
chgrp baifox /etc/logrotate.conf chmod 664 /etc/logrotate.conf
chgrp baifox /etc/bind/named.conf chmod 664 /etc/bind/named.conf chgrp baifox /var/cache/bind chmod 775 /var/cache/bind
cp /usr/local/baifox/etc/baifox-cron /etc/init.d/baifox-cron chmod 700 /etc/init.d/baifox-cron cd /etc/init.d update-rc.d baifox-cron defaults 99
mkdir /home/backup chgrp baifox /home/backup chmod 775 /home/backup
groupadd virtual useradd -g virtual -s /bin/false -c "Usuario PureFTPD" virtual mkdir /home/virtual chown virtual.virtual /home/virtual
CREATE DATABASE baifox_panel; GRANT ALL ON baifox_panel.* TO baifox_panel@localhost IDENTIFIED BY '[PASSWORD HERE]'; FLUSH PRIVILEGES;
Use the pureftpd-mysql.conf file that is include
cp -f /usr/local/baifox/panel/admin_panel/modulos/mod_pureftpd/pureftpd-mysql.conf /etc/pure-ftpd/db/mysql.conf
Edit /etc/pure-ftpd/db/mysql.conf and Check the UID y GID from the “virtual” user to comprobe it's the same in the mysql.conf file and in the main_config.php file from BAIFOX configuration directory.
And configure the socket mysqld.sock path in the mysql.conf file to the actual mysql socket path. Configure also de mysql user and password from “baifox_panel” DATABASE
echo "/usr/sbin/pure-ftpd-mysql -p 50000:50400 -B -A -C 8 -E -D -c 50 -s -w -z -b -l mysql:/etc/pure-ftpd/db/mysql.conf -l unix &" > /etc/init.d/pureftpd chmod 755 /etc/init.d/pureftpd cd /etc/init.d update-rc.d pureftpd defaults 99
add to the cron
30 2 * * * /usr/local/bin/actualizar_estadisticas 1 5 * * * /usr/local/baifox/panel/admin_panel/cron.php 1>/dev/null 2>&1