| 1 | Installation with Debian paths
|
|---|
| 2 | ====================================================
|
|---|
| 3 | Use this manual only if you want to user baifox with default debian paths
|
|---|
| 4 | This manual is a bit outdated, must be revised
|
|---|
| 5 |
|
|---|
| 6 | Packages to install in DEBIAN ETCH
|
|---|
| 7 | ====================================================
|
|---|
| 8 | apt-get install lighttpd php5 php5-mysql php5-cli php5-cgi apache2 mysql-server mysql-client pure-ftpd-mysql awstats bind9 sudo squirrelmail phpmyadmin
|
|---|
| 9 |
|
|---|
| 10 | 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:
|
|---|
| 11 |
|
|---|
| 12 | #comment line
|
|---|
| 13 | #ftp stream tcp nowait root /usr/sbin/tcpd /usr/sbin/pure-ftpd-wrapper
|
|---|
| 14 | #delete init.d script
|
|---|
| 15 | rm -f /etc/init.d/pure-ftpd-mysql
|
|---|
| 16 |
|
|---|
| 17 | qmail and vpopmail must be compiled I recommend http://www.shupp.org/toaster/
|
|---|
| 18 |
|
|---|
| 19 | baifox
|
|---|
| 20 | ====================================================
|
|---|
| 21 | Access PORT: 7777
|
|---|
| 22 | Example: http://www.yourserver.com:7777/
|
|---|
| 23 | default user: admin
|
|---|
| 24 | default password: admin
|
|---|
| 25 |
|
|---|
| 26 | cd /usr/local
|
|---|
| 27 | tar xfz baifox.tar.gz
|
|---|
| 28 | groupadd baifox
|
|---|
| 29 | useradd -g baifox -s /bin/false -c "Panel control baifox" baifox
|
|---|
| 30 | passwd baifox [PLAINT TEXT PASSWORD FOR BAIFOX USER]
|
|---|
| 31 | chown -R baifox.baifox /usr/local/baifox
|
|---|
| 32 |
|
|---|
| 33 | cp -f /usr/local/baifox/panel/admin_panel/config/main_config_debian.php /usr/local/baifox/panel/admin_panel/config/main_config.php
|
|---|
| 34 |
|
|---|
| 35 | Replace /usr/local/baifox/panel/admin_panel/config/main_config.php variables with your configuration
|
|---|
| 36 |
|
|---|
| 37 | [VAR_BAIFOXCONFIG_EMAIL] //Contact email
|
|---|
| 38 | [VAR_MYSQLBAIFOX_PASSWORD] //Mysql user password from baifox_panel database
|
|---|
| 39 | [VAR_BLOWFISH_PASSWORD] //I word to make random passwords, write anything
|
|---|
| 40 | [VAR_BAIFOXCONFIG_DOMINIO] //Your main domain
|
|---|
| 41 | [VAR_BAIFOXCONFIG_NS] //Your main DNS for this server
|
|---|
| 42 | [VAR_BAIFOXCONFIG_IP] //The ip from your server
|
|---|
| 43 | [VAR_MYSQLSERVER_PASSWORD] //Mysql root password
|
|---|
| 44 | [VAR_VIRTUAL_UID] //UID from virtual user for pure-ftpd
|
|---|
| 45 | [VAR_VIRTUAL_GID] //GID from virtual user for pure-ftpd
|
|---|
| 46 |
|
|---|
| 47 | Configure Lighttpd
|
|---|
| 48 | ====================================================
|
|---|
| 49 | cp -f /usr/local/baifox/etc/lighttpd-debian.conf /etc/lighttpd/lighttpd.conf
|
|---|
| 50 |
|
|---|
| 51 | sudo
|
|---|
| 52 | ====================================================
|
|---|
| 53 | apt-get install sudo
|
|---|
| 54 | echo "[PLAINT TEXT PASSWORD FROM BAIFOX USER]" > /usr/local/baifox/panel/admin_panel/config/.htpasswd
|
|---|
| 55 | chown baifox.baifox /usr/local/baifox/panel/admin_panel/config/.htpasswd
|
|---|
| 56 | chmod 600 /usr/local/baifox/panel/admin_panel/config/.htpasswd
|
|---|
| 57 |
|
|---|
| 58 | modify the /etc/sudoers file to include the next line
|
|---|
| 59 |
|
|---|
| 60 | echo "baifox ALL=PASSWD:ALL" >>/etc/sudoers
|
|---|
| 61 |
|
|---|
| 62 | mod_apache
|
|---|
| 63 | ====================================================
|
|---|
| 64 | rm -f /etc/apache2/sites-available/default
|
|---|
| 65 | chgrp baifox /etc/apache2/sites-enabled
|
|---|
| 66 | chmod 775 /etc/apache2/sites-enabled
|
|---|
| 67 | ln -s /usr/share/awstats/ /var/www/awstats
|
|---|
| 68 | ln -s /usr/share/squirrelmail/ /var/www/squirrelmail
|
|---|
| 69 |
|
|---|
| 70 | echo "<VirtualHost *:80>" > /etc/apache2/conf.d/baifox.conf
|
|---|
| 71 | echo " #For use only with mod_redirecciones module" >> /etc/apache2/conf.d/baifox.conf
|
|---|
| 72 | echo " AliasMatch (.*) /usr/local/baifox/scripts/baifox_redireccion.php" >> /etc/apache2/conf.d/baifox.conf
|
|---|
| 73 | echo " ServerName redirect.dominio.com" >> /etc/apache2/conf.d/baifox.conf
|
|---|
| 74 | echo "</VirtualHost>" >> /etc/apache2/conf.d/baifox.conf
|
|---|
| 75 | echo "<VirtualHost *:80>" >> /etc/apache2/conf.d/baifox.conf
|
|---|
| 76 | echo " ServerName webmail.dominio.com" >> /etc/apache2/conf.d/baifox.conf
|
|---|
| 77 | echo " DocumentRoot /var/www/squirrelmail" >> /etc/apache2/conf.d/baifox.conf
|
|---|
| 78 | echo "</VirtualHost>" >> /etc/apache2/conf.d/baifox.conf
|
|---|
| 79 | echo "<VirtualHost *:80>" >> /etc/apache2/conf.d/baifox.conf
|
|---|
| 80 | echo " ServerName mysql.dominio.com" >> /etc/apache2/conf.d/baifox.conf
|
|---|
| 81 | echo " DocumentRoot /var/www/phpmyadmin" >> /etc/apache2/conf.d/baifox.conf
|
|---|
| 82 | echo "</VirtualHost>" >> /etc/apache2/conf.d/baifox.conf
|
|---|
| 83 |
|
|---|
| 84 | /etc/apache2/apache2.conf
|
|---|
| 85 |
|
|---|
| 86 | NameVirtualHost *:80
|
|---|
| 87 | # Include the virtual host configurations:
|
|---|
| 88 | Include /etc/apache2/sites-enabled/
|
|---|
| 89 |
|
|---|
| 90 | mod_awstats
|
|---|
| 91 | ====================================================
|
|---|
| 92 | chgrp baifox /etc/awstats/
|
|---|
| 93 | chmod 775 /etc/awstats/
|
|---|
| 94 |
|
|---|
| 95 | touch /usr/local/bin/actualizar_estadisticas
|
|---|
| 96 | chgrp baifox /usr/local/bin/actualizar_estadisticas
|
|---|
| 97 | chmod 760 /usr/local/bin/actualizar_estadisticas
|
|---|
| 98 |
|
|---|
| 99 | touch /etc/awstats/.htpasswd
|
|---|
| 100 | chgrp baifox /etc/awstats/.htpasswd
|
|---|
| 101 | chmod 664 /etc/awstats/.htpasswd
|
|---|
| 102 |
|
|---|
| 103 | echo "<VirtualHost *:80>" > /etc/apache2/conf.d/awstats.conf
|
|---|
| 104 | echo " ServerName estadisticas.dominio.com" >> /etc/apache2/conf.d/awstats.conf
|
|---|
| 105 | echo " DocumentRoot /var/www/awstats" >> /etc/apache2/conf.d/awstats.conf
|
|---|
| 106 | echo " ScriptAlias /cgi-bin/awstats.pl \"/usr/lib/cgi-bin/awstats.pl\"" >> /etc/apache2/conf.d/awstats.conf
|
|---|
| 107 | echo " <Directory \"/usr/lib/cgi-bin\">" >> /etc/apache2/conf.d/awstats.conf
|
|---|
| 108 | echo " AuthType basic" >> /etc/apache2/conf.d/awstats.conf
|
|---|
| 109 | echo " AuthName \"Estadisticas\"" >> /etc/apache2/conf.d/awstats.conf
|
|---|
| 110 | echo " AuthUserFile /etc/awstats/.htpasswd" >> /etc/apache2/conf.d/awstats.conf
|
|---|
| 111 | echo " <Files awstats.pl>" >> /etc/apache2/conf.d/awstats.conf
|
|---|
| 112 | echo " Require valid-user" >> /etc/apache2/conf.d/awstats.conf
|
|---|
| 113 | echo " </Files>" >> /etc/apache2/conf.d/awstats.conf
|
|---|
| 114 | echo " </Directory>" >> /etc/apache2/conf.d/awstats.conf
|
|---|
| 115 | echo "</VirtualHost>" >> /etc/apache2/conf.d/awstats.conf
|
|---|
| 116 |
|
|---|
| 117 | mod_bandwidth
|
|---|
| 118 | ====================================================
|
|---|
| 119 | mkdir /home/estadisticas
|
|---|
| 120 | chgrp baifox /home/estadisticas
|
|---|
| 121 | chmod 775 /home/estadisticas
|
|---|
| 122 |
|
|---|
| 123 | mod_logrotate
|
|---|
| 124 | ====================================================
|
|---|
| 125 | chgrp baifox /etc/logrotate.conf
|
|---|
| 126 | chmod 664 /etc/logrotate.conf
|
|---|
| 127 |
|
|---|
| 128 | mod_bind
|
|---|
| 129 | ====================================================
|
|---|
| 130 | chgrp baifox /etc/bind/named.conf
|
|---|
| 131 | chmod 664 /etc/bind/named.conf
|
|---|
| 132 | chgrp baifox /var/cache/bind
|
|---|
| 133 | chmod 775 /var/cache/bind
|
|---|
| 134 |
|
|---|
| 135 | mod_cron
|
|---|
| 136 | ====================================================
|
|---|
| 137 | cp /usr/local/baifox/etc/baifox-cron /etc/init.d/baifox-cron
|
|---|
| 138 | chmod 700 /etc/init.d/baifox-cron
|
|---|
| 139 | cd /etc/init.d
|
|---|
| 140 | update-rc.d baifox-cron defaults 99
|
|---|
| 141 |
|
|---|
| 142 | mod_filesystem
|
|---|
| 143 | ====================================================
|
|---|
| 144 | mkdir /home/backup
|
|---|
| 145 | chgrp baifox /home/backup
|
|---|
| 146 | chmod 775 /home/backup
|
|---|
| 147 |
|
|---|
| 148 | mod_pureftpd
|
|---|
| 149 | ====================================================
|
|---|
| 150 | groupadd virtual
|
|---|
| 151 | useradd -g virtual -s /bin/false -c "Usuario PureFTPD" virtual
|
|---|
| 152 | mkdir /home/virtual
|
|---|
| 153 | chown virtual.virtual /home/virtual
|
|---|
| 154 |
|
|---|
| 155 | CREATE DATABASE baifox_panel;
|
|---|
| 156 | GRANT ALL ON baifox_panel.* TO baifox_panel@localhost IDENTIFIED BY '[PASSWORD HERE]';
|
|---|
| 157 | FLUSH PRIVILEGES;
|
|---|
| 158 |
|
|---|
| 159 | Use the pureftpd-mysql.conf file that is include
|
|---|
| 160 |
|
|---|
| 161 | cp -f /usr/local/baifox/panel/admin_panel/modulos/mod_pureftpd/pureftpd-mysql.conf /etc/pure-ftpd/db/mysql.conf
|
|---|
| 162 |
|
|---|
| 163 | 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.
|
|---|
| 164 |
|
|---|
| 165 | 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
|
|---|
| 166 |
|
|---|
| 167 | 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
|
|---|
| 168 | chmod 755 /etc/init.d/pureftpd
|
|---|
| 169 | cd /etc/init.d
|
|---|
| 170 | update-rc.d pureftpd defaults 99
|
|---|
| 171 |
|
|---|
| 172 | cron
|
|---|
| 173 | ====================================================
|
|---|
| 174 | add to the cron
|
|---|
| 175 |
|
|---|
| 176 | 30 2 * * * /usr/local/bin/actualizar_estadisticas
|
|---|
| 177 | 1 5 * * * /usr/local/baifox/panel/admin_panel/cron.php 1>/dev/null 2>&1
|
|---|