I’m looking at you: HTML, CSS (is that even a language?), JavaScript, PHP, et al. Nginx loads these configuration files from the /etc/nginx/sites-available path.Using Xojo Web to create complete web apps and solutions means not having to learn a bunch of interpreted languages and dozens of ever-changing frameworks.
They will encapsulate the configuration details and will allow hosting of more than one domain on the same server. Think about this block like the virtual hosts on Apache. Once the server is running, create a new server block. Test this by typing: $ systemctl status nginx Once Nginx is installed, Ubuntu automatically starts this process, so the web server should be active already. Securing a server is a very complicated process which is why we take care of the for you with Xojo Cloud. Note: This tutorial does not discuss web security which in the overwhelming majority of cases should be a paramount issue and not ignored. The output should be similar to this (in my case access from SSH and 8080 ports are also enabled). Type the following command to verify the changes: $ sudo ufw status Nginx registers itself as a ufw service during its installation. In order to simplify the deployment example, use the most restrictive option allowing only web traffic from port 80: $ sudo ufw allow 'Nginx HTTP' It will need to accept incoming connections from Nginx.
To install Nginx, access the remote server using SSH: > SSH the new session is open, type the following commands to install Nginx: $ sudo apt update Nginx is a light web server which provides more performance when compared with Apache (that is, it is able to serve more requests per second, among other improvements). If the server doesn’t have Nginx already installed, install it now. Once all the files have been copied, make sure to set 750 as the privileges value for the folder and files (choose the option to apply these recursively to all of them). Make sure to copy the folder with the compiled app to the /var/XojoApps path on the server (you’ll need to create that folder/directory first). I’m using the Cyberduck app on macOS but you can choose any method you like. This is the folder you will copy to the server. Once the app is compiled, you’ll get a Folder/Directory with the following items inside: Next, click on the Build button in Xojo’s IDE toolbar.
Then, select X86 64 bit from the Build popup menu in the Inspector Panel. Make sure to choose the Linux checkbox in Build Settings. Note: Adding the port is not required at this time because the port can be assigned when running the app once it is deployed to the server. Next, enter 9000 as the port under the Build Settings section in the Inspector Panel. Setting the Deployment OptionsĬlick on the Shared option found under the Build Settings section in the Navigator. The classic “Hello World” en español, this is everything the web app will do.
With the button still selected, add the Pressed Event Handler and type this line of code in the Code Editor: MessageBox "Hola Mundo" Next, drag a button from the Library panel and drop it anywhere on the Layout Editor. Start the Xojo IDE and choose Web from the Project Selector window:Ĭlick on the Web item displayed in the Navigator to access the webpage Layout Editor. This very simple app will display a message when the button is clicked. At the end of this tutorial, you’ll find deployment of more complex web apps can follow the same basic principles. Though this tutorial is focused on the deployment aspects of a web app, we’ll first create a very simple web app in Xojo. As we all know, you don’t usually want to run anything as the root user! Note: While we are using the “root” user for all the operations to keep the tutorial as short as possible, including files/folders/directories creation/edition and also for launching the web app, you’ll probably want to create a specific user with the proper privileges/group configuration for this. We will use Ubuntu 20.4 (64-bit) running on a remote server (VPS) in this example, but this tutorial should work on other Linux distros with minimal change, for example CentOS.įirst, in order to deploy a web app you’ll need a way to access the remote server using the Terminal (macOS) or through the Command line, also a way to create and/or modify several files, and to copy files from your local computer to the remote server using (S)FTP. This tutorial provides a step-by-step guide to deploying Xojo web apps on a Linux server.