| |||||||||||
Adding full accounts via a web front end Posted by enquirer (enquirer), 10 December 2005 I'm running a Linux, Apache, MySQL and PHP based system and want to provide web space on my server to a number of people each with their own account area, database area, and URL area on the server. I can set up the accounts easily enough, but when I have a whole lot of them to do at once I'm afraid I'll make a few mistakes. How to automate?Posted by admin (Graham Ellis), 10 December 2005 In effect, you're providing an ISP (or rather WSP - Web Space Provider) facility for your people.First step is to work out carefully what you need to do to create the accounts in terms of Linux commands like useradd and passwd, and mysql commands. Take great care to get file permissions and models right at this stage. Then automate the thing via a shell script - example - and test to make sure it works. You'll find I've put sample template files up too - .my.cnf, welcome README file and an acceptable user policy file. The template directory should also include a public_html area with a starting index.html in it, and care shoulr be taken to get file permissions right. Passwords for MySQL and other root accounts should NOT be included within this script, but supplied when you run it from the command line. Second step - you can use an expect program to run the first script from a user account and this will give you the ability to add accounts without having to log in as the administrator. We've an example script in our resource centre. Final step - run that expect script from a web page; again we have a sample available. You could as an alternative write loops into your code at the shell or expect level, and have your script add a batch of users. Much more detail (and warnings of the danger of leaking out root accounts) at our solution centre This page is a thread posted to the opentalk forum
at www.opentalk.org.uk and
archived here for reference. To jump to the archive index please
follow this link.
|
| ||||||||||
PH: 01144 1225 708225 • FAX: 01144 1225 793803 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho |