You want to test your website at your home and before setting it up on a real server ?
You want access your home machine from outside ?
You want to stimulate a real web site without loosing a penny ?
You have a decent connection and lot of time to test things out ?

Lets setup a home webserver with dyndns , ddclient and nginx

Overview

  1. Setting up a subdomain that points to your machine
  2. Setting up a Update Client ( using : ddclient )
  3. A basic webserver installation ( using : nginx since it is really light on system)

Requirements

  • An ubuntu machine ( You can install any other Linux distro you are comfortable with)
  • A working stable Internet connection
  • Dyndns account ( You can get a free one from http://dyndns.com )

Installation &  configuration

Step 1
Dyndns account registration and subdomain setup

a. Register a dyndns account ( http://dyndns.com )
b. login to the account
c. setup a subdomain , you can do this as below

My Account >> Add Host Services >>
Hostname : Select a domain and provide a hostname ( this will be used to access your home machine )
Service type : Host with IP address
IP address : Click on the link “Your current location’s IP address is x.x.x.x”
Select services and devices you would like to use with this hostname : webserver , ssh
Add to Cart >> Next >> Active services

Step 2
Install ddclient
yo@home:~$ sudo apt-get install ddclinet
You will be asked to configure it you can read and update the values as you like for now, as we will configure it  manually with the below given steps

Step 3
Configure it by modifying conf files /etc/ddclient.conf and /etc/default/ddclient as below. Read the comments in the configuration file to get an idea of each directive. Please note to change the fields that are highlighted with your values.

root@home:~# vi /etc/ddclient.conf

# Configuration file for ddclient generated by debconf
#
# /etc/ddclient.conf
## ddclient configuration file
daemon=300
# check every 600 seconds
syslog=yes
# log update msgs to syslog
mail-failure=Your_mail_Id@domain.com # Mail failed updates to user
pid=/var/run/ddclient.pid
# record PID in file.
## Detect IP with our CheckIP server
use=web, web=checkip.dyndns.com/, web-skip=’IP Address’
## DynDNS username and password here
login=Username
password=password
## Default options
protocol=dyndns2
server=members.dyndns.org
## Dynamic DNS hosts
your_sub_domain.domain.com

root@home:~# vi /etc/default/ddclient

# Configuration for ddclient scripts
# generated from debconf on Sat Sep  4 10:15:24 IST 2010
#
# /etc/default/ddclient
# Set to “true” if ddclient should be run every time a new ppp connection is
# established. This might be useful, if you are using dial-on-demand.
run_ipup=”false”
# Set to “true” if ddclient should run in daemon mode
# If tis is changed to true, run_ipup must be set to false.
run_daemon=”true”
# Set the time interval between the updates of the dynamic DNS name in seconds.
# This option only takes effect if the ddclient runs in daemon mode.
daemon_interval=”300″

Step 4
Install webserver nginx

yo@home:~$ sudo apt-get install nginx

Default DocumentRoot will be /var/www/nginx-default , you can upload your files to the DocumentRoot directory and you can access it from anywhere with your dyndns subdomain.


1) Overview

User/Group Synchronization of OpenLdap and Alfresco servers.
Two servers deployed with openldap and alfresco ( Installation method :: Jumpbox)
2) Objective

  • Full Users/Groups Synchronization from OpenLdap to Alfresco with a hourly cron
  • Differential Synchronization of Users/Groups when ever the alfresco server is restarted
  • User Account Synchronization when ever a new user attempts login

3) Configuration overview

User type :: PosixAccount
Group type :: PosixGroup
User base :: ou=example,dc=com ( only users under ou example will be imported )
Group base :: ou=example,dc=com ( only groups under ou example will be imported )
Full Sync Interval :: Hourly
Login id :: cn ( users should login to alfreso/share with the cn )

5) Configuration done on alfresco server

Step 1
Main property file

Add the below line to the end of the file

root@home:~# /opt/alfresco/tomcat/shared/classes/alfresco-global.properties

authentication.chain=alfrescoNtlm1:alfrescoNtlm,ldap1:ldap
#Sync Settings
synchronization.synchronizeChangesOnly=false
synchronization.syncOnStartup=true
synchronization.syncWhenMissingPeopleLogIn=true
synchronization.import.cron=0 0 * * * ?

Step 2
root@home:~# mkdir -p /opt/alfresco/tomcat/shared/classes/alfresco/extension/subsystems/Authentication/ldap/ldap1

Step 3

Configuring common-ldap-context.xml, ldap-authentication.properties, ldap-authentication-context.xml

root@home:~# cp -p  /opt/alfresco/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/subsystems/Authentication/ldap/ldap-authentication-context.xml /opt/alfresco/tomcat/shared/classes/alfresco/extension/subsystems/Authentication/ldap/ldap1/

root@home:~# cp -p /opt/Alfresco/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/subsystems/Authentication/common-ldap-context.xml /opt/Alfresco/tomcat/shared/classes/alfresco/extension/subsystems/Authentication/ldap/

root@home:~# vi /opt/alfresco/tomcat/shared/classes/alfresco/extension/subsystems/Authentication/ldap/ldap1/ldap-authentication.properties

ldap.authentication.active=true
ldap.authentication.allowGuestLogin=false
ldap.authentication.userNameFormat=cn=%s,ou=example,dc=com
ldap.authentication.java.naming.factory.initial=com.sun.jndi.ldap.LdapCtxFactory
ldap.authentication.java.naming.provider.url=ldap://ldap_server_ip:389
ldap.authentication.java.naming.security.authentication=simple
ldap.authentication.escapeCommasInBind=false
ldap.authentication.escapeCommasInUid=false
ldap.authentication.defaultAdministratorUserNames=admin
ldap.synchronization.active=true
ldap.synchronization.java.naming.security.authentication=simple
ldap.synchronization.java.naming.security.principal=cn=Admin,dc=com
ldap.synchronization.java.naming.security.credentials=secret
ldap.synchronization.queryBatchSize=1000
ldap.synchronization.groupQuery=(objectclass=posixGroup)
ldap.synchronization.groupDifferentialQuery=(&(objectclass=posixGroup)(!(modifyTimestamp<={0})))
ldap.synchronization.personQuery=(objectclass=posixAccount)
ldap.synchronization.personDifferentialQuery=(&(objectclass=posixAccount)(!(modifyTimestamp<={0})))
ldap.synchronization.groupSearchBase=ou=example,dc=com
ldap.synchronization.userSearchBase=ou=example,dc=Directory
ldap.synchronization.modifyTimestampAttributeName=modifyTimestamp
ldap.synchronization.timestampFormat=yyyyMMddHHmmss’Z’
ldap.synchronization.userIdAttributeName=uid
ldap.synchronization.userFirstNameAttributeName=givenName
ldap.synchronization.userLastNameAttributeName=sn
ldap.synchronization.userEmailAttributeName=mail
ldap.synchronization.userOrganizationalIdAttributeName=o
ldap.synchronization.defaultHomeFolderProvider=userHomesHomeFolderProvider
ldap.synchronization.groupIdAttributeName=cn
ldap.synchronization.groupType=posixGroup
ldap.synchronization.personType=posixAccount
ldap.synchronization.groupMemberAttributeName=memberUid
ldap.synchronization.enableProgressEstimation=true

Please make sure to provide proper LDAP server IP, login and  with the directives

ldap.authentication.java.naming.provider.url=ldap://ldap_server_ip:389
ldap.synchronization.java.naming.security.principal=cn=Admin,dc=com
ldap.synchronization.java.naming.security.credentials=secret
ldap.authentication.defaultAdministratorUserNames=admin

Step 4
Log configuration

Add the following lines to the end of the given file

root@home:~# vi /opt/alfresco/tomcat/webapps/alfresco/WEB-INF/classes/log4j.properties

log4j.logger.org.alfresco.repo.importer.ImporterJob=debug
log4j.logger.org.alfresco.repo.importer.ExportSourceImporter=debug
log4j.logger.org.alfresco.repo.security.authentication.ldap=debug

Step 5

Stop/Start alfresco
root@home:~# /etc/init.d/alfresco stop
root@home:~# /etc/init.d/alfresco start


How to compile and install software

This is a short tutorial on how you can install softwares from packages of tar.gz or tar.bz2 extension.

Basically 5 steps

1) Uncompress  and Extract Packages

for ‘tar.gz’   — >

yo@home:~$ tar -zxvf package_name.tar.gz

for ‘tar.bz2’ —– >

yo@home:~$ tar -jxvf package_name.tar.bz2

2) Change to the extracted directory

yo@home:~$ cd package_name

yo@home:~/package_name$

3) Configuring

yo@home:~/package_name$ ./configure

This creates a MakeFile which is the needed for the next step, which is building.( Make sure that no errors are reported while configuring so as to move to the next step.)

4) Building

yo@home:~/package_name$ make

5) Installing

You need to be the root user to install the software.

yo@home:~/package_name$ su –

Password:

root@home:~/package_name# make install

The above command will install the desired software to the default location if everything goes fine. 🙂

To uninstall

As root execute the following command

root@home:~/package_name# make uninstall