Baifox/安装
来自站长百科
导航:返回上一页
这里的安装教程是基于Debian环境下的。
Debian中应该安装的服务[ ]
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-ftp-mysql在标准配置的Debian中是无效的,在这里推荐大家安装INETD,然后编辑/etc/inetd.conf,注释掉下列行:
#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
安装Baifox[ ]
访问端口: 7777
Example: http://www.yourserver.com:7777/
默认用户: admin
默认密码: admin
安装:
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
在/usr/local/baifox/panel/admin_panel/config/main_config.php配置文件中将下列变量根据你的实际情况进行修改:
[VAR_BAIFOXCONFIG_EMAIL] //联系邮件 [VAR_MYSQLBAIFOX_PASSWORD] //来自baifox_panel[[数据库]]中的[[MySQL]]用户密码 [VAR_BLOWFISH_PASSWORD] //一个用来生成随机密码的单词,可以是任何值 [VAR_BAIFOXCONFIG_DOMINIO] //你的主域名 [VAR_BAIFOXCONFIG_NS] //这台[[服务器]]的主要[[DNS]]; [VAR_BAIFOXCONFIG_IP] //服务器的[[IP]]地址 [VAR_MYSQLSERVER_PASSWORD] //Mysql 根用户密码 [VAR_VIRTUAL_UID] // pure-ftpd虚拟用户的UID [VAR_VIRTUAL_GID] //pure-ftpd虚拟用户的GID
配置Lighttpd[ ]
cp -f /usr/local/baifox/etc/lighttpd-debian.conf /etc/lighttpd/lighttpd.conf
配置Sudo[ ]
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
然后修改/etc/sudoers文件,级将下行代码添加进去:
echo "baifox ALL=PASSWD:ALL" >>/etc/sudoers
配置模块[ ]
mod_apache
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
/etc/apache2/apache2.conf
NameVirtualHost *:80 # Include the virtual host configurations: Include /etc/apache2/sites-enabled/
mod_awstats
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
mod_bandwidth:
mkdir /home/estadisticas chgrp baifox /home/estadisticas chmod 775 /home/estadisticas
mod_logrotate
chgrp baifox /etc/logrotate.conf chmod 664 /etc/logrotate.conf
mod_bind
chgrp baifox /etc/bind/named.conf chmod 664 /etc/bind/named.conf chgrp baifox /var/cache/bind chmod 775 /var/cache/bind
mod_cron
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
mod_filesystem
mkdir /home/backup chgrp baifox /home/backup chmod 775 /home/backup
mod_pureftpd
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;
使用pureftpd-mysql.conf file
cp -f /usr/local/baifox/panel/admin_panel/modulos/mod_pureftpd/pureftpd-mysql.conf /etc/pure-ftpd/db/mysql.conf
编辑/etc/pure-ftpd/db/mysql.conf ,并且检查UID和GID是否和mysql.conf file 以及main_config.php 中的一致
并且在mysql.conf文件中配置mysqld.sock 路径到实际的MySQL socket路径中,并且配置MySQL用户和用户密码,与baifox_panel的数据库一致
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
配置系统时钟作业Cron
30 2 * * * /usr/local/bin/actualizar_estadisticas 1 5 * * * /usr/local/baifox/panel/admin_panel/cron.php 1>/dev/null 2>&1