LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   apache Code for Creating a Linux User (https://www.linuxquestions.org/questions/programming-9/apache-code-for-creating-a-linux-user-4175607716/)

des_a 06-10-2017 11:54 PM

apache Code for Creating a Linux User
 
See http://www.linuxquestions.org/questi...rk-work-37440/ 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 sites.google.com. 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 (http://sites.google.com/site/smileynetmain. 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: http://www.despersonal.00server.com.

Laserbeak 06-11-2017 12:15 AM

So basically you want to create a website that actually creates login UNIX/Linux users... how many ways can I say bad idea?

astrogeek 06-11-2017 01:32 AM

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.


All times are GMT -5. The time now is 12:24 PM.