Showing posts with label Server. Show all posts
Showing posts with label Server. Show all posts

Monday, May 26, 2008

In search of a NAS OS

So there's FreeNAS (http://www.freenas.org/). But you need to format the partitions to a BSD format. I'm not comfortable with that. What I was looking for was a Linux or Windows based NAS that I could control via a web interface. Windows Home Server was a no-no coz I didn't want to end up with Trojan infested torrent.

So I decided to give up and install a full blown Ubuntu with Samba and SWAT. Lucky for me, while I filled every geek ear with my NAS woes, a colleague Ryan told me about Webmin. It's got a neat bunch of tools that allow you to administer your OS via a web interface. You can add shares, users, monitor disk usage and a whole lot more!

http://www.webmin.com/

To install on Hardy Heron Ubuntu:

  1. sudo apt-get install perl libnet-ssleay-perl openssl libauthen-pam-perl libpam-runtime libio-pty-perl libmd5-perl
  2. wget http://prdownloads.sourceforge.net/webadmin/webmin_1.420_all.deb [ change version to newest ]
  3. sudo dpkg -i webmin_1.420_all.deb

Thats it! Now visit https://localhost:10000/

If you have firefox3 beta it will complain about the certificate being invalid. That's coz the beta has a problem with self-signed certificated. Just add the site to your exceptions list and you'll be good to go!

Wednesday, March 19, 2008

Access Samba shares from the Terminal

Useful when you want to use PuTTy to access your machine at home from work and you want to connect to another machine on your home network!..

To view your Samba Shares:
smbtree


If your share requires authorization: (enter the password when it prompts you)
smbtree -U=administrator


To connect to the share:
smbclient //bastille/ToyBox


If your share requires authorization: (enter the password when it prompts you)
smbclient //bastille/ToyBox -U administrator



Now you can use FTP commands. Some important ones:
Change to a 'local' directory
lcd /home/wraith/temp


Copy a remote file to the 'local' directory
get myremotefile.txt


More commands:
FTP, File Transfer Protocol - Summary of Commands

Saturday, March 25, 2006

Setting up SSH and FTP with SSH

The simplest setup i've had so far! Just Install, Configure and Start it!

Get OpenSSH:
http://www.openssh.com/

Install OpenSSH:
# apt-get install openssh

Secure It:
Config file location: /etc/ssh/sshd_config

Change to the more secure SSH Version 2 in the config file.
Protocol 2

Start/Stop/Restart Commands:
# /etc/init.d/sshd start
# /etc/init.d/sshd stop
# /etc/init.d/sshd restart

Test if running:
# pgrep sshd
You should get a response of a process ID

Thats it!
To login from a remote machine you need to use an SSH client like PuTTY.
Here's a list of clients that you could use:
http://en.wikipedia.org/wiki/List_of_SFTP_clients

To login from a client type ssh followed by the IP of the SSH server.
e.g. ssh 192.168.0.0

What To Expect With Your First Login
The first time you log in, you get a warning message saying that the remote host
doesn't know about your machine and prompting you to store a copy of the remote
host's SSH identification keys on your local machine. It will look something
like this:

[root@bigboy tmp]# ssh smallfry
The authenticity of host 'smallfry (smallfry)' can't be established.
RSA key fingerprint is 5d:d2:f5:21:fa:07:64:0d:63:1b:3b:ee:a6:58:58:bb.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'smallfry' (RSA) to the list of known hosts.
root@smallfry's password:
Last login: Thu Nov 14 10:18:45 2002 from 192.168.1.98
No mail.

[root@smallfry tmp]#

- from: Quick HOWTO: Secure Remote Logins And File Copying

Read up about SSH and Tutorial Links:
http://www.openssh.com/
Quick HOWTO: Secure Remote Logins And File Copying

Wednesday, March 8, 2006

Setup Subversion on the Apache HTTP server

-EDIT-
For a easy mini how-to for setting up Apache2 with SVNis see /usr/share/doc/packages/subversion for the full documentation. Is easier than what's below, but i'll leave the info below for info sake...
-EDIT-

Setup Subversion on the Apache HTTP server

Changes to http.conf

LoadModule dav_module /usr/lib/apache2/mod_dav.so
LoadModule dav_svn_module /usr/lib/apache2/mod_dav_svn.so

#Subversion Repository
< Location /blabbermouth >
DAV svn
SVNPath /usr/svnrepos

# how to authenticate a user
AuthType Basic
AuthName "Subversion repository"
AuthUserFile /etc/svn-auth-file

# For any operations other than these, require an authenticated user.
< LimitExcept GET PROPFIND OPTIONS REPORT>
Require valid-user
</LimitExcept>
</Location>


Make Changes in subversion's /conf/passwd file to allow read/write/none access..

[/]
* = r
[blabbermouth:/]
user1=rw
user2=rw

Allows anyone to read ALL repositories and user1 and user2 to write to the 'blabbermouth' repository.

Remeber to give the UserID that Apache runs as permission to write to your svn folder. If your svn repos is owned by a user 'svn' and group 'snv' and if Apache runs as 'wwwrun' (check the httpd.conf or uid.conf) then in the console type:
# groups wwwrun to list the groups that wwwrun belongs to.
# usermod -G svn wwwrun will add wwwrun to the svn group. if 'wwwrun' belongs to anyother groups (besides the primary group 'www') then mention them alongside svn.

Tuesday, March 7, 2006

Subversion

The goal of the Subversion project is to build a version control system that is a compelling replacement for CVS in the open source community.
Get it here: Subversion

SVNForum.org is a Subversion community help and discussion forum for exchanging information and tips with other users of Subversion

Read The Subversion Book for instrustions.

And if you use windows get TortoiseSVN, a Subversion client, implemented as a windows shell extension. The coolest Interface to (Sub)Version Control.

note to self:
Create SVN repository:
svnadmin create --fs-type fsfs /usr/svnrepos/

Import to SVN:
svn import --message "Initial Import" repos file:///usr/svnrepos/blabbermouth/

Wednesday, March 1, 2006

MySQL Server over the network - Linux Forums

MySQL Server over the network - Linux Forums
Error 1130, remote connecting access denied.
MySQL and Linux Tutorial

To allow network access:
GRANT ALL on * TO 'username' IDENTIFIED BY 'user password'
FLUSH PRIVILEGES


Some notes on the MySQL/Java connection with the MySQL® Connector/J (mysql-connector-java).
After installing it you need to change the CLASSPATH or you'l get errors like com.java.driver something not found..
For the bash shell prompt that I use in SuSE 10.0 I created a file in my home dir: .bashrc

~username/.bashrc
---------------------
export CLASSPATH=$CLASSPATH:/opt/mysql-connector-java-3.1.12/mysql-connector-java-3.1.12-bin.jar

**make sure its one line, with no line breaks in it!
Info for other Shell prompts

Sunday, January 29, 2006

Alias & httpd.conf

Snippets to create an Alias in Apache (similar to the IIS Virtual Directory).

# Alias for MaN-aT-aRMz
Alias /MaN-aT-aRMz "/windows/Neuro/MaN-aT-aRMz"
<Directory "/windows/Neuro/MaN-aT-aRMz">
Options Indexes FollowSymLinks MultiViews ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>

So, basically:
Alias /alias_name "/directory_to_create_an_alias_for"

Sunday, November 13, 2005

Perfecting the Samba!!

Once again... reinstalled... put Suse 10.0 and learnt more abt configuring my box..
In my previous post abt samba I was unsure abt how I got Samba to start..

... So I guess the key is to coax the smbd, nmbd & winbindd services to run after making all the required changes.
-from Samba... Lets Dance!!!

Well.. it should have been obvious but being a newbie it didnt strike me...
When installed, Samba isnt initialized by default.. So basically Samba isnt started when the machine boots.. it needs to be manually started..
The way to get it to startup at boot is to go to the Samba Server tool in YaST and choose the 'start-at-boot' option.
To start SWAT change the line in the file 'swat' located in /etc/xinetd.d/ to
disable = no from the default 'yes'.

And thats it.. Initilize Samba and SWAT.. Configure the (/etc/samba/) smb.conf file... Create a user smbpasswd -a username and you're good to go!

Sunday, June 12, 2005

Apache Virtual Directories

Struggling for days to try to setup virtual directories.. And no clue what Im doing.. Like playing in the muck..
Finally, I beleive what I was doing wrong was that after making changes to httpd.conf (/etc/apache2) & other config files, i didnt restart Apache.. I was under the impression that apache re-reads it's config files every so often.. I just realised that Samba does that.. Finally ive got my website up and I can access my windows mounts.. all is good...

To Restart Apache: apache2ctl restart (note: as root)

Changes made to make /windows/ a virtual directory...
... added to /etc/apache2/default-server.conf

# Aliases: aliases can be added as needed (with no limit). The format is
# Alias fakename realname
#
# This is an Alias for my /windows dir that has my
# windows drives that i want to be exposed on my site

Alias /windows/ "/windows/"

Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all


Moral of the story: Restart Service after changes..

Monday, April 18, 2005

Restart Apache

If you need to restart Apache to have it re-read the httpd.conf configuration file then type this in the consile:
kill -HUP `cat /usr/local/apache2/logs/httpd.pid`

Explination:
HUP Signal: restart now

Sending the HUP signal to the parent causes it to kill off its children like in TERM but the parent doesn't exit. It re-reads its configuration files, and re-opens any log files. Then it spawns a new set of children and continues serving hits.

Users of the status module will notice that the server statistics are set to zero when a HUP is sent.

Note: If your configuration file has errors in it when you issue a restart then your parent will not restart, it will exit with an error. See below for a method of avoiding this.


...taken from Stopping and Restarting Apache

Tuesday, March 22, 2005

Samba... Lets Dance!!!

Its Working!!! And plz dont ask how! I have no clue!!
After almost a week of struggle its working. I've tried to recall what i did but i might've missed some important details..

I decided to install Samba 3.0 and see if that helped but 3.0 wasnt installing.. gave some libpopt required error.. so i gave up.. (Actually, I already had 3.0 but at the time I didnt know that! :O I realised it later on)

Then I got fedup.. No one on #samba (irc) was replying so I deleted everything in my (/etc/samba/) smb.conf and just put in the basics:

# Global parameters
[global]
workgroup = ETERNIA
server string = Samba Server
interfaces = 127.0.0.1, eth0, eth1, eth2
bind interfaces only = Yes

[nuxaudio]
comment = Audio (D:)
path = /windows/D/

Tested it in the console at the /etc/samba/ directory with
testparm smbd.conf
And then I opened SWAT from http://localhost:901 and fiddled a bit there. I clearly remeber starting all the services and commiting changes.. and after that... i could connect to the sorceress using:

net use e: \\sorceress\nuxaudio

which basically maps the 'nuxaudio' folder to the 'e:' drive. But I got a password prompt and no matter what I tried wraith or root nothing worked. I tried setting the SHARED instead of USERS but I dont think that quite worked. After a lil research I found out that samba has its own user/passwd list. So I created some users.

smbpasswd -a wraith

and volia!! i could access my shares from NN!!! Neat..

I'll tweak it over the week, but finally this is working!!! woo hoo!!
Heres my current smb.conf (/etc/samba)

# Samba config file created using SWAT
# from 127.0.0.1 (127.0.0.1)
# Date: 2005/03/21 14:19:47

# Global parameters
[global]
workgroup = ETERNIA
server string = Samba Server
interfaces = 127.0.0.1, eth0, eth1, eth2
bind interfaces only = Yes
local master = No
ldap suffix = dc=example,dc=com
valid users = wraith, Wraith

[nuxaudio]
comment = Audio (D:)
path = /windows/D/

[nuxneuro]
comment = Neuro(F)
path = /windows/F/

[nuxvideo]
comment = Video(E)
path = /windows/E/

[nuxvirtuo]
comment = Virtuo(G)
path = /windows/G/




..update
Since I needed to reconfigure the system after the reinstall, I think I just realised what it was that I did to make samba work.
Even after enabling Samba Server & Client from YaST and changing the smb.conf file to look like above the problem is that the samba services aren't running yet. So, SWAT would not start and i could not see my machine in NW Neighbourhood but could access the windows machines. After mucking around and a few restarts (around 3) the services started so SWAT and Samba were working.
So I guess the key is to coax the smbd, nmbd & winbindd services to run after making all the required changes.
Cheers!

Saturday, March 19, 2005

Samba et Apache: Figuring it out

After some research last night i figured out that the DNS on samba isnt working. neeed to enable WINs or point samba to a WINS server. something like that.. still need to read up abt that..

I managed to setup the Apache WebServer. Got my website up.


..update
I forgot to put details of how i got Apache running. Quite simple actually.
Enable the Apache Server from Yast Network Services> Http Server.
The Web Server is located on /srv/www/htdocs. Store all the files here. Name the main page 'index.html' and its done.
The config file is stored in /etc/apache2 httpd.config if you want to muck with advanced settings.

Strange thing is that within the network i can access the website only with the internal 192.168.0.101 IP but not with the hostname or WAN IP (69.*.*.*). Called D-Link and they say thats how the router is.. Hard to believe but i checked online and a number of ppl have had this problem on some routers.. some router work fine. The solution, which really sux, is to edit the LMHOSTS file on the machines and add
192.168.0.101 gwyneth.gotdns.com
to it.. i hate these band-aid solutions. machines should automatically figure these things out.. bah!

right now the web-server is barely doing what the website indicates. still need to setup an FTP server et al. Linux with it permissions and maha security confuses me..

Linux certianly isn't reccomended for novice users.. theres tons of configuration to be done!

Friday, March 18, 2005

Samba!

The only thing that I miss from windows is the ability to share files and folders across the house. Ive still not figured it out..



What I Did:
` Installed Samba from YaST
` Setup Samba Client and Server with Shares
` Install LISa from YaST
-Restarted..

Lisa is a graphical interface for Samba but LISa doesnt work for me.. still have to get that going.

With after logging in as root into the console, I can read network shares by IP Address but not with the NetBIOS name.

smbclient -L Stripperella -U Arati

Gives me errors that it cant find Stripperella but

smbclient -L 192.168.0.114 -U Arati

shows me the shares on Stripperella and some wierd error. Using

smbmount -o username=Arati, password= //192.168.0.114/Kwap /network/Stripperella/Kwap

I can map the 'Kwap' folder on Stripperella to the '/network/Stripperella/Kwap' folder on the linux box. Wierd!

The Sorceress cant be seen on any windows machine.. I can ping it et al but i can't see it. Need to work on this some more..

There such little documentation on samba.. The samba site is confusing.. took a lot of searching and struggling to figure these small bits out. Lots of help is available for older windows versions. Havent found much help for working with Win XP/2l

Links:
Quick HOWTO: Sharing Rescources with Samba
Experts Excahange Query

Oh! Update.. The Samba site does have info here.. going thru it now..