際際滷

際際滷Share a Scribd company logo
Ubuntu VPS setup
MULTI WEBSITE HOSTING AND DNS CONFIGURATION
1
Agenda:
1. Create nameserver from domain registrar website.
2. Create dns server and setup the configuration on VPS.
3. Install LAMP (Apache, Mysql-server, php) and install wordpress.
4. Virtaul hosting or multi website hosting configuration for apache.
5. Multiple dns zone configuration for multi website.
6. Securing VPS with fail2 ban and ufw firewall.
2
Prerequisite:
1. Domain name from a domain registrar e.g. godady, crezydomain.
2. Ubuntu VPS server with full root access.
3. Putty software to ssh your vps or if using Ubuntu laptop then terminal session will be enough.
4. Winscp software for file transfer.
3
LAB Setup:
1. VPS with Ubuntu 14.04 LTS 64 bit install
2. Domain name registered with crazy domain- mevijay.in
3. VPS IP 158.85.163.103
4. Nameserver used ns1.mevijay.in , ns2.mevijay.in
5. Host two website (1.) mevijay.in (2.) mydomain.com
4
VPS setup:-
Apache installation:-
# apt-get install apache2
Mysql-server installation:-
# apt-get install mysql-server (provide mysql root password when asked)
Php installation:-
# apt-get install php5 php5-mysql php5-curl php5-gd php5-mcrypt
Enabling mode wrerite :-
# vim /etc/apache2/sites-available/000-default.conf
add bellow lines
DocumentRoot /var/www/html
<Directory /var/www/html>
Allowoverride All
</Directory>
# a2enmod rewrite
# service apache2 restart
5
DNS server Setup:-
Installing dns server:-
#apt-get install bind9
Creating zone file:-
# mkdir /etc/bind/zone
# cp /etc/bind/db.local /etc/bind/zone/mevijay.in
# vim /etc/bind/zone/mevijay.in
6
# vim /etc/bind/named.conf.default-zones
remove everythingother then screenshot with your domain master zone configuration and
db file name
# service bind9 restart
7
Phpmyadmin installation:
# apt-get install phpmyadmin
give mysql root password 3 times while asking
Phpmyadmin is reachable on http://mevijay.in/phpmyadmin
8
Virtual host :-
To host another website first set server name and alias of current website or domain.
# vim /etc/apache2/sites-available/000-default.conf
9
Virtually host a new website requires bellow steps:
1. New virtualhost configuration file for apache .
2. New document root directory.
3. New dns zone configuration
10
New Virtualhost in apache:-
# mkdir /var/www/mydomain
# cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-
available/mydomain.conf
# vim /etc/apache2/sites-available/mydomain.conf
Make changes now everywhere as per new website i.e. change mevijay.in to mydomain.com
Save the file
# a2ensite mydomain.conf ( this command will create a link file of /etc/apache2/sites-
available/mydomain.conf into /etc/apache2/sites-enabled/mydomain.conf. Without using the
command you can create a link file by using ln s command)
# service apache2 restart or service apache2 reload
11
New Dns zone for new website:-
Please note that once you got a name server setup i.e ns1.mevijay.in and ns2.mevijay.in for my case, you do not need to
setup new name server for each domain. Just enter name server address ( ns1.mevijay.in and ns2.mevijay.in in my case) for all
other domain ( into their domain control panel)
Considering above scenario I have new domain i.e. mydomain.com and I am going to create a new zone for this.
# cp /etc/bind/zone/mevijay.in /etc/bind/zone/mydomain.com
# vim /etc/apache2/sites-available/mydomain.conf
12
# vim /etc/bind/named.conf.default-zones
Now copy lines having mevijay.in zone entry to bellow and make changes for new domain.
As per bellow screen.
13
Save the file now and restart the service
# service bind9 restart
14
Thank you !
MAIL:SHARMAVIJAY86@GMAIL.COM
WEB: MEVIJAY.IN
15

More Related Content

What's hot (20)

DOCX
Linux test paper2
Ganesh Bhosale
PPTX
Samba power point presentation
Md Maksudur Rahman
PPTX
Rhel4
Yash Gulati
PDF
DNS (BIND) on CentOS
Md Tanjil Islam Bappi
PPT
Dns
muh kemal
PDF
2. reverse primarydns using bind for ptr and cname record ipv4
Piyush Kumar
PPT
Presentation on samba server & apache server
Manoz Kumar
PDF
Tutorial CentOS 5 untuk Webhosting
Beni Krisbiantoro
DOCX
Dns centos
Bung Densol
PPT
Samba server
Santosh Khadsare
PPTX
Linux Addministration
PandeyABHISHEK1
PPT
Anandha ganesh linux1.ppt
anandha ganesh
PDF
Network File System (NFS)
abdullah roomi
PPT
Samba
tmavroidis
PPT
Apache1.ppt
webhostingguy
PDF
Membangun web server,_e-mail_server_dan_ftp_server
Iwan Kurniarasa
PPTX
Samba
Raghu nath
PDF
Basic linux commands
Raghav Arora
PDF
3 technical-dns-workshop-day2
DNS Entrepreneurship Center
ODP
Tinydns and dnscache
Yonit Gruber-Hazani
Linux test paper2
Ganesh Bhosale
Samba power point presentation
Md Maksudur Rahman
Rhel4
Yash Gulati
DNS (BIND) on CentOS
Md Tanjil Islam Bappi
Dns
muh kemal
2. reverse primarydns using bind for ptr and cname record ipv4
Piyush Kumar
Presentation on samba server & apache server
Manoz Kumar
Tutorial CentOS 5 untuk Webhosting
Beni Krisbiantoro
Dns centos
Bung Densol
Samba server
Santosh Khadsare
Linux Addministration
PandeyABHISHEK1
Anandha ganesh linux1.ppt
anandha ganesh
Network File System (NFS)
abdullah roomi
Samba
tmavroidis
Apache1.ppt
webhostingguy
Membangun web server,_e-mail_server_dan_ftp_server
Iwan Kurniarasa
Samba
Raghu nath
Basic linux commands
Raghav Arora
3 technical-dns-workshop-day2
DNS Entrepreneurship Center
Tinydns and dnscache
Yonit Gruber-Hazani

Similar to Ubuntu vps setup (20)

DOCX
Installing lemp with ssl and varnish on Debian 9
惺愀悋悄悋惺 悋惓 愆悽
PDF
Drupal camp South Florida 2011 - Introduction to the Aegir hosting platform
Hector Iribarne
PDF
Apache
rsibbaluca
PDF
Apache
rsibbaluca
PDF
Apache
rsibbaluca
DOC
Modul quick debserver
Slamet Achwandy
PDF
How to Set Up Nginx Server Blocks on Ubuntu 2404.pdf
Green Webpage
PPTX
How to Get Started with VPS Hosting.pptx
Big Bird Web
PPTX
2-Setting Up Servers of apache and kali linux.pptx
SaieJadhav1
PDF
SFScon 22 - Dashamir Hoxha - Manage your own DNS.pdf
South Tyrol Free Software Conference
PPT
Install and configure linux
Vicent Selfa
PPTX
Google cloud essential skills challenge lab
Mahmmoud Mahdi
PDF
VMWare VSphere4 Documentation Notes
Grit Suwa
PPTX
Drupal from scratch
Rovic Honrado
PPTX
Dockerizing WordPress
dotCloud
PPT
Apache1.ppt
webhostingguy
PDF
Automation with ansible
Khizer Naeem
PDF
Wordpress y Docker, de desarrollo a produccion
Sysdig
PPT
How To Deploy A Cloud Based Webserver in 5 minutes - LAMP
Matt Dunlap
PDF
Create Development and Production Environments with Vagrant
Brian Hogan
Installing lemp with ssl and varnish on Debian 9
惺愀悋悄悋惺 悋惓 愆悽
Drupal camp South Florida 2011 - Introduction to the Aegir hosting platform
Hector Iribarne
Apache
rsibbaluca
Apache
rsibbaluca
Apache
rsibbaluca
Modul quick debserver
Slamet Achwandy
How to Set Up Nginx Server Blocks on Ubuntu 2404.pdf
Green Webpage
How to Get Started with VPS Hosting.pptx
Big Bird Web
2-Setting Up Servers of apache and kali linux.pptx
SaieJadhav1
SFScon 22 - Dashamir Hoxha - Manage your own DNS.pdf
South Tyrol Free Software Conference
Install and configure linux
Vicent Selfa
Google cloud essential skills challenge lab
Mahmmoud Mahdi
VMWare VSphere4 Documentation Notes
Grit Suwa
Drupal from scratch
Rovic Honrado
Dockerizing WordPress
dotCloud
Apache1.ppt
webhostingguy
Automation with ansible
Khizer Naeem
Wordpress y Docker, de desarrollo a produccion
Sysdig
How To Deploy A Cloud Based Webserver in 5 minutes - LAMP
Matt Dunlap
Create Development and Production Environments with Vagrant
Brian Hogan
Ad

Recently uploaded (20)

PPTX
ENGLISH -PPT- Week1 Quarter1 -day-1.pptx
garcialhavz
PPTX
How to Add New Item in CogMenu in Odoo 18
Celine George
PPTX
Iv叩n Bornacelly - Presentation of the report - Empowering the workforce in th...
EduSkills OECD
PDF
DIGESTION OF CARBOHYDRATES ,PROTEINS AND LIPIDS
raviralanaresh2
PDF
Rapid Mathematics Assessment Score sheet for all Grade levels
DessaCletSantos
PDF
Supply Chain Security A Comprehensive Approach 1st Edition Arthur G. Arway
rxgnika452
PPTX
Project 4 PART 1 AI Assistant Vocational Education
barmanjit380
PDF
Wikinomics How Mass Collaboration Changes Everything Don Tapscott
wcsqyzf5909
DOCX
MUSIC AND ARTS 5 DLL MATATAG LESSON EXEMPLAR QUARTER 1_Q1_W1.docx
DianaValiente5
PPTX
Martyrs of Ireland - who kept the faith of St. Patrick.pptx
Martin M Flynn
PPTX
Urban Hierarchy and Service Provisions.pptx
Islamic University of Bangladesh
PDF
COM and NET Component Services 1st Edition Juval L旦wy
kboqcyuw976
PDF
VCE Literature Section A Exam Response Guide
jpinnuck
PDF
Public Health For The 21st Century 1st Edition Judy Orme Jane Powell
trjnesjnqg7801
PPTX
A Case of Identity A Sociological Approach Fix.pptx
Ismail868386
PDF
CAD25 Gbadago and Fafa Presentation Revised-Aston Business School, UK.pdf
Kweku Zurek
PPTX
Comparing Translational and Rotational Motion.pptx
AngeliqueTolentinoDe
PPTX
How to Configure Refusal of Applicants in Odoo 18 Recruitment
Celine George
PPTX
Peer Teaching Observations During School Internship
AjayaMohanty7
PDF
Andreas Schleicher_Teaching Compass_Education 2040.pdf
EduSkills OECD
ENGLISH -PPT- Week1 Quarter1 -day-1.pptx
garcialhavz
How to Add New Item in CogMenu in Odoo 18
Celine George
Iv叩n Bornacelly - Presentation of the report - Empowering the workforce in th...
EduSkills OECD
DIGESTION OF CARBOHYDRATES ,PROTEINS AND LIPIDS
raviralanaresh2
Rapid Mathematics Assessment Score sheet for all Grade levels
DessaCletSantos
Supply Chain Security A Comprehensive Approach 1st Edition Arthur G. Arway
rxgnika452
Project 4 PART 1 AI Assistant Vocational Education
barmanjit380
Wikinomics How Mass Collaboration Changes Everything Don Tapscott
wcsqyzf5909
MUSIC AND ARTS 5 DLL MATATAG LESSON EXEMPLAR QUARTER 1_Q1_W1.docx
DianaValiente5
Martyrs of Ireland - who kept the faith of St. Patrick.pptx
Martin M Flynn
Urban Hierarchy and Service Provisions.pptx
Islamic University of Bangladesh
COM and NET Component Services 1st Edition Juval L旦wy
kboqcyuw976
VCE Literature Section A Exam Response Guide
jpinnuck
Public Health For The 21st Century 1st Edition Judy Orme Jane Powell
trjnesjnqg7801
A Case of Identity A Sociological Approach Fix.pptx
Ismail868386
CAD25 Gbadago and Fafa Presentation Revised-Aston Business School, UK.pdf
Kweku Zurek
Comparing Translational and Rotational Motion.pptx
AngeliqueTolentinoDe
How to Configure Refusal of Applicants in Odoo 18 Recruitment
Celine George
Peer Teaching Observations During School Internship
AjayaMohanty7
Andreas Schleicher_Teaching Compass_Education 2040.pdf
EduSkills OECD
Ad

Ubuntu vps setup

  • 1. Ubuntu VPS setup MULTI WEBSITE HOSTING AND DNS CONFIGURATION 1
  • 2. Agenda: 1. Create nameserver from domain registrar website. 2. Create dns server and setup the configuration on VPS. 3. Install LAMP (Apache, Mysql-server, php) and install wordpress. 4. Virtaul hosting or multi website hosting configuration for apache. 5. Multiple dns zone configuration for multi website. 6. Securing VPS with fail2 ban and ufw firewall. 2
  • 3. Prerequisite: 1. Domain name from a domain registrar e.g. godady, crezydomain. 2. Ubuntu VPS server with full root access. 3. Putty software to ssh your vps or if using Ubuntu laptop then terminal session will be enough. 4. Winscp software for file transfer. 3
  • 4. LAB Setup: 1. VPS with Ubuntu 14.04 LTS 64 bit install 2. Domain name registered with crazy domain- mevijay.in 3. VPS IP 158.85.163.103 4. Nameserver used ns1.mevijay.in , ns2.mevijay.in 5. Host two website (1.) mevijay.in (2.) mydomain.com 4
  • 5. VPS setup:- Apache installation:- # apt-get install apache2 Mysql-server installation:- # apt-get install mysql-server (provide mysql root password when asked) Php installation:- # apt-get install php5 php5-mysql php5-curl php5-gd php5-mcrypt Enabling mode wrerite :- # vim /etc/apache2/sites-available/000-default.conf add bellow lines DocumentRoot /var/www/html <Directory /var/www/html> Allowoverride All </Directory> # a2enmod rewrite # service apache2 restart 5
  • 6. DNS server Setup:- Installing dns server:- #apt-get install bind9 Creating zone file:- # mkdir /etc/bind/zone # cp /etc/bind/db.local /etc/bind/zone/mevijay.in # vim /etc/bind/zone/mevijay.in 6
  • 7. # vim /etc/bind/named.conf.default-zones remove everythingother then screenshot with your domain master zone configuration and db file name # service bind9 restart 7
  • 8. Phpmyadmin installation: # apt-get install phpmyadmin give mysql root password 3 times while asking Phpmyadmin is reachable on http://mevijay.in/phpmyadmin 8
  • 9. Virtual host :- To host another website first set server name and alias of current website or domain. # vim /etc/apache2/sites-available/000-default.conf 9
  • 10. Virtually host a new website requires bellow steps: 1. New virtualhost configuration file for apache . 2. New document root directory. 3. New dns zone configuration 10
  • 11. New Virtualhost in apache:- # mkdir /var/www/mydomain # cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites- available/mydomain.conf # vim /etc/apache2/sites-available/mydomain.conf Make changes now everywhere as per new website i.e. change mevijay.in to mydomain.com Save the file # a2ensite mydomain.conf ( this command will create a link file of /etc/apache2/sites- available/mydomain.conf into /etc/apache2/sites-enabled/mydomain.conf. Without using the command you can create a link file by using ln s command) # service apache2 restart or service apache2 reload 11
  • 12. New Dns zone for new website:- Please note that once you got a name server setup i.e ns1.mevijay.in and ns2.mevijay.in for my case, you do not need to setup new name server for each domain. Just enter name server address ( ns1.mevijay.in and ns2.mevijay.in in my case) for all other domain ( into their domain control panel) Considering above scenario I have new domain i.e. mydomain.com and I am going to create a new zone for this. # cp /etc/bind/zone/mevijay.in /etc/bind/zone/mydomain.com # vim /etc/apache2/sites-available/mydomain.conf 12
  • 13. # vim /etc/bind/named.conf.default-zones Now copy lines having mevijay.in zone entry to bellow and make changes for new domain. As per bellow screen. 13
  • 14. Save the file now and restart the service # service bind9 restart 14