Tuesday 3 March 2015

HOW TO HOST YOUR WEBSITE ON LINUX

Alright here is the method, on how to host your website on Linux server (vps). Since these days you can see hosting a website is costly so for this you can host your website on Linux server at low cost and with better brand width where it can hold a lot of traffic than shared hosting.


So here is a video that we have made for you on hosting a website on Linux server without cPanel

https://www.youtube.com/watch?v=xlKLL-8V_LM

I have used Debain (wheezy 7.0), nginx, php5 and mysql. Now follow the instructions as given on your Linux server if you have any doubts then play the above video if still your have doubts then comment below :)
Enter the following commands in the give order
  • apt-get update
  • apt-get upgrade
  • apt-get install nginx php5-fpm mysql-server
  • cd /var/www/
  • mkdir 8bits.tv(replace 8bits.tv with your website name)
  • cd 8bits.tv
  • wget http://www.wordpress.org/latest.tar.gz
  • tar vxzf latest.tar.gz
  • rm latest.tar.gz
  • cd
  • mysql -u root -p (press enter and then it will ask you to enter the password for mysql which you used when you install mysql-server)
  • create database 8bit; (replace 8bit with your own name)
  • grant select, delete, create, alter, update, drop, insert, index on 8bit.* to ‘bit’@’localhost’ identified by ‘Enteranypasswordwhichyouwanthere'; (Once done press enter and then ctrl + c to exit)
  • cd /var/www/8bits.tv/wordpress
  • cp wp-config-smaple.php wp-config.php
  • vim wp-config.php (after opening the file change your database details and save it)
  • cd /etc/nginx/sites-available/
  • vim 8bits.tv.vhost (rename 8bits.tv with your website name)
NOW ENTER THIS CODE IN 8bits.tv.vhost AND YOU NEED TO REPLACE 8bits.tv FOLDER WITH YOUR FOLDER AND sevrer_name
server {
listen 80;
root /var/www/8bits.tv/wordpress;
index index.php index.html index.htm;

server_name 8bits.tv www.8bits.tv;
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;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
}
ONCE DONE SAVE IT AND ENTER THIS FOLLOWING CODE
  • cd ..
  • cd sites-enabled/
  • ln -s /etc/nginx/sites-avialable/8bits.tv.vhost
  • service nginx restart




No comments:

Post a Comment