cd /etc/httpd/conf
openssl req -new -newkey rsa:1024 -keyout 2008.key -nodes -x509 -days 965 -out 2008.crt
For some fields there will be a default value, If you enter '.', the field will be left blank. ----- Country Name (2 letter code) [AU]:US State or Province Name (full name) [Some-State]:Virginia Locality Name (eg, city) []:Charlottesville Organization Name (eg, company) [Internet Widgits Pty Ltd]:University of Virginia Organizational Unit Name (eg, section) []:XXX Department Common Name (eg, your name or your server's hostname) []: server.dept.virginia.edu Email Address []:zzxxss@virginia.edu [root@xxxx conf]#
You then go to /etc/httpd/conf.d and edit 2 lines in the the file ssl.conf SSLCertificateFile /etc/httpd/conf/2008.crt SSLCertificateKeyFile /etc/httpd/conf/2008.key Then edit the section ## ## SSL Virtual Host Context ### General setup for the virtual host, inherited from global configuration DocumentRoot "/home/www/secure" in the same file to turn on the HTTPS server Then restart the web server with /etc/rc.d/init.d/httpd restart
AuthName TEST AuthUserFile /home/xxxx/.htpasswd AuthGroupFile /dev/null AuthType Basic order deny,allow deny from all require valid-user satisfy anyThe web server saves the username ($_SERVER["REMOTE_USER"] and $_SERVER["PHP_AUTH_USER"]) and password ($_SERVER["PHP_AUTH_PW"]) in PHP global variables.
AuthType NetBadge PubcookieAppId AppID require user user1 user2 user3...
From within MySQL, you must grant each user update rights on the user table from the web server with this command: grant update (password) on mysql.user to user_id@web.server.virginia.edu;To change the password, you create a web form that prompts for the old password(once) and new password (twice) and then pass it off to a handler program that makes sure the new password is typed the same way twice and then issue the set password command to MySQL:
set password for user_id@xxxxx.yyy.virginia.edu = password("newpassword");
Source