how to add ftp users to an apache from PHP? - php

how do i go about adding ftp users to an apache web server? i need the user to register from normal web/script and then have an FTP account set up for them automatically.
I have seen the cPanel API, and it is pretty decent, but since cPanel costs money, i don't wish to use it for this project. I'm also reluctant to use any other lisenced piece of software.
i want to be able to do it using shell/batch (or pure PHP, though that hardly seem plausible)

Well as you said Apache is a Web and not an FTP Server. But most FTP servers like e.g. PureFtpd offer MySQL authentication. So you just have to modify the authentication table with PHP to add new users.

Related

How to use SSO in a php written website with apache 2.4?

I am an intern in a company and have to make an intranet for the company. The difficulty for me is that i am very new to programming and don't really know how apache works.
The users don't want to log into the intranet (put the login and password) everytime they come on the site, they want them to be logged in without doing that.
All my users use Windows 7 (or higher), and i will write the intranet in php-sql, using apache server 2.4.
I want to know how i can connect the users by SSO using NTLM (because the authentification is done with Active Driectory, i would like the user to be connected automatically with their Windows login and password)? What is the apache module for that and how do i proceed ? What Library do i use in PHP ?
I really am stuck at this point and can't seem to find a solution, please help me. I found some links that could help me but i don't understand what is the author saying.
Here are some links about the subjects :
a forum question
a wiki article
Actually i saw that this kind of question was already asked here (How can I implement single sign-on (SSO) using Microsoft AD for an internal PHP app?) but I don't get the solution, I would like someone to explain a little bit in detail as i said before i am very new to programming.
First of all using Apache is not necessary and will complicate things somewhat to do what you are trying to do, if you can use IIS server on one of your Windows servers you will be laughing.
Install PHP on the IIS server
Create a new website in IIS
Set the new websites access to Windows Authentication and disable anonomouse access.
What this will do is configure IIS to authenticate the users against Active Directory, if they are on a Windows machine on the local network, already authenticated to the local domain, and the intranet is defined by GPO as a intranet site then the users Windows login details will be automatically passed and can be accessed in PHP using the $_SERVER superglobal.

Programmatically access windows share in php via kerberos or ntlm

I have a few requirements here on which I am not sure if they're even possible the way they're requested. Sorry beforehand for not having code, but I feel stackoverflow fits the most for this question, and I can't write code on company time before the situation is clear.
Setup
A windows server with an IIS and PHP running via FCGI. There's an intranet (php/mysql) running on this machine. Users currently have anonymous access to it, since it is an open intranet. All users are in the same windows domain.
SSO and windows shares
As far as my research got, single sign on via NTLM is possible and should not be a biggie to implement into the current intranet. However, there's a plugin running which reads directories from defined windows shares, and spits out a file list. Those files are read by a specific user account having read access to this share.
Is it possible to authenticate the current user at the windows share to read files, via that data I receive from SSO (via ntlm or kerberos or ...)?
You need Kerberos, Credential Deleagtion and Impersonation. Forget NTLM.
Edit: On Windows, this is solved by SSPI, on Unix by GSS-API.

How to connect VB.NET to Web Host

Basically, I want to create an application like this:YOUTUBE
I want to create an application that when I add some information from my web host (either PHP or MYSQL) VB.NET will read it.
From your website you'll need to insert the data into your MySQL database.
The problem with using the database provided by your web host is that the chances are, due to 'Security Reasons' the will have disabled external access.
This means that any files outside of your web server (your sites root/sub directory) will not be able to access the data. So, while your website will be able to connect without a problem, your program will not.
Some hosts give its customers the opportunity to add an IP address to a white list which enables them to bypass their security system. However, most will not give you this option.
My suggestion is that you either rent a VPS where you can run both the WebServer and Your MySQL database (and PHPMyAdmin) from or Set Up A MySQL database on your PC (its not that difficult just read the manual and youll be fine). If you had a VPS then you would no longer need your pre hosted webserver as you could run your own. You would need to point your domain name to your VPS webserver. It will act just like any other.
By running your own MySQL Databse you are given the option to enable remote access. This means that any external entity with the correct details will be able to connect.
If you cant get a VPS or don't want to run your own server or rent a server that allows for external access. Check out db4free.net .They provide you with a free MySQL Database with external access for Developers to test out their systems. They are not ultra fast so that's something you may want to be aware of. Another thing is that your data that's held can be removed at any time. The servers are not there to be used permanently just for testing.
So how do I connect to it through VB???
Good Question! To establish a connection, I suggest you use MySQL.Data library provided my DevMySQL themselves and import it into your program. Done so by Imports MySQL.Data.MySQLClient. This is written by them to work with their databases. Yes you can connect using some of the functions already in VB but in my opinion they don't work as efficiently. You'll need to download the MySQLConnector to connect as well.
Hopefully That Answers Your Questions. Any Problems Just Comment below!
Regards
Joe

