.
Showing posts with label ubuntu. Show all posts
Showing posts with label ubuntu. Show all posts

Setting Up A Linux File Server Using Samba

 Setting Up A Linux File Server Using Samba

 
Setting Up A Linux File Server Using Samba 
Setting Up A Linux File Server Using Samba

 

Step1

Download Ubuntu Server and create the boot CD, then download the corresponding Ubuntu Server Guide from https://help.ubuntu.com/. I  will be referring to this guide a lot so print it off or keep it open on another PC.

** It is important you use the guide written for your version of Ubuntu  Server as some commands change between versions (this was one of the issues I had with other tutorials). This may also cause problems if you upgrade to a new version of Ubuntu so I suggest you use the most recent LTS (long term support) version and stick to it.

Boot off the CD and follow installation instructions. I selected Guided - Use entire Disk. I did not select LVM as I had issues retrieving data from an earlier attempt, where I screwed up the interfaces file and it wouldn't boot (yes I know you can mount LVM from a Live Disk but I can't be bothered with the hassle) this is a simple home server so I like to keep everything as simple as possible.

Give your server a name, create a user and set a sensible password. (this will also be your admin password so it should include capitals and symbols or numbers), I'll explain more about this later.
**** NB When creating the user make it something like serveradmin. Do not make this username the same as your Windows username. If you do it may cause issues later.****

Select Samba and SSH during the installation procedure by moving up and down with the arrow keys and pressing the space bar. Use the Tab key to skip to the next or back buttons. Now continue with the installation and in a few minutes you will be presented with the Ubuntu Server login screen. If at this stage you were expecting a graphical user interface with shiny buttons and a mouse then you will be disappointed. This can be installed if you really wish but that defeats the purpose of using the server edition of Ubuntu. On this version of Ubuntu you will have to get your hands dirty on the keyboard.

Step 2

Login with your user name and password.
Install updates :-
sudo apt-get update
This just ensures everything is up to date.
You should be prompted for a password. Use the one you created earlier.

Step 3

In the Ubuntu Server Guide you downloaded earlier look for the chapter on Windows Networking and follow the instructions for Samba File Server.

NB You shouldn't need to run the install command for Samba as it was installed earlier but if you have run it and are being asked which version of smb.conf you want, I suggest you keep the one already installed. This is especially true if you have already made changes to it.

** Before you start editing the smb.conf file, copy it to something like smb.conf_backup. You will probably cock things up the first time you attempt this so it is nice to be able to get back to square one. :- 
 
sudo cp /etc/samba/smb.conf /etc/samba/smb.conf_backup
I use Nano for editing text files from the CLI (command line interface). I hate Vi with a passion, that may be cause I'm a bit thick, but I find Nano much easier to use. So your command to edit the smb.conf file will be :-
sudo nano /etc/samba/smb.conf
You need to be an admin user to save any changes when you're finished editing, hence the sudo in front of nano.

In Ubuntu any command which may change the server configuration needs to be carried out by the admin user. Since for security reasons you cannot login as root (the admin user) the alternative is to insert sudo before every command then provide the admin password, this keeps things nice and secure. Other Distros allow you to type su (for super user) then the password and this will give admin access until you logout.

Check the workgroup name in your Windows PC by right clicking on My Computer, select properties and Computer name. It will probably be WORKGROUP or MSHOME, depending on your version of XP. Sorry not sure how to find out in Vista or W7 but probably something similar.

Now follow the instructions carefully. Some of the commands are already in the smb.conf file but have a # symbol in front of them, removing the # symbol makes the command active.

To close Nano and save your changes press CTRL and X, type y and press enter. CTRL and O is shown as Write out which just means SAVE, if you want to save it as you go along.

NB. Pretty much everything in Linux is case sensitive, i.e. If you gave your folder names capitals when creating, them then you MUST use capitals when referring to them or moving around the file structure. Linux will see Music and music as two completely different folders.

Step 4

This bit may or may not be necessary, as far as I can see it depends on the version of Ubuntu Server and whether or not you installed Samba as part of the server installation. To connect from either a Linux or Windows PC you need to make one more small change. Look for the area in smb.conf marked Authentication, and just below the bit where you set security to user, change:-

encrypt passwords = false 
 
to

encrypt passwords = true
Save it, restart Samba by the method suggested for your version of Ubuntu Server (it seems to change between versions) or just reboot the server and you should done.

Step 5

Now to the bit nobody else mentions in their tutorials and I had to figure out for myself. How do I connect to the bugger?!!! I tried browsing "Network Connections" but that didn't work, possibly because at this point we haven't created Samba users to match our Windows users but anyhow we don't need to. Here is how I did it.

