Starting a Review Website on A Subdomain Tutorial

Adding The Subdomain DNS Record

You may need to contact your domain provider, but most will allow you to perform the following steps by logging in to your account. To set up the subdomain and point it to your hosting server requires that you add an A dns record with the host name set to “subdomain” and the IP address pointing to server.

Open Source Review Application Installation

For this tutorial we will be installing the OpenReviewScript from OpenReviewScrip.org.

We will be hosting the review site on the server set up in the previous tutorial, Amazon Cloud Server Setup with Nginx and Optimized WordPress.

Log into your server using ssh. Begin with the following command and continue on.

cd /

sudo wget http://openreviewscript.org/files/OpenReviewScript-v1.0.1.tar.gz

This will place the zipped file into your cloud server’s root. We will delete it soon.

Continue with the following commands after you download the open source software for building review sites with PHP and mySQL.

cd /var/www/

sudo mkdir subdomain.yourdomain.com

cd /

sudo cp -f OpenReviewScript-v1.0.1.tar.gz /var/www/subdomain.yourdomain.com

cd var/www/subdomain.yourdomain.com

sudo tar -zxvf OpenReviewScript-v1.0.1.tar.gz

We now have the Open Source Review Script files on our server. Next we are going to set up the virtual server for the subdomain.

We will start with the following command to enter the root of the server.

cd /

cd etc/nginx/sites-available

sudo vi subdomain.yourdomain.com

Add the following nginx server configuration code:


server {
        listen   80;


        root /var/www/subdomain.yourdomain.com;
        index index.php index.html index.htm;

        server_name subdomain.yourdomain.com;

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

        error_page 404 /404.html;

        error_page 500 502 503 504 /50x.html;
        location = /50x.html {
              root /usr/share/nginx/www;
        }

        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9$
        location ~ \.php$ {
                #fastcgi_pass 127.0.0.1:9000;
                # With php5-fpm:
                fastcgi_pass unix:/var/run/php5-fpm.sock;
                fastcgi_index index.php;
                include fastcgi_params;
                 }
        location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
                expires 1y;
                log_not_found off;
                 }
        location ~* \.(htm|html)$ {
                expires 1m;
                log_not_found off;
                 }

}

Now we configure the sym link between sites-available and sites-enabled. First this command.

cd /

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

sudo service nginx restart

Check your Review Site

Visit http://subdomain.yourdomain.com to see your subdomain in action. You may see errors involving permissions settings. Set the permissions and refresh the page until errors are gone.

You may also need to install php postfix.

You will use a command such as:

sudo apt-get install postfix

/etc/init.d/postfix restart

Create Review Site Database

In the command line on terminal start with the following command.

cd /

sudo mysql –user=rdsinstanceusername –password=rdsinstancepassword –host=rdsinstance.endpoint.us-west-2.rds.amazonaws.com

Make sure you are connected to mySQL by ensuring the command line shows mysql> then issue the command:

CREATE DATABASE newdbname;

CREATE USER ‘newdatabaseuser’@’rdsinstance.endpoint.us-west-2.rds.amazonaws.com’ IDENTIFIED BY ‘newdatabasepassword’;

GRANT ALL PRIVILEGES ON newdbname.* TO ‘newdatabaseuser’@’rdsinstance.endpoint.us-west-2.rds.amazonaws.com’;

You are now almost ready!

Finish installing the Open Source Reviews application

Return you the browser of choice and visit your site. Using the details for your new database, finish the installation and begin using your new reviews website!

To see an example check out:

Websites Cloud Host Reviews!

Comments are closed.