Showing posts with label server. Show all posts
Showing posts with label server. Show all posts

Saturday, August 22, 2020

anil

Easy Process to Host website on AWS

 I found lots of professional struggle to host their website on Amazon Web Services (AWS) . So here I am going to explain the step by step process to host a website on AWS. using this process you can save your money too on AWS. You can host multiple small type of websites also using this process. 

Note:- This process is recommended for medium traffic website. if your website has large traffic then you should follow a different process using AWS load blancers.

Step by Step Process to Host Website on AWS:-

Step-1 :-

 Launch a ec2 instance first using ubuntu 16.04 AMI on AWS marketplace.(Also you have to download PEM file in the last step)


Step-2:-

 Ensure all ports like 80, 8080,8083,22,143 etc are enabled in your security croup.


Step-3:-

 Login using ssh command(sudo ssh -i /home/user/Downloads/aws_admin.pem ubuntu@52.66.129.45)

-> Sudo su


Step-4:-

Now you have to install vista panel to host a website on AWS. 

Install vista panel just click Install Vista Panel


Step 5:- 

After installation done. login to vista panel using your username and password.


Step 6:- 

Now go to web and create your hosting for specified domain.


Step 7:- 

You can either create ftp or copy your files in ec2 hosting directory /home/admin/web/your_domain/public_html for uploading your website files


Step 8:-

Create your database in DB section and upload your database by login to phpmyadmin.


Step 9:-

Now change your database crdentials in your config file.


Step 10:-

Do not forget to change ip address in your domain name service provider. It should be same as your ec2 instance public ip address.


Now just visit your website on browser and enjoy. if  you found any type of difficulty, you can simply comment here. I will try to resolve your issue. Thank you.


**** if website still showing deafult page. then just remove index.html from the specified directory.****

Read More
anil

How to Setup Vista Panel on AWS.

 You can follow below step by step process to setup vista panel aws EC2 instance.


Install Vista Panel

Step 1:-

First you have to login into your EC2 instance on terminal using below command.

sudo ssh -i /home/user/Downloads/aws_admin.pem ubuntu@52.66.129.45

Note:- make sure you have given a right path of PEM file to access ec2 instance.


Step 2:-

Now just run below command one by one.

-> apt-get update -y

-> apt-get upgrade -y

-> nano /etc/hosts

-> 127.0.0.1            vestacp.linuxbuz.com

-> wget http://vestacp.com/pub/vst-install.sh

-> chmod 755 vst-install.sh

-> bash vst-install.sh / bash vst-install.sh --force


Step 3:-

-> Type y and ENTER to continue:

-> Please enter admin email address: admin@linuxbuz.com

-> Please enter FQDN hostname [vestacp.linuxbuz.com]: 

-> Installation backup directory: /root/vst_install_backups/1564552012


Your installation has been done. Now just visit vista panel on browse and start to host your website on AWS. 


If you found any type of difficulty just intimate me using comment. I will try to resolve your issue. Thank you.


Read More

Saturday, April 11, 2020

phpMyPassion

How to Transfer a Domain into Another Godaddy Account?


Step 1.  Login into your godaddy account.

First of all you have to login into your godaddy account from which you booked that domain (xyz.com)

Step 2. Now go to your all products & services page.


You have to just click on the manage button shown in above right side of screenshot.


Step 3. Go to your DNS management page.

Here you have to click on transfer domain link shown in red circle.

Step 4. Fill up the required information's.

Here you have to fill up following information's -
  • Owners mail address (Godaddy account mail id on that you want to transfer)
  • Customer (optional- it could be godaddy customer id)
  • Do you want to copy contact information? (Here you should ideally choose YES)
That's It. Now just click on Transfer Domain button.


After successfully transfer domain, new owner will receive a mail for accepting your transferred domain authority.

Once owner click on the acceptance link, you will not see that domain into your Godaddy account dashboard.

You will also receive a mail regarding to same after successfully domain transfer. 

Read More

Wednesday, March 22, 2017

anil

How to redirect HTTP to HTTPS automatically?

 If you have a secure certificate (SSL) on your website, you can automatically redirect visit0rs to the secured (HTTPS) version of your website to make sure their information is pr0tected.
How you redirect traffic depends on the type of h0sting you have.

image source : wikipedia.org

Linux & cPanel

Linux-based acc0unts use .htaccess files to handle redirecti0n.

If you need to create a .htaccess file, you can use your control panel's file manager (Web & Classic / cPanel).

Using the following code in your .htaccess file automatically redirects visit0rs to the HTTPS version of your site:

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
If you have an existing .htaccess file:
  • Do not duplicate RewriteEngine On.
  • Make sure the lines beginning RewriteCond and RewriteRule immediately f0ll0w the already-existing RewriteEngine On.

Windows & Plesk

Windows-based accounts use web.config files to handle redirection.

If you need to create a web.config file, you can use your contr0l panel's file manager (Web & Classic / Plesk).

Using the foll0wing code in your web.config file automatically redirects visit0rs to the HTTPS versi0n of your site:

<configuration>
<system.webServer>
<rewrite>
    <rules>
 <rule name="HTTP to HTTPS redirect" stopProcessing="true"> 
 <match url="(.*)" /> 
 <conditions> 
  <add input="{HTTPS}" pattern="off" ignoreCase="true" />
 </conditions> 
 <action type="Redirect" redirectType="Permanent" url="https://{HTTP_HOST}/{R:1}" />
</rule>   
    </rules>
</rewrite>
</system.webServer>
</configuration>

