platinum 回复于:2004-03-31 08:58:59 | ||||
我第一个顶,支持!!! 不过IPTABLES部分好像和我的有点像哦~~~ :mrgreen: | ||||
panwj 回复于:2004-03-31 09:23:29 | ||||
好文! | ||||
text2002 回复于:2004-03-31 10:23:29 | ||||
都是高手也! 有squid的基础资料吗?今天系统启动的时候看到squid的报错,google上搜索squid也没有了解多少。 谢谢。 | ||||
linuxsky 回复于:2004-03-31 10:28:13 | ||||
虽然目前用不上mysql_auth 学习一下也不错。 | ||||
好好先生 回复于:2004-03-31 10:38:15 | ||||
[quote:4df431a5fd="text2002"]都是高手也! 有squid的基础资料吗?今天系统启动的时候看到squid的报错,google上搜索squid也没有了解多少。 谢谢。[/quote:4df431a5fd] 呵呵!高手只是比别人多努力了一点而已,这是我个人的看法。我想llzqq也会同意我的观点的。 :em02: 希望大家都能成为“高手”,都多给大家带来点好文章! :em02: | ||||
llzqq 回复于:2004-03-31 11:42:42 | ||||
为了这个我实验了两个月。 | ||||
pansoncn 回复于:2004-04-02 16:10:51 | ||||
好,太好了。 | ||||
yanguo66 回复于:2004-04-02 16:40:22 | ||||
请问你的squid 的版本是多少? | ||||
llzqq 回复于:2004-04-02 16:41:57 | ||||
squid-2.5.STABLE3-3.3E.i386.rpm | ||||
laixi781211 回复于:2004-04-02 16:57:50 | ||||
mysql_auth v0.5 Squid HTTP proxy MySQL authentication module Ervin Hegedus Wed Jan 15 18:10:00 CET 2003 Contents Introduction Installation Create database Issues when compiling Configuration file Squid.conf changes Testing Contact details Introduction This is an authentication module for the Squid proxy server to authenticate users on an mysql database. The database is a single table, and the table is a very simple user-password pair, with plain or encrypted passwords. There is a utility, called by mypasswd. With this you can add a new user to your pasword database, update it or delete from. It uses the configuration file, what mysql_auth. Usage is simple. It accepts a username and password on standard input. It will return OK if the username/password is valid, or ERR if there was some problem. Check syslog messages for reported problems. mypasswd is also a very simple program: simply type mypasswd with no arguments, and it gives you help about itself. Note, these are the examples about it: shell> mypasswd user password add a new user if it doesn't exist, or update its password. This form of mypasswd also makes it: shell> mypasswd user Enter NEW password: Re-enter NEW password: Password record ADDED succesfully. And you can delete a user from database, like this: shell> mypasswd -d user mypasswd has a CGI format, it is called by mypasswd.cgi Fom more info, please visit the projects webpage. mysql_auth is released under the GNU General Public License and is available from http://people.fsn.hu/~airween/mysql_auth/. Mysql_auth tested with MySQL 3.23, on Linux and FreeBSD os's. Installation Make any changes to the source code you need. For example, set up correctly place of configuration file. See that in define.h. Review the Makefile, and modify based on target platform or site requirements. Setting up the mysql.h header and libmysqlclients.a places. Setting up your squid user and group accounts, and squid root directory. Setting up correctly the permissions of mysql_auth.conf (mode 600)! This is very important! This file included a mysql account, with select, update, insert and delete privileges! Also very important: if you use mysql.log, be very carefull! It contains all transactions! For example: 52 Query UPDATE data SET password = password ("1234") WHERE user LIKE 'airween' After when you edit what you want, type 'make', then 'make install', then 'make clean'. 'Make install' will put 'mysql_auth' into /usr/local/squid/bin by default, and 'mysql_auth.conf' to /usr/local/squid/etc. Create database For store user and password pairs, you need a database, like mysql. It is very simple, one-table database. For create it, you need to run create_script from path/to/your/source/scripts directory. You can create it like this: shell> cd path/to/mysql_auth-source/scripts shell> mysql -u your_user_name -p < create_script Enter password: <type your password> To add a user: shell> mysql -u your_user_name -p mysql_auth Enter password: Welcome message... mysql> insert into data values ('joeav', 'joespass'); Query OK, 1 row affected (0.00 sec) mysql> or if you want to store your passwords in encrypted format: shell> mysql -u your_user_name -p mysql_auth Enter password: Welcome message... mysql> insert into data values ('joeav', password("joespass")); Query OK, 1 row affected (0.00 sec) mysql> Or try mypasswd: shell> mypasswd joeav joespass That's it! Note: if you set up in mysql_auth.conf the encrypt_password_form to 'yes', mypasswd also uses encrypt form. Hopefully nobody has problems compiling mysql_auth, and create_script. Issues when compiling The Makefile uses the GCC compiler, and assumes that it is in the current PATH. Mysql_auth is known to compile properly on Debian Linux 3.0, and FreeBSD 4.7 without problems. Other operating systems are untested, but use a recent copy of the GNU C compiler. Problem occur, when you can't setting up mysql header and/or library correctly. Other, if you use MySQL 4.0 or above, may be you need to use in CFLAGS -lz at last. Configuration file Mysql_auth uses a configuration file. It reads just every startup, not every query. The file is /usr/local/squid/etc/mysql_auth.conf. If this path needs to be changed, see define.h. #define CONFIG_FILE "/usr/local/squid/etc/mysql_auth.conf" An example configuration file is provided. It looks like hostnamelocalhost # FQDN hostname or IP address. usersquid # mysql user name - mysql administrator sets up. passwordsquid # password of mysql user - mysql administrator sets up. databasemysql_auth # mysql database on mysql server - a unique name. tabledata # table name in mysql database - contents two couloms, user and password. # The password store in plain or encrypt format, and of course, case sensitive. user_column user # column name where username exists. password_column password # password name where passwords exists. encrypt_password_formno # if you want to store your passwords in encrypted form # this is case insensitive; 'YES' and 'yes' is same These values are defaults, when you don't set other, mysql_auth wants to work with these. All comments start with '#'. Empty line allowed. When a user provides a username/password, mysql_auth querys from mysql server. It stops after a user has been successfully authenticated. Make sure the server can be reached and is active, or else mysql_auth will return all with errors! Squid.conf changes Refer to Squid documentation for the required changes to squid.conf. You will need to set the following lines to enable authentication for your access list - acl <yourACL> proxy_auth REQUIRED http_access allow password http_access allow <yourACL> http_access deny all You will also need to review the following directives. The number of mysql_auth children spawned is set with authenticate_children. The number of children needed is site-dependent, so some experimentation may be required to find the best number. proxy_auth_realm Squid proxy server authenticate_program /usr/local/squid/bin/mysql_auth authenticate_ttl 5 authenticate_children 5 Testing I strongly urge that mysql_auth is tested prior to being used in a production environment. It may behave differently on different platforms. To test it, run it from the command line. Enter username and password pairs separated by a space. It should behave in the following way - - Press ENTER to get an OK or ERR message. - Make sure pressing CTRL-C aborts the program. - Test that entering no details does not result in an OK or ERR message. - Test that entering an invalid username and password results in an ERR message. - Test that entering an valid username and password results in an OK message. Usernames cannot have whitespace in them, passwords can. Contact details To contact the maintainer of this package, email Ervin Hegedus at airween@people.fsn.hu, or airween@freemail.hu. Also I have a nice mailing list: https://lists.fsn.hu/mailman/listinfo/mysql-auth Good Luck! :) | ||||
laixi781211 回复于:2004-04-02 17:02:31 | ||||
谁有mysql_auth-0.6beta.tar.gz 我这里不能下载呀 | ||||
llzqq 回复于:2004-04-02 17:36:38 | ||||
我给你,留下MAIL。 | ||||
一起走过的日子 回复于:2004-04-02 17:43:04 | ||||
[quote:54c43c44e5="laixi781211"]谁有mysql_auth-0.6beta.tar.gz 我这里不能下载呀[/quote:54c43c44e5] 偶也要! anthonis@hotmail.com 先谢了! | ||||
llzqq 回复于:2004-04-02 17:56:14 | ||||
楼上清查收! | ||||
imtj 回复于:2004-04-02 20:00:18 | ||||
我也没有办法下在AUTH-MYSQL。。。可以发送给我吗? taojin@grandunion.com.cn | ||||
llzqq 回复于:2004-04-02 20:24:00 | ||||
http://freshmeat.net/redir/mysql_auth/34350/url_tgz/mysql_auth-0.6beta.tar.gz 自己下吧! | ||||
一起走过的日子 回复于:2004-04-03 17:23:43 | ||||
[quote:82c3931f9c="llzqq"]楼上清查收![/quote:82c3931f9c] 谢了先^_^ :em02: | ||||
cysky 回复于:2004-04-04 07:53:41 | ||||
好文章, | ||||
wujianpengjj 回复于:2004-04-04 10:25:26 | ||||
我觉得原来的好像也没有问题,就是要注意一下,mysql_auth编译时候mysql的lib的位置,还有就是squid启动的时候注意一下mysql.socks的位置,有的是在/var/lib下的,有的是在 /tmp下的我最近作pureftp+mysql的时候就遇到这个问题了。我用的是mysql_auth0.5。还有认证好像对透明代理没什么用的它只能认证http的其他的好像iptables直接就转发了。不知道我说的对不对,楼主能联系一下吗?wjp@mail.neuq.edu.cn | ||||
hefish 回复于:2004-04-04 13:40:12 | ||||
我靠,4个月? 我写个openldap_auth也不要这么长时间啊。。。。 | ||||
好好先生 回复于:2004-04-04 14:03:10 | ||||
[quote:07555b39bb="hefish"]我靠,4个月? 我写个openldap_auth也不要这么长时间啊。。。。[/quote:07555b39bb] 老大,把你的心得共享一下我们不就省事儿了吗?也不至于走弯路了。如果可以,我代表我们版的网友先谢谢你! :em02: | ||||
llzqq 回复于:2004-04-04 16:05:22 | ||||
[quote:b12d845562="hefish"]我靠,4个月? 我写个openldap_auth也不要这么长时间啊。。。。[/quote:b12d845562] 什么意思。 | ||||
hefish 回复于:2004-04-04 18:21:58 | ||||
没有其它意思。 | ||||
wujianpengjj 回复于:2004-04-04 20:12:19 | ||||
看来我挺笨的我做了一年多。 | ||||
iyxlcczy 回复于:2004-04-07 22:12:52 | ||||
:em02: 兄弟, 我也要。 邮箱: iyxlcczy@163.com
|