IMAP: Change email password through php

How can I change password of the mail account using php. I am using IMAP functions.
IMAP doc : http://php.net/manual/en/book.imap.php
Note: There is no acess to cpanel API
If you don't have access to the cPanel API, then you're even less likely to have root access to the various files that would be needed to make the changes.
Changing passwords is not a feature of IMAP, POP or SMTP - it's a server configuration issue, so you need to manipulate the server configuration. Several hosts provide APIs (such as cPanel / Hostgator) but you've ruled that out, so he only other option would be "exec", and I wouldn't touch that with a bargepole for cPanel, Plesk or simlar as you'd also need ot manuliplate the databases that store the configs. Ouch, if if you had root access.
Edit: A bit more reasearch and I have found this: http://trac.roundcube.net/browser/github/plugins/password/password.php that supports several back ends. However the cPanel option uses the cPanel API; so still no luck!
What you could try is mailpw_change. It is not really PHP, but a simple HTML UI with a Python script that is called underneath (which you could adapt to your needs as it's super-simple).

Clueless on how to put my PHP project in the Internet

Good day!
I've searched for many sites on how I could deploy my PHP projet in the internet but I don't know how to do it because I am confused with some of the technical terms.
You see, I am using xampp for my local web server. Now I want to put it in the internet. I found some free web hosting sites so i've decided to upload all my htdocs files inside it.. But how can I put the xampp (apache server) and my mysql database on it? I'm confused. Please help. A step-by-step procedure of what should i do could be really helpful. Thank you in advance.
Get a hosting account (try www.bluehost.com for instance).They will set you up with a Linux server and MySQL. You don't have to install Apache or MySQL, you will use whatever they've got. All you need to do is upload your PHP files to the right folder, setup your database on their server and you should be good to go.
If you buy a domain-name and space, connect them using the NS settings
If you are using a free, then the settings are already okay.
Export the database from your XAMP.
Login to the remote server. There you'll find PHPMyAdmin. Import the database.
Upload the file.
Make sure file listing is off. That is if a user goes to any directory he can not see the file list!
Done :)
Simplifying a bit, there are two ways you can get your site online.
First, you could purchase or rent a server that is yours and yours alone. This is commonly called "dedicated hosting" and costs somewhere around $100 / month. If you choose this option, you have your own server housed in a datacenter somewhere, and you must install Apache, MySQL, and any other server software you care to use.
I doubt, given what you've described, you have chosen this option.
Second, you could rent "shared hosting" from any one of the dozens of hosting providers out there. If you do this, with a typical cost of $2 to $10 per month, the hosting provider is administering the server. You have no direct access at all. Your only access is through the tools they provide.
Given that, how specifically you can upload files is up to them (is it FTP? SSH? a horrifying web-based upload tool of some kind?) Similarly, how you access your MySQL databases (assuming they offer MySQL databases) is entirely up to them as well.
Many providers now use a tool called cPanel for this administration, so you may try browsing to www.example.com/cPanel (using your domain) on the off chance that works. If not, though, follow the instructions your host provides. Only they can correctly describe how their setup works.
The hosting will be already having apache and mysql installed you only have to put your files thats it
I suggest you contact your webhosting site. The web hosting needs to host php, and mysql. Then you can upload your files to their web server, and copy your mysql database to their mysql server.
You do not need to transfer xampp to your host: apache and mysql are running on nearly every server
Upload all your files in your htdocs directory via ftp to your server
To transfer your database, use phpMyAdmin. It is installed with xampp and alos installed on nearly every server. In phpMyAdmin, use the export/import functionality
In your php file where you connect to the db change the login settings to the settings the hoster gave you
That should work...
Hosting Company already have setup for apache,php, mysql. All you need to uploads all your
files from xampp htdocs to a right folder like public_html using a ftp software like
filezilla. They also provide a control panel like using which you can manage your mysql
database and all others settings like directory permission.

Categories