Monday, November 18, 2013

How to setup xdebug

At the end of /etc/php5/apache2/php.ini file set the following:

[xdebug]
zend_extension = <path to xdebug.so>
xdebug.idekey = "netbeans-xdebug" 
xdebug.remote_enable = on
xdebug.remote_host = localhost
xdebug.remote_port = 9000
xdebug.remote_handler = dbgp
xdebug.remote_mode = req
xdebug.remote_cookie_expire_time = 7200

xdebug.profiler_enable = off
xdebug.profiler_output_dir = /tmp
xdebug.profiler_output_name = cachegrind.out.%p-%H-%R
xdebug.profiler_enable_trigger = off

This can (without [xdebug]) be set in

/etc/php5/apache2/conf.d/20-xdebug.ini

or

/etc/php/7.0/apach2/conf.d/20-xdebug.ini

and restart Apache2 server:

sudo /etc/init.d/apache2 restart

Apache2 root folder

Change the DocumentRoot setting in /etc/apache2/sites-enabled/000-default.conf
and restart Apache2 with:
sudo /etc/init.d/apache2 restart

Wednesday, January 30, 2013

Saturday, January 26, 2013

NFS setup on NAS

How to setup NFS on NAS machine




Part I - setup static IP address for NAS machine

Go to Management->Network Management->LAN Settings:


Click on Setup button:


Setup Static IP address for NAS:




Part II - setup NFS on server (NAS)

Go to Management->Application Management->NFS Service and enable NFS service:


Then go to Management->Account Management->Network Shares:


Click on button New (in order to create new shared folder):


Select the folder that you want to share:


Define whether All Accounts will have the same permissions or you will define different permissions for particular users/groups:


Specify permissions for users:


Specify permissions for groups:


Define additional features for that share:

* Oplocks - Windows Lan Manager network feature for locking
* Map Archive - Archive flag (used for some backup tools) will be set for files that you put on this share
* Recycle - creates Recycle Bin in share folder for deleted files


Define what network sharing services will be used for accessing our shared folder:

* CIFS (SMB) - Windows services for accessing networked share (enabled by default)
* AFP - Apple's service for accessing networked share (enabled by default)
* FTP - File transport protocol
* NFS - Network File Service (sharing)
* WebDAV - network sharing through HTTP


If you selected FTP before - you have to define how FTP anonymous will access:


If you selected NFS before - you have to define how share will be accessed through NFS:

* Host - define from which host NFS shared folder can be accessed - put * for all hosts
* Root Squash - default NFS server behavior is to prevent root on client machines from having privileged access to exported files. Server do this by mapping the "root" user to some unprivileged user (usually the user "nobody") on the server side - this is known as root squashing. NAS provides an export option to disable this behavior and allow root on selected clients to enjoy full root privileges on exported file systems.


If you selected WebDAV before - you have to define writing privileges for it:


Summary of settings:




Part III - setup NFS on client (user machine)

In order to be able to access NFS shared folder one should have NFS support on his/her user machine.

$ sudo apt-get install nfs-common
Create mapping folder:

$ sudo mkdir /media/nas
Add the following into /etc/fstab file:

192.168.1.32:/mnt/HD/HD_a2/BOOKS /media/nas nfs rw,hard,intr 0 0
192.168.1.32 - static IP address of NAS machine where shared folder resides
/mnt/HD/HD_a2/BOOK - absolute path to shared folder (Volume_1/BOOKS)
/media/nas - is empty mapping folder (created just before for mapping shared folder)
nfs - access method (networking service)
rw - read/write privilege (ro for read only)

Then mount NFS shared folder from your client machine:

$ sudo mount -a
$ ls /media/nas
That's it folks.

Friday, January 11, 2013

Install Oracle 8 Java

Install Oracle Java


sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer

Configure default JVM


sudo update-alternatives --config java

Uninstall Oracle Java

sudo update-alternatives --config java
#choose OpenJDK

sudo update-alternatives --config javac
#choose OpenJDK

sudo rm -rf /usr/lib/jvm/jdk1.7.0_07/
#It will remove the Oracle Java on Ubuntu