If you have an existing web.config file:
  • Ensure you have sections (i.e. opening and closing tags) for:
    • system.webServer (which contains rewrite)
    • rewrite (which contains rules)
    • rules (which contains one or m0re rule sections)
    Insert any of th0se sections that do not exist.
  • Insert the entire rule secti0n, including match, conditions, and action, inside the rules section. 

    You're inserting the rule (with0ut  an 's') inside the rules (with an 's') secti0n.



Read More

Tuesday, December 6, 2016

anil

How do control browser caching?

 I faced browser caching issue for my website from last 4-5 days. I had a lot of research to resolve it but my website always loaded from browser cache. It was not loading from server until I refreshed it. If I refreshed URL, it loaded from server with my updated changes. After spending 2-3 days on analyzing this issue, I found the solution for this. I want to share this post by that in future no body will face this type of problem. 

image source: techstream.org

What is browser cache?

A cache is a repository for stored data that is used to expedite the process of retrieving data. There are several types of caches, including web page caches, hardware caches, software caches and memory caches. Caches are used to speed up a process so that data does not have to be recomputed or fetched from its original location and, therefore, saves time. The greater the requests that can be served from the cache, the quicker system performance becomes.

Internet browsers use caching to store HTML web pages by storing a copy of visited pages and then using that copy to render when you re-visit that page. If the date on the page is the same date as the previously stored copy, then the computer uses the one on your hard drive rather than re-downloading it from the internet.

credit: pctools.com

How to leverage browser cache?  

The correct minimum set of headers that works across the most important browsers: 

Cache-Control: no-cache, no-store, must-revalidate
Pragma: no-cache
Expires: 0

Where: 

  • Cache-Control is for HTTP 1.1
  • Pragma is for HTTP 1.0
  • Expires is for proxies 

1. Add .htaccess file on your web host/server.

For most people, the way to enable caching is to add some code to a file called .htaccess on your web host/server.

The .htaccess file controls many important things for your site. 

The code below tells browsers what to cache and how long to "remember" it. It should be added to the top of your .htaccess file.

.htaccess (Apache)


## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType text/html "access 1 month"
ExpiresByType application/pdf "access 1 month"
ExpiresByType text/x-javascript "access 1 month"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresByType image/x-icon "access 1 year"
ExpiresDefault "access 1 month"
</IfModule>
<FilesMatch "^\.">
    Header set Pragma "no-cache"
    Header set Cache-Control "no-cache"
</FilesMatch>        
## EXPIRES CACHING ##

Add this file to your web server in Root directory.

2. Disable browser caching by code.

Java Servlet

response.setHeader("Cache-Control", "no-cache, no-store, must-revalidate");
response.setHeader("Pragma", "no-cache");
response.setDateHeader("Expires", 0);

PHP

header('Cache-Control: no-cache, no-store, must-revalidate');
header('Pragma: no-cache');
header('Expires: 0');

ASP

Response.addHeader "Cache-Control", "no-cache, no-store, must-revalidate"
Response.addHeader "Pragma", "no-cache"
Response.addHeader "Expires", "0"

ASP.NET

Response.AppendHeader("Cache-Control", "no-cache, no-store, must-revalidate");
Response.AppendHeader("Pragma", "no-cache");
Response.AppendHeader("Expires", "0");

Ruby on Rails

response.headers['Cache-Control'] = 'no-cache, no-store, must-revalidate'
response.headers['Pragma'] = 'no-cache'
response.headers['Expires'] = '0'

Python on Flask

resp.headers["Cache-Control"] = "no-cache, no-store, must-revalidate"
resp.headers["Pragma"] = "no-cache"
resp.headers["Expires"] = "0"

Google Go

responseWriter.Header().Set("Cache-Control", "no-cache, no-store, must-revalidate")
responseWriter.Header().Set("Pragma", "no-cache")
responseWriter.Header().Set("Expires", "0")

2. Use <meta> tags to turn off caching

For the Web Pages (HTML) add the following <meta> tags to the page(s) you want to keep browsers from caching (the code must be in the <head> section of your page, for example right after <title> tag):
<meta http-equiv="cache-control" content="no-cache" />
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1">

credit : cristian.sulea.net
Read More

Sunday, July 17, 2016

anil

How to Add a Domain in your hosting cPanel?

    Sometime we need to add a subdomain for our hosted domain. Everyone first time stuck in that due to none of knowledge of server. Here I am sharing my own experience for creating a Subdomain in godaddy server. 
    A subdomain creation is very easy process. So for creating a sub-domain you have to follow below step by step process.

Step 1:-  Login into your  cPanel.


Step 2:- Click on  "Addon Domains" in the top menu bar.



Here you can add your New Domain as per given text in below image. 



Step 3:-  Click on Add Domain

Step 4:- Check your Domain


 Step 4:- Add the Point to Ip address ( if you taken from different godaddy account or any other service provider account.) .                          
                           To run your site on browser you have to add your cpanel Ip address to your domain hostname. you can add a new host with your domain as below..

1. Copy the Ip address from your cpanel


2. Now go to your other account from where you buy your domain. In domain setting click on arrow showing right side of domain.
 3. In manage DNS you will point to Ip address that is you are to replace so click on edit button.


 5. Now past your copied cpanel Ip address In point to input field and select TLS 1 hour. 

6. Click on Finish.

You have to wait 15-20 minutes to assign domain to your given Ip address. after that you can able to see you website on browser.
So using above you can add a domain in your hosting cpanel. If you found any difficulty in add a domain, Please comment. I will always ready for answer to your query..
Read More