root/trunk/INSTALL

Revision ,488, 7.3 KB (checked in by fidojones, 3 months ago)

scripts para iniciar el cron y la configuracion de lighttpd

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