Note you experts out there may criticize my way of doing this but it's simple and it works so don't knock it.

If not sure of your server IP address just type ifconfig at the command prompt. This will give you a full breakdown of your network details.
From a Win XP Pro machine (sorry not sure it this is the same for other versions of Windows but it should be similar).

Open My Computer.
Click on Tools and Map network Drive.

In the window labeled Folder, enter the IP address of your server preceded by \\ and followed by \sharename (where sharename is the name of the share you created earlier).

e.g. :- \\192.168.1.4\Music or \\192.168.0.5\Photos

Press Finish and if everything has worked you should now see the network folder. You can create a shortcut to it for easy access in the future but Windows should remember the network drive name you just created.
To connect from a Linux PC:- (I am using Ubuntu 10.10, sorry not sure about other Distros but other versions of Ubuntu should be similar)

Click on Places and select Connect to Server.
Select Windows Share and type in the server IP address in the window labeled Server.
Enter the share name you created, put a tick in create bookmark (this just makes Ubuntu remember the path after logout or reboot) and click on connect. Do not enter any username or password, it shouldn't be necessary if you followed the guide earlier.

And that's it. Yippee you now have a working file server.

During installation you installed SSH and having SSH running on your server in default mode can be a security risk, so we want to sort that. We need to change the default port to a random number of your own choosing. To do this follow the instructions in the Ubuntu Server Guide under the chapter Remote Administration. The default port is 22 which many people don't bother changing so this is the one used by hackers and hacking software to try and gain access to your server. There are a few other options there but I haven't bothered with them.

Step 6

Unless you chose to give your server a static IP address during installation it will have a DHCP address assigned to it by your router. This would be fine so long as you never reboot your router or shutdown the server. Sooner or later though it will pick up a different IP address and you will be left disconnected, so we will give it a static one. Check the current IP address by typing

ifconfig
at the command prompt. You only want to change the last part so for example if it is 192.168.1.5 then change it to 192.168.1.101. You can set the last part to be any number between 2 and 254, mine is 101.
In the Ubuntu Server Guide open the chapter Networking – Network Configuration - IP addressing and select Static IP Address Assignment.
sudo nano /etc/network/interfaces
It should look something like

auto eth0
iface eth0 inet static
  address 192.168.1.101
  netmask 255.255.255.0 
  gateway 192.168.1.1
 
The gateway is normally the IP address of your router which is usually 192.168.1.1 or 192.168.0.1 but may be something completely different. If you ran
ipconfig
on your Windows PC it should have shown you the gateway address. If in doubt check your manual or Google the model of your router.
You might also want to check the IP address of your Windows PC, it should be similar to the server but it may previously have been set to a static address.

Run
cmd
from the Start button (or Start and Run in XP). Then type

ipconfig 
at the command prompt. This should show your IP address which will be something like 192.168.1.5 or 192.168.0.3. Whatever it is your PC and server should be in the same range of IP addresses (this just means the first three parts should be the same).

Step 7

Now that you've a working server you'll want to tuck it away somewhere, minus monitor, k/b and mouse of course (if your system board can boot without a k/b that is, it should be an option in the BIOS to ignore errors on boot). During the initial installation of Ubuntu Server you selected to install SSH. This is a protocol (program) which allows you to administer your server remotely from any PC (or even smart phone). If you didn't don't worry, just type:-

sudo apt-get install openssh-server
The easiest way to connect from another PC is to install Putty. A quick Google of Putty will have you up and running in a few seconds. When you launch Putty you will see it asking for a Host Name (or IP address). Just type in your server IP address and new port number, ensure SSH is selected, type a name into Saved sessions and click save, then click open. Say Yes to the security question and your connected. Now you can administer the server from your PC/laptop or even smart phone, how cool is that!

So there you have it. You've installed Ubuntu Server and configured it to let your Windows or Linux box connect to it. There are many more things your server can do for you, it can act as a Proxy server screening your network from the Internet and caching frequently used web sites, or as an email server, or a print server etc.

I'm no expert on Linux and I am sure there are other ways to achieve all this. Some of them may even be better but This method is tried and tested several times and if you follow the steps as shown it should work. If you have any suggestions for improving this tutorial then please let us all know .



Tags: Setting Up A Linux File Server Using Samba, Linux File Server, linux, server, linux samba, Linux File Server

Install and Configure Apache Traffic Server on Ubuntu Server 12.04

Apache Traffic server is a reverse proxy, cache proxy and forward proxy. Web proxy caching enables you to store copies of frequently accessed web objects and then serve this information to users on demand. It improves performance and frees up Internet bandwidth for other tasks.


appach

Installation


Installation of Apache Traffic Server is bit tricky on Ubuntu due to absence of standard apt-get easy installer package. Well but its not that difficult though. I am writing down step by step process for easy understandability.

Download latest tar.bz2 from apache website and put that on Ubuntu server any directory.

wget http://www.apache.org/dyn/closer.cgi/trafficserver/trafficserver-4.0.1.tar.bz2

tar xf trafficserver-4.0.1.tar.bz2

cd trafficserver-4.0.1

 sudo apt-get install g++ libssl-dev tcl-dev libexpat1-dev libpcre3-dev libcap-dev libcap2

 ./configure

 $ make

 $ sudo make install

Server level configuration

 

After successful installation, open ld.so.conf (sudo vi /etc/ld.so.conf) and add following line.
include /usr/local/libexec/trafficserver

Run the following command: 
sudo ldconfig

Steps for Start and stop


To start Traffic Server manually, issue the following command, passing in the attribute start. This command starts all the processes that work together to process Traffic Server requests as well as manage, control, and monitor the health of the Traffic Server system.

sudo service trafficserver start/stop

All the configuration parameter related to cache are located in /usr/local/etc/trafficserver/records.config file after making any configuration changes do run command traffic_line -x to apply the configuration changes.

Installation Directories


When we install traffic server, we had not provide the installation directories for config files and executable. These stuffs has been placed with default conventions.

All configurations files :

/usr/local/etc/trafficserver/

All executables :

/usr/local/libexec/trafficserver

Important Configuration Files & Usage

 

sudo vi /usr/local/etc/trafficserver/records.config

For changing default port as well as connection time out etc. related data.
Don't forget to execute following command in case of minor rule change:

sudo traffic_line -x

In case of severe change like port etc please make sure you had restarted the server:

sudo service trafficserver restart

For Configuring the mapping 

 

sudo vi /usr/local/etc/trafficserver/remap.config

In the above file, we can provide as many map, reverse map, redirect, reverse redirect configurations.

Apache Virtual Host Specific Configuration

 

Step 1:
sudo vi /usr/local/etc/trafficserver/records.config

In the file make following changes so config read like below
CONFIG proxy.config.reverse_proxy.enabled INT 1
CONFIG proxy.config.url_remap.pristine_host_hdr INT 1 (It make sure host name in http header doesn't change)
CONFIG proxy.configurl_remap.remap_required INT 1

Step 2:
sudo traffic_line -x

Step 3:
sudo vi /usr/local/etc/trafficserver/remap.config

Step 4:
sudo traffic_line -x
Above configuration is sufficient for setting the initial reverse proxy to listen on default port and serve the request based on domain name from provider (Apache)


Cache Configuration


CONFIG proxy.config.cache.ram_cache.size INT -1 (default value 1 MB per 1 GB Disk Space, alternatively you can set 20971520 (20 MB))

Monitoring Traffic & Log File


Log file location - var/log/trafficserver


source ; inuxsystemhacks.com

red more: 

 Configuration serveur apache

 
 

How to Set up a Network in Ubuntu

Configuring networks such as a Digital Subscriber Line (DSL) or Asynchronous Digital Subscriber Line (ADSL) primarily used for accessing the internet can be a hassle, especially when you aren't using the same operating system as what the directions were originally written for. This article is a starting point for configuring DSL using Ubuntu Linux.

Ad

Edit Steps

  1. How to Set up a Network in Ubuntu
     
    1
    Open Network Connections to set up network settings in Ubuntu. Go to “System”, “Preferences” and chose “Network Connections."
    Ad
  2. How to Set up a Network in  Ubuntu
     
    2
    Under the “Wired” tab, click on “Auto eth0” and select “Edit."
  3. How to Set up a Network in  Ubuntu
     
    3
    Click on “IPV4 Settings” tab. Chose the “Automatic (DHCP)” option if your network has a DHCP server. The DHCP Server has automatically assigned the IP address to your system. Click "Apply."
    • You also chose the “Manual” option from the Method drop-down list and assign the IP address, netmask and gateway manually. You'll also have to assign the DNS Server address. 
    • Click "Apply."
      How to Set up a Network in  Ubuntu
  4. How to Set up a Network in  Ubuntu
     
    4
    Check the IP address settings. Go to “Applications” “Accessories” and chose “Terminal."
  5.  
    5
     
    Type the following command into terminal: “sudo ifconfig” without quotes.
  6. How to Set up a Network in  Ubuntu
     
    6
     
    Get your new addresses. The Ifconfig command will show the inet address, broadcast address and mask address.
Source : wikihow.com

More Article :

 installer chromium ubuntu
 
Tags : How to Set up a Network in Ubuntu ,ubuntu,configure internet linux ubuntu,internet,configure internet linux command line