avatar

How to Install Samba Server on Ubuntu

April 7, 2013 in Services

Installing Samba on Ubuntu

What is samba?

Samba is an easy way to share files over Linux And Windows environment. Samba is presented by samba.org and is an Open Source/Free Software suite that provides seamless file and print services to SMB/CIFS clients.

Installing Samba.

lets update first the repositories.

open a terminal and type the following :

sudo apt-get update

now install samba

sudo apt-get install samba

now lets edit the configuration file of samba, but before that lets backup the initial configuration file.

cd /etc/samba/

sudo mv smb.conf backsmb.conf

Setup public folder:

First we will create the configuration for a share folder accessible from everyone without any user need it

sudo nano smb.conf

for that add the following to this file:

#
[global]
workgroup = Workgroup
server string = My Samba Share %v
security = user
map to guest = bad user
dns proxy = no
#
[ShareFolder]
comment = This is a folder accessible from everyone
path = /sharefolder
browsable = yes
guest ok = yes
read only = no
create mask = 0755

next we need to create the directory that will host the share folder and change the user permissions

avatar

Apache load balancing and failover

October 5, 2012 in Web Server

Apache load balancing and failover with pound

What is server load balancing?

Load balancing is a way to split all the income requests, to more than 2 servers. You must have a load balancing when you have a lot of income requests that a server can not handle. If you have for example a web site with a lot of visitors that a single server will not be able to handle, you must split the traffic to 2 or more web servers.  In this tutorial i will use 2 web servers and a load balancing server to redirect the http request.

What is server failover?

If you have a web site in a web server and you want for example to close this server for maintenance reasons or if your server due to a technical reason stop operating, your website will be offline until you fix this problem! Fail over is a way to automatically redirect the incoming requests for your website to another web server.

In this tutorial you will find an easy way to load balancing and failover using pound. Pound is an open source reverse proxy that can handle load balancing and failover with a strong emphasis in security.

Lets say that you have a static ip (i will use a non-existing IP 145.47.82.256), a domain name (allaboutlinux.eu) for your website, a webserver (with internal IP 192.168.0.250) and a router (configured to redirect all the incoming requests for port 80 to 192.168.0.250). If you have all the above its easy to create a public website hosted on your webserver. But this server has no failover or load balancing since its a single server.

 

If you need failover and load balancing you will need one more server with a replica of your website and a server that will handle the load balancing and fail over. Lets start creating the Pound server!

avatar

how to install Webmin on ubuntu

September 20, 2012 in Services

Install webmin on Ubuntu

what is Webmin?

Webmin is a great tool for unix system administrators. With Webmin you can easily config and manage a server from a web browser. You will be able to manage Users, Apache, mySQL, DNS, File system, Backup and many more

What you need in order to install Webmin

Since this is a web based tool you will need a web server like Apache. If you already have Apache installed please skip this step:

Ok lets install Apache.

You can install Apache2 from the Terminal by using:

sudo apt-get update

sudo apt-get install apache2

when the installation finish Apache is up and running and you can test that by point your web browser to http://localhost/

The default site will came up with a message that says “it works”.This html file is located under your local file system in folder /var/www/

Lets go on the next step "How to install webmin on Ubuntu"

avatar

Reset forgotten user password on Ubuntu

July 9, 2012 in Tips

Reset User Password on Ubuntu

Sometimes, (if not every time), i create a password for something and after 10 minutes (maybe less) i have already forgot that. Thanks god in Ubuntu you can reset the password of a user easily. Today is maybe the 1023654th time i did that. So i decide to create a post for that.

Just follow the steps its easy.

1. boot your computer while you press and hold "Shift" key
2. Select Ubuntu blablabla (recovery mode)


3. In the recovery menu select "root"


4. when the promt appears type:

mount -rw -o remount /

passwd "username"

where "username" is the username of the user that you don’t know the password
Now type a new password twice and you are done!

Here is a video tutorial!

avatar

How to install Drupal 7 on ubuntu

June 26, 2012 in CMS

How to install Drupal 7 on ubuntu Part 1

This is a full article on how to install Drupal on Ubuntu, that means you can use this guide even if you have a clean installation of Ubuntu, and I will try to keep it as simple as I can.

What you will need in order to install Drupal.

First of all you will need a LAMP Server(more information can be found here).

1. You have to install a Linux system(you can choose whatever you want. A guide on how to install Ubuntu can be found here).It doesn’t really matter if you choose a desktop or server edition but if you are planning to publish your Drupal website I strongly recommend to use a server edition of Ubuntu for example.

2. You will need Apache (more information can be found here)

3. You will need MySQL (more information can be found here)

4. You will need PhP (more information can be found here)

5. And last but not least you will need to download Drupal from official site.

Let’s go to the next Part and install Lamp

avatar

Bash script for beginners

June 25, 2012 in Bash script

Bash scripting for beginners Part 1

What is Bash script?

A Bash script is mainly a set of commands that can be executed in a Terminal. You can create a Bash script file (filename.sh) and execute the set of commands inside that file as many times as you want. So if you want to execute a set of commands periodically then you should think "Bash script".

Bash script is more than that. You can actually use that as a programming language in order to create small programs that can be executed in a terminal.

And as they say the most easy way to learn a language is to create a program with that language and try to improve it. (I don’t really know if people say that, but that is the way of this tutorial.

So in this tutorial i will explain how to create bash scripts while you are creating a backup program.

Lets start Bash scripting

echo Comments

To do so, let’s create some folders that we will need in order to store our scripts and backups.

Open a terminal and type:

cd ~/Desktop

mkdir bash

cd bash

mkdir code

mkdir backup

Now go into "code" folder

cd code

Just before we start the backup program let’s create first a bash script for "Hello  World", so you can understand how to create and then execute a script.

In order to create a Bash script you will just need a text editor such as "gedit". You can use your favorite text editor but I will use gedit since this editor comes with Ubuntu.

Open a terminal and type:

gedit ~/Desktop/bash/code/helloworld.sh

enter the following text to gedit,

#!/bin/bash  
# Bash scripting with allaboutlinux.eu 
echo Hello World

press "save" and close gedit

Almost done! Now you have to make that file executable. Open a terminal and type:

chmod +x helloworld.sh

And now you are ready to execute your first Bash script. Open a terminal and type:

cd ~/Desktop/bash/code

./helloworld.sh

Now you should see "Hello World".

Just a quick explanation of the script:

You can use "#" in order to "comment" a line. So the line "# Bash scripting with allaboutlinux.eu" is just a comment and has nothing to do with the script. there is an exception to that rule that applies to the first line that starts with "#!" this line defines which interpreter to use. in this case we use bash.

You can use "echo" in order to print something in the terminal.

If you have understood everything in this part you can go to the next part where we will start making our backup program.


avatar

How to Host multiple Websites on Apache2

March 29, 2012 in Apache Configuration

How to Host multiple Websites on Apache2

Let’s say that we own 2 or more domain names (hostpage1.com and hostpage2.com). We also have 2 web pages (hostpage1 and hostpage2). But we have only 1 webserver and 1 public IP (for this example i will use local IP but it will be the same if you own a public static IP)

Setting up the Domain names.

First thing is to create an "A record" in the DNS of your Domain Names to point "www" to your public or local IP address of your Web Server. I use local DNS in this example. So i will point the "www" for both of my domain names to 192.168.0.31. So it will be something like that:

www.hostpage1.com --> 192.168.0.31

www.hostpage2.com --> 192.168.0.31

Read the rest of this entry →

avatar

host a forum

March 26, 2012 in forum

How to create and host your own forum on Ubuntu.

Requirements

A web server With PHP Support. (In this tutorial I use Apache2)

SQL database. (In this tutorial i use Mysql and PhpMyadmin to configure Mysql)

If you already have Apache Php Mysql and Phpmyadmin installed then you are ready to go if not please follow these tutorials first (Lamp on ubuntu and Phpmyadmin)

Installation:

First we will need an empty database where our forum will store contents.

Read the rest of this entry →

avatar

How to run PHP on Ubuntu

March 21, 2012 in Php

How to run PHP on Ubuntu.

First of all you will need a web-server to host our PHP pages.

In this tutorial I ll use Apache2. You can install Apache2 from the Terminal by using:

sudo apt-get update
sudo apt-get install apache2

when the installation is finished, Apache is up and running and you can test that by pointing your web browser at http://localhost/

The default page will come up with a message "it works" and some more info.This html file is located under your local file system in folder /var/www/html/

Now you have to install PHP.

To install PHP and PHP support for Apache, just write the following in console:

Read the rest of this entry →

avatar

How to install WordPress 3.3 on ubuntu 11.10

March 20, 2012 in CMS

How to install WordPress 3.3.1 on Ubuntu

This is a full article on how to install WordPress on Ubuntu, that means you can use this guide even if you have a clean installation of Ubuntu, and I will try to keep it as simple as I can.

What you will need in order to install WordPress.

First of all you will need a LAMP Server(more information can be found here).

Lets set up our LAMP Server.

1. You have to install a Linux system(you can choose whatever you want. A guide on how to install Ubuntu can be found here).It doesn’t really matter if you choose a desktop or server edition but if you are planning to publish your WordPress website I strongly recommend to use a server edition of Ubuntu for example.

2. You will need Apache (more information can be found here)

3. You will need MySQL (more information can be found here)

4. You will need PhP (more information can be found here)

5. And last but not least you will need to download WordPress from official site.

Let’s go to the next Part and Install Lamp