Adding a Landing Page to Prosper202 Hosted Nginx Server

You might not aware of the fact that landing pages can be served from the same VPS you’re running Prosper202 on and it can be faster than on shared hosting. It’s also important to have fast landing pages as well as tracking. And you don’t have to pay extra to host landing pages since your Prosper202 hosted VPS can give really good speeds for landing pages.

Landing pages can be lot faster on same VPS as Prosper202 because they are less complex and most of them don’t require MySQL. But it’s a good Idea to upgrade to at least 1GB RAM if you’re using WordPress for your landing pages.

If you’ve brought my Prosper202 installation service or followed my step-by-step Prosper202 installation tutorial, this post will help you add landing pages to your VPS. Although it’s a very simple procedure, there is not a single tutorial on internet explaining how it’s done. So I’m going to put together very short tutorial.

Before I start, I’m going to assume you’ve followed my Nginx-Prosper202 guide or brought my Prosper202 installation service to configure your server. If you’re coming from Fiverr GIG, please read connecting to VPS with SSH and use Putty method to connect to your VPS.

The procedure is same as adding a new site to your server. So let’s start by creating a new directory for new site.

sudo mkdir -p /var/www/example.com/htdocs/ /var/www/example.com/logs/

Replace example.com with your domain name or sub-domain. Next, let’s give the folder ownership to Nginx by giving following command.

sudo chown -R www-data:www-data /var/www/example.com/

Following command will create an empty configuration file for your site. Once again replace example.com with your domain name.

sudo nano /etc/nginx/sites-available/example.com

Now let’s add some rules. These rules will work for most landing pages including those with WordPress. If you look closely, these are the rules I used for Prosper202.

server {
        server_name example.com www.example.com;

	access_log   /var/log/nginx/example.com.access.log;
	error_log    /var/log/nginx/example.com.error.log;

        root /var/www/example.com/htdocs;
        index index.php index.html;

        location / {
                try_files $uri $uri/ /index.php?$args; 
        }

        location ~ .php$ {
                include fastcgi_params;
                fastcgi_pass unix:/var/run/php5-fpm.sock;
        }
}

Hitting Ctrl+X will close the file and save changes. Now we’ll link it to site-enabled folder.

sudo ln -s /etc/nginx/sites-available/example.com /etc/nginx/sites-enabled/

Now reload Nginx configurations,

sudo service nginx reload

That’s it. Server is now fully configured to host your landing page. Last step is to upload your landing page to VPS. Unzip the package if it’s zipped and upload everything to /var/www/example.com/htdocs/ directory. You can use FileZilla. More information on connecting to VPS with FileZilla can be found here.

Since we’re using server root to upload files, we should manually give file ownership to Nginx or you’ll experience some 401 forbidden errors. Following command will take care of that. Remember to execute it every time you upload or edit files to server.

sudo chown -R www-data:www-data /var/www/example.com/

You must do this for each new domain or sub-domain you want to add. Your landing page will be up and running once you’ve updated your domain’s DNS to point to your VPS IP address.

Tharindu

Hey!! I'm Tharindu. I'm from Sri Lanka. I'm a part time freelancer and this is my blog where I write about everything I think might be useful to readers. If you read a tutorial here and want to hire me, contact me here.

Related Articles

One Comment

Leave a Reply

Your email address will not be published.

Back to top button

We use cookies to give you the best online experience. By agreeing you accept the use of cookies in accordance with our cookie policy.