Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


Closed Thread
  Search this Thread
Old 06-10-2017, 11:54 PM   #1
Registered: Sep 2006
Posts: 855
Blog Entries: 33

Rep: Reputation: 20
apache Code for Creating a Linux User

See for which project this is regarding.

I will be wanting to create a web server. I know quite a bit about basic HTML coding. However, what I would like to learn is some advanced HTML coding. Web coding, more specifically. Not necessarily all HTML.

My OS that the webserver will be running on is Mandriva Linux 2010.1. Yes, I know it's old.

I have a script that can create new users, according to specifications I've created. There are a few scripts for doing this. I forget which one is the most relevant script, to name the exact one, but I know that my scripts can create new users. I can't remember whether it is BASH, or SH.

Whichever, I would like to design a web interface running on apache, which will allow me to run scripts to do the actual work, by clicking a button in the web interface.

One button should run the script to create a new user, and in another part, the other button should run the script to delete the user, probably asking first if the user is sure he/she wants to do this.

I'm not sure how to run the scripts from the button. Please give me some code examples and/or resources to learn this. Perhaps this would have to be done with CGI?

The overall picture, is that I will be creating a website on a server I design, which will organize other websites that have actual content. I will not be supplying all of the content, valid users who have gained permission to do so on the server will. I will link to that website via my main network website, in a way, because it is a network service on my network. It will be running on a non-standard port (from the outside world). The main network website is already running on a standard port.

There are basically two ways I could go about adding/removing users. The first way is the way I have been doing it a lot, which is by request. Then I manually approve or deny the request and if it's approved, I take the action I need to take, and notify them.

What I know is possible, but I don't know how, is to have the computer do this task. Then, anyone can click the buttons and sign up for a website, but the computer will decide based off of my rules, who is approved and denied, and will automatically create the account.

The website they create after the account is created, is up to them to create. I do not want the program to create a website for them.

I know there are other sites where this is possible, such as I want to create a website, sort of like their signup page. No, I will not be copying google's code or anything. I don't want to recreate google. I just am saying that I want to have the computer do the work, just like google does. Nobody has to manually enter information to create your google account.

I will want to also do the same for my vmail server, when I get to that point, but then it will be mail accounts created, not web accounts.

For the web server, the user will access their website by using the directory way of accessing the website. My main website will be the one that signs up, and the rest will be user's websites which is done by the home directory function in apache.

While I'm at it, I will probably want to have the user be able to add the website to the directory, which simply provides a link in a table on the main website. I will want all websites to be automatically added to the directory.

I can see what websites there are, all of the websites on the server, by going to the directory. It will have links to the homepage (which it assumes will probably be index.htm or index.html), of each website.

Then one way I could get to the websites, is by going to my network's home page ( Then I'd access the service page for my network's vweb server, which is actually a website on my server, linked in a way to create two halves of the network website. Once on vweb's page from the network's page, I would then click the link to the website I wanted to go to in the directory. This is one way I might get to them.

As my first user, I would create a user for myself, and move my personal webpage to my own server, and then remove the old version. I would probably have to recode from scratch my website, to prevent bad code, but I could transfer some of my existing files there or something like that. Here is my personal website:
Old 06-11-2017, 12:15 AM   #2
Registered: Jan 2017
Location: Manhattan, NYC NY
Distribution: Mac OS X, iOS, Solaris
Posts: 508

Rep: Reputation: 143Reputation: 143
So basically you want to create a website that actually creates login UNIX/Linux users... how many ways can I say bad idea?
2 members found this post helpful.
Old 06-11-2017, 01:32 AM   #3
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=14, FreeBSD_12{.0|.1}
Posts: 5,573
Blog Entries: 11

Rep: Reputation: 3588Reputation: 3588Reputation: 3588Reputation: 3588Reputation: 3588Reputation: 3588Reputation: 3588Reputation: 3588Reputation: 3588Reputation: 3588Reputation: 3588
You have described an internet facing system which has many layers and aspects to consider, and cannot be answered in any simple "example code" way.

Further, deploying even a simplistic internet facing web and email server on Mandriva Linux 2010.1 in the current web environment would be a very bad idea to say the least, if even possible. Doing so with mail server and user created login accounts would be totally out of the question! Do not proceed on that basis.

For development of any sort of web based membership system you will need to use much more that HTML and Apache defaults. PHP and Perl are probably the two most widely used scripting languages for web development, Python and Ruby might also be worth investigating. You will also require some form of database implementation, MariaDB (MySQL) and PostgreSQL being the most common free foundations on which to build.

Your question as asked is overly broad at best, very vague and has no useful specific answer. As such it does not rise to the standard required by the LQ guidelines, to which I now refer you, and this thread will be closed.

Please limit posts in the Programming forum to well defined specific issues, and provide as complete context as possible. This will help members provide more useful answers and maintain the high quality and accessibility of information available here. If you wish to discuss a more general idea, please post to the General forum.

Last edited by astrogeek; 06-11-2017 at 01:34 AM.

Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] creating .SO (shared object) file in C code in linux rohaanembedded Programming 7 06-03-2013 05:50 AM
Ubuntu server- creating a limited apache user account with domain name? ashamanmiller Linux - Server 1 07-19-2012 08:49 PM
i need the source code or the procedure for creating my own shell in linux chaitra Linux - Newbie 9 11-03-2010 10:22 AM
Creating user directories in Apache root robojerk Linux - Networking 1 09-21-2004 12:34 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:10 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration