Hosting your AppGini app on a server that uses Plesk
Articles,  Blog

Hosting your AppGini app on a server that uses Plesk


Hello! I’m going to show you how to host your AppGini application on a server that includes Plesk control panel. So for this example I’m going to use this simple project which is a project for managing photo albums for clients for a photographing studio. So I’ll generate the code, select this folder, and, okay, I’ll override all files and click OK So this is our sample application, and we are going to upload this application to our website that uses Plesk control panel. So for this example I’m going to use a site hosted on A2Hosting which provides nice hosting for good prices and I’m already logged in and I’m going to click on login to Plesk control panel. Now what we need to take care of is these two links: files and databases. We’re going to use both in this demo. So first I’ll go to files and upload the application. So this is the file manager. Now it depends on which hosting provider we are using, but in this example, our website is hosted in a folder named httpdocs. In other cases it might be named htdocs or public_html. So you should refer to your hosting documentation for the exact folder name. So we’ve opened httpdocs and I’ll create a new folder so that I host the application in a subfolder of the website. If I want to host it directly on the main domain of my website, I should upload the application into this folder, the httpdocs folder. But in our example I’m going to create a subfolder or a directory and I’m going to name it studio. Okay so here it is. And it’s still empty of course, so I’m going to upload the application into this folder. Now before uploading there is a neat trick that I love to use when using Plesk, which is, instead of uploading all files individually and all folders individually, which takes a lot of time, there is very neat trick where I’ll select all the files and then compress the files into a zip file. Now I’m using 7-zip here but you can use any file compression program. And I’ll add it to studio.zip. So here it is and all I need now is upload this single file and then uncompress it after uploading. So I’ll go back to Plesk and then click on upload, and then select the path of our file. I can just copy it from here. Copy address, and paste it here, and then look for our zip file. Here it is and it’s uploading now, and as you can see, it’s almost done. Here it is. It takes a very short time, and it’s only a single file, so there is no chance of forgetting to upload one of the folders or one of the files. It’s all a single file. Now I’ll select that file and then click extract files. So I should make sure that I’m extracting to the correct folder. So this is the folder where the files are going to be extracted. And actually there are no files to replace currently, but in case you’re updating an application that’s already uploaded, you might want to check this checkbox. I click okay, and it’s going to take a very short time, and here’s everything. So the final step in this stage maybe you should delete the studio.zip file; you don’t want it to stay in your application folder. So I click on remove, yes. And that part of the demo is finished now we have uploaded the application. The next step is to prepare the database for the application. So we go to the databases section, and add a new database. Let’s name it studio for example. And we’ll create a new user for that database. Let’s say the name is going to be studio as well. And we’ll select some password. Maybe you could just ‘Generate password’ and copy it. So just show the password in order to copy it, and then click OK. So the database is ready now. So we’ve uploaded the files, we’ve created a database, and now we’re ready to start running our application. So enter the address of our website. In this case it’s appbuilder.run/studio, which is the subfolder we uploaded our application to. And we should see the setup script loading now. Yes, here it is. Aha! We are seeing a warning here. Images folder is not writable. This will prevent file uploads from working correctly. Please set the folder as writable. So in order to fix this issue, we go to files and then we go to the httpdocs folder, and we click on our subfolder, and then this is the images folder that is the subject of our error message. So let’s change the permissions for that folder. So for this group will check the write permission. Apply. So to make sure permissions are correct, I’ll click the recheck button here. And it seems things are fixed now. Let’s click continue. Let’s go. And then in the database name the database name is appbuild_studio. User name is studio and the password that we just copied. Yes and the database info is correct. So it’s good to go. And let’s select a username for the administrator. Let’s say it’s gonna be admin and the email would be admin at example.com. Of course, you should enter your actual email here. And let’s select some password for the admin, and submit. So now tables have been created, but we have an error message here: Unable to write config file, and this is the config file that you should write. Now in order to fix this issue as well, you should do the same for the folder in which we are hosting our application. So we go back to files and then httpocs and then for the studio folder, we should change the permissions so for the application pool group, we’ll allow write access. Apply. And if we refresh that page, so that issue has been fixed it now. Now let’s start using our application so here we can start defining some ficticious client. I’ll save. And now for that client I’ll create a new album. So let’s say that’s nature, for example. Save. And now if we refresh that page, you should see one album here and we can upload some test photo to make sure uploading is working correctly. Let’s select some sample photo from here. Maybe that cute koala. And saving … So here is our koala! Back. Let’s try another one as well. Let’s get those penguins as well. Save. Back. And here is our cute album. And as you can see, this is how we can host our application on a server that uses Plesk control panel. So let’s review the steps quickly. So the first step was going to the files section of the file manager. Creating a new folder, and let’s do this from the beginning, which is setting the permissions for that folder so that it’s writable by the application. So this is done by clicking change permissions and making sure the application pool group has write access. And after that we can upload our application as a zipped file, and then extract it here, and then make sure that the images folder has write access by changing permissions, and making sure the application pool group has write access the next step is to create the database by selecting add database, choosing the name for the database, and the database user and some password, and make sure to copy this password. And then the final step was going to the URL of our application and if all goes correct, we should see a setup page, enter our database information and after that our application is good to go. I hope this has been helpful, and thank you for watching.

Leave a Reply

Your email address will not be published. Required fields are marked *