Установка SAMS2 на CentOS6
Далее идет порядок действий, по которому я шел устанавливая SAMS2.
nano /etc/selinux/config
SELINUX=disabled
-----------------
shutdown -r now
nano /etc/httpd/conf/httpd.conf
ServerName CentosVM:80
<Directory "/usr/local/share/sams2/">
AllowOverride AuthConfig
Options Indexes MultiViews
Order allow,deny
Allow from all
</Directory>
----------------------
service httpd restart
chmod 777 /etc/squid/
yum install automake pcre-devel gd-devel gcc mysql mysql-devel mysql-server php mysql php-mysql php-gd php-ldap -y
yum install libstdc++-devel gcc-c++ libtool curl libcurl libcurl-devel libidn-devel git-all.noarch -y
Набираем «patch -l» и вставляем следующий текст. В конце нужно два раза нажать Ctrl-D
--- libtool.old 2012-02-14 17:34:10.363994833 +0400
+++ libtool 2012-02-14 15:55:27.142358890 +0400
@@ -5986,7 +5986,8 @@
case $dir in
[\\/]* | [A-Za-z]:[\\/]*) ;;
*)
- absdir=`cd "$dir" && pwd`
+# absdir=`cd "$dir" && pwd`
+ absdir="/usr/lib"
test -z "$absdir" && \
func_fatal_error "cannot determine absolute directory name of \`$dir'"
dir="$absdir"
---------
chkconfig mysqld on
service mysqld start
/usr/bin/mysqladmin -u root password '123456'
mysql_secure_installation
далее вводим
123456
n
y
n
y
y
yum install libmysqlclient15-5.0.95-5.w5.i386.rpm openssl098e-0.9.8e -y
cd /usr/src
tar xf sams-2.0.0-rc2.tar.bz2
mv -f sams-2.0.0-rc2 sams2
cd /usr/src/sams2
make -f Makefile.cvs
sh ./configure
make
make install
если есть ошибки то удалить установку
make clean
и дальше с бубном...
chown -R apache:apache /usr/local/share/sams2/
chown -R apache:apache /usr/local/etc/sams2.conf
chmod 777 /usr/local/share/sams2/data/
ln -s /usr/local/share/sams2/ /var/www/sams2
service httpd restart
nano /etc/httpd/conf.d/sams2.conf
root 123456
nano /usr/local/etc/sams2.conf
DB_ENGINE=MySQL
DB_SERVER=localhost
SAMS_DB=sams2db
ODBC=0
PDO=0
ODBCSOURCE=sams_mysql
DB_USER=sams
DB_PASSWORD=123456
SQUIDCACHEFILE=access.log
SQUIDROOTDIR=/etc/squid
SQUIDLOGDIR=/var/log/squid
SQUIDCACHEDIR=/var/spool/squid
WBINFOPATH=/usr/local
SAMSPATH=/usr/local
SQUIDPATH=/usr/sbin
SQUIDGUARDLOGPATH=/var/log
SQUIDGUARDDBPATH=/var/db/squidguard
RECODECOMMAND=iconv -f KOI8-R -t 866 %finp > %fout
REJIKPATH=/usr/local/rejik
SHUTDOWNCOMMAND=shutdown -h now
; Proxy id
; Identificator of proxy, starting from 1
CACHENUM=1
--------------------------
nano /etc/httpd/conf.d/sams2.conf
Alias /sams2 /usr/local/share/sams2
<Location "/sams2">
Options Indexes
Order allow,deny
Allow from all
</Location>
-------------------------
nano /etc/httpd/conf.d/doc4sams2.conf
Alias /sams2/doc /usr/local/share/doc/sams2-2.0.0
<Location "/sams2/doc">
Options Indexes
Order allow,deny
Allow from all
</Location>
--------------
Запуск демона
вручную sams2daemon
автозагрузка
nano /etc/rc.local
/usr/src/sams2/src/sams2daemon
touch /var/lock/subsys/local
-----------------------------
shutdown -r now
дальнейший тюнинг
mkdir /var/www/sams2/messages
кидаем туда картинку типа www.jpg
nano /var/www/sams2/messages/blocked.php
<div align="center">
<a><img src="http://192.168.1.101/sams2/messages/www.jpg"> </a>
</div>
----------------------
в squid.conf должны присутствовать
# TAG: acl
# TAG: url_rewrite_program
# TAG: url_rewrite_children
# TAG: url_rewrite_concurrency
# TAG: url_rewrite_access
# TAG: auth_param
# TAG: authenticate_cache_garbage_interval
# TAG: authenticate_ttl
# TAG: authenticate_ip_ttl
# TAG: authenticate_ip_shortcircuit_ttl
# TAG: external_acl_type
# TAG: url_rewrite_children
# TAG: url_rewrite_concurrency
# TAG: url_rewrite_access
# TAG: auth_param
# TAG: authenticate_cache_garbage_interval
# TAG: authenticate_ttl
# TAG: authenticate_ip_ttl
# TAG: authenticate_ip_shortcircuit_ttl
# TAG: external_acl_type