We know that most of the web servers for open source languages run on linux. So in order to get the feel of developing in server even in local machine is very important for a new developer. But installing linux server directly on personal machines may be difficult, since full stack developers need access to designing tools available on Windows. This post guides you to setup a personalized server.
- Download Virtual box (Open source) for your windows machine.
- Download ubuntu server (Note: Don’t use ubuntu desktop), because Ubuntu server will not have GUI and will give a good feel of using a server.
Installing Ubuntu Server on Virtual Box:
- Create a new Virtual Machine, select Ubuntu from the dropdown.
- Allocate atleast 30GB of disk space.
- Allocate 1GB of RAM space
- Start the Virtual Machine, and it asks for boot device, select the ISO
- Select install ‘Ubuntu Server’
- Then follow the instructions for selecting keyboard, encryption of drive etc.,
- When it asks for installing other tools, select ‘DNS server’, ‘LAMP server'(if you want PHP), ‘Open SSH’ (Must select for doing an SSH), ‘Samba Server’ (Must select for mounting drive on windows machine).
- Setup users, root password with the instructions on the screen.
- Now your Ubuntu Server is ready
Mounting a drive from Ubuntu Server to Windows:
- Login into your Ubuntu Server
$ sudo nano /etc/samba/smb.conf
- Change the Workgroup to your workgroup as per your windows machine (To see workgroup in windows Goto Explorer -> right click and select properties -> There you can seee WORKGROUP). Put the same name here else you cannot see the server as part of your workgroup
- Then save and exit file.
- Now create a user for samba
smbpasswd -a mohithg
- Give it a password.
- Next create a directory if you want to share that particular directory alone
- Again, go to the smb.conf file , and add below text in the Share Definitions (below Printers)
comment = Shared
browseable = yes
path = /home/mohithg
read only = no
guest ok = yes
writeable = yes
- You can change the path to your home directory or you home directory
- If you want a password protection for your shared drive then use
guest ok = no
- Restart your server
Mounting the Shared drive on Windows
- You can goto run (Windows Key + r) and type \\HOSTNAME and see your shared server
- The host name is the one that you gave when installing your ubuntu server
- You can goto explorer and click on Network
- There you can see your server with the hostname, double click on it to open and you can see your shared files.
SSH into Ubuntu Server
- Download putty
- Give the ip-address of your ubuntu server
- Enter your username, password and connect
- You should be able to access your server
By this you can keep all your development on server, and you will get a good feel of using server and developing things as you learn. Happy Coding!!!