Training, Open Source computer languages
PerlPHPPythonMySQLApache / TomcatTclRubyJavaC and C++LinuxCSS 
Search for:
Home Accessibility Courses Diary The Mouth Forum Resources Site Map About Us Contact
 
For 2023 (and 2024 ...) - we are now fully retired from IT training.
We have made many, many friends over 25 years of teaching about Python, Tcl, Perl, PHP, Lua, Java, C and C++ - and MySQL, Linux and Solaris/SunOS too. Our training notes are now very much out of date, but due to upward compatability most of our examples remain operational and even relevant ad you are welcome to make us if them "as seen" and at your own risk.

Lisa and I (Graham) now live in what was our training centre in Melksham - happy to meet with former delegates here - but do check ahead before coming round. We are far from inactive - rather, enjoying the times that we are retired but still healthy enough in mind and body to be active!

I am also active in many other area and still look after a lot of web sites - you can find an index ((here))
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.

You can Add a comment or ranking to this page

© WELL HOUSE CONSULTANTS LTD., 2024: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • FAX: 01144 1225 793803 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho