Post

How to send e-mail using PHP and mail() with Linux Debian

Note: This is tested and proven to work on Debian Squeeze (stable) If you are a web-admin or a PHP developer hosting on your own servers you might have found out that PHP mail() function does not work out of the box in Debian unless you have installed Exim (default MTA for Debian Squeeze), sendmail or some other MTA. Most of the time this is OK, but when you really don't want to mix a mailserver with your webserver this is going to be a problem. In php.ini file there is a SMTP configuration value that you can set which is misleading. Even though you set the SMTP value, PHP mail() function will not connect directly to the SMTP server and relay emails rather it depends heavily on sendmail program which can be set via the sendmail_path configuration value. In conclusion you'll have to have a working sendmail program if you want to use PHP mail() function. So rather than using a complete MTA just to relay emails to your mailserver you can use SSMTP which is a send-only send...

How to install VNC Server on Xfce 4

The following will allow vnc to start a X desktop. Install VNCServer  apt-get install vnc4server Config for xfce to start with vncserver mkdir /etc/vnc vi /etc/vnc/xstartup //add in the following: startxfce4 Start VNC Session vncserver  The first time a user goes "vncserver" from the cli, they will be asked for a password. This will be saved in ~/.vnc/passwd There will also be other log files in ~/.vnc/ Note, you can edit on a per user basis xstartup, however in the Config above, I added startxfce4 to the global file. Kill VNC   sessionvncserver -kill :1

How to change MySQLAdmin(root) Password using MySQL Safe Mode

Reset MySQL Admin Password using MySQL Safe Mode…. First you must Stop/Kill existing MySQL service or PIDs #service mysqld stop or #killall mysqld Now Start MySQL in Safe Mode using Following Command #/usr/bin/mysqld_safe --user=mysql --skip-grant-tables Now Connect to MySQL #/usr/bin/mysql Use the mysql database: mysql>use mysql; Change the MySQL admin(root) Password using following command mysql>update user set password=password(‘wsarxaffa’) where user=’root’ and host=’localhost’; Flush the privileges so everything will take (It removes any privileges set by the server) mysql>flush privileges; Then Quit : mysql>quit Stop MySQL Service /etc/init.d/mysqld stop Start MySQL Service /etc/init.d/mysqld start Now Login to MySQL As A root user #mysql -u root -p wsarxaffa

Solaris 10: How to restart network service without reboot

Adding or editing the IP address on a Solaris 10 server is different from the previous versions of the OS (Solaris 9, Solaris 8 etc). In the previous versions of the Solaris Operating System, you need to edit the /etc/hosts file and add/edit the entry for the IP address and the hostname. Example: 192.168.1.1 myhost However, in Solaris 10, you should edit the /etc/hosts file (a symlink to /etc/inet/hosts file) and the /etc/inet/ipnodes file and add an entry for IP address and hostname. Once done, restart the Network service using # svcadm restart network/physical or reboot the server for the changes to take effect. Although, the /etc/inet/ipnodes files is primarily for IPv6 only, without adding an entry to the file, the IP address (IPv4) doesn’t become active. This seems to be a known problem but the good news is this is now fixed in the Solaris 10 U4 (08/07 build). Also, ensure that the /etc/netmasks file with the network ID and the netmask.

How to manage services in Solaris 10

svcs command System administrators can more easily monitor services using Solaris Service Manager’s service status information and service activation/deactivation interfaces based on the commands ( svcs , svcadm , etc). Until Solaris 9, it was a complicated procedure to understand service status. Service level information was not provided and system administrators have to assume service status from their own analysis of kernel level information. A slow and error prone process. svcadm command Services and the services on which they depend are started in their appropriate order using the Solaris Service Manager svcadm command. System administrators are longer required to run complicated service startup operations. With Solaris 10 the traditional service stop procedure using the kill or pkill commands is no longer available. This is because, once stopped, Solaris Service Manager will automatically restart them. So a new command, svcadm is now used for stopping services.     Re...

Networking in Solaris 10: Gestione delle schede di rete

In questo articolo spiegheremo la gestione della rete da parte di SUN SOLARIS 10 , e come configurare schede fisiche e schede logiche, in maniera temporanea o permanente. Gli identificativi delle schede di rete sono vari, solitamente quelli che si possono trovare su sistemi ad architetture diverse sono: - pcnX - bgeX - hmeX dove per X intendiamo un numero da 0 a N . Per ottenere informazioni riguardo le schede installate e configurate sul sistema, digitare da riga di comando “ ifconfig –a ”. Questo comando è disponibile, in configurazione standard, soltanto come utente root o come super user . L’output generato dal comando è di questo tipo: bash-3.00# ifconfig -a lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1         inet 127.0.0.1 netmask ff000000 lo0:1: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1       ...

Virtual Box: La gestione della rete

Le virtual machine per comunicare fra loro oppure con l’host hanno a disposizione una o più interfaccie di rete. La comunicazione via rete è il modo migliore per scambiare messaggi o file tra le macchine in maniera sicura. Anche VirtualBox come i più blasonati concorrenti nel campo della virtualizzazione offre un buon supporto e un’ottima documentazione per realizzare una rete. Sono quattro i tipi di modalità a scelta dell’utente: Network Address Translation (NAT) Host Interface Network  Internal Networking  Nessuna connessione La prima impostazione è quella di default, che consente la navigazione in Internet attraverso lo sfruttamento del collegamento disponibile sull’host. Network Address Translation (NAT) L’impostazione di default è quella che va bene nella maggior parte dei casi, tuttavia non funzionerà il comando ping e la virtual machine non sarà raggiungibile dall’esterno (fuori dell’host e dalle altre macchine virtuali). VirtualBox integra al suo interno un serve...

Mysql How to set password for root user

/opt/mysql/mysql/bin/mysqladmin -u root password 'new-password' /opt/mysql/mysql/bin/mysqladmin -u root -h unknown password 'new-password'

Installing MySQL 5.5 on Solaris 10

Assumption Readers are assumed to have at least some basic Unix/Linux administrative skills. Readers are assumed to have FRESH running copy of Solaris 10 8/11 (u10-ga2). Readers are assumed to have NO previously installed MySQL version in the system. Readers are assumed to have backed up any critical data before the installation. The MySQL version used for this tutorial is 5.5.16 Community Edition. Readers are to take full responsibility of any potential software, data, hardware, financial and life damages prior to following this tutorial. Downloads Please obtain a copy of the latest MySQL 5.5 from http://www.mysql.com/downloads/mysql/ . For the Solaris 10 MySQL packages, please click on the select box under “ Select Platform: ” and select “ Sun Solaris “. Choose the appropriate processor architecture of the package (either x86, 32-bit, x86, 64-bit or SPARC). Download the package and save them in an appropriate directory (this tutorial will deal with the file which en...

Solaris 10: come modificare l'hostname

Il seguente comando permette di cambiare l'hostname ad un server Solaris 10: # uname -S [NOME_HOST] Oltre all'esecuzione del comando vanno modificati manualmente i seguenti file relativi alle schede di rete:  /etc/hostname.* Alternativamente sempre su Solaris 10 è possibile procedere con il comando: # sys-unconfig il quale permette di eseguire la riconfigurazione di hostname e network del sistema