openSUSE 11.1 is released yesterday. I am just downloading now.
Download details link is here:
Link
So download which best suites your system and you.
Have a lot of fun.
ANL
Friday, December 19, 2008
openSUSE 11.1 Released
Labels:
Linux Distros
Saturday, December 13, 2008
404 Error customize it for your own site
As, i discussed mod_rewrite in the previous post,that how to enable and use it.
As we know, that some time users input wrong URL, or miss some thing from URL. So that time Apache redirect them to 404 error stating that page not found on this server.
Now the good and very easy way to remove such error and show your users a valid and fine tuned page, Apache give us a opportunity to rewrite that page.
So now you can show a page to users, with some good contents to not lose that user.
Create a .htaccess file and write the following there:
ErrorDocument 404 http://site.com/404error.html
You can change your paths. Now you have a page 404error.html(you can create it in any language PHP etc). Now write whatever you want in 404error.html and show that to user. Save it and place it in the root directory of your site. You can dress up 404error.html to make sure that user will come back or click any link there to your site. OR you can provide search area there. OR any nice page with nice graphics and contents and telling them, that the thing they are looking for can be found in HOME page and give a link to home page. Its all up to you that how you make this page.
I was just giving some tips.
ANL
As we know, that some time users input wrong URL, or miss some thing from URL. So that time Apache redirect them to 404 error stating that page not found on this server.
Now the good and very easy way to remove such error and show your users a valid and fine tuned page, Apache give us a opportunity to rewrite that page.
So now you can show a page to users, with some good contents to not lose that user.
Create a .htaccess file and write the following there:
ErrorDocument 404 http://site.com/404error.html
You can change your paths. Now you have a page 404error.html(you can create it in any language PHP etc). Now write whatever you want in 404error.html and show that to user. Save it and place it in the root directory of your site. You can dress up 404error.html to make sure that user will come back or click any link there to your site. OR you can provide search area there. OR any nice page with nice graphics and contents and telling them, that the thing they are looking for can be found in HOME page and give a link to home page. Its all up to you that how you make this page.
I was just giving some tips.
ANL
Labels:
Apache
Thursday, December 11, 2008
Hide .php from users to make your url more friendly
I have written an article named "How to rewrite URL in apache".
Today i am sharing with my readers and PHP programmers.
First of all we will check that either mod_rewrite in apache load modules is enabled or NOT.
In Linux openSUSE:
By default, openSUSE doesn't enable the mod_rewrite rewrite module. It's installed, but not enabled.
So lets enable it,
1. Edit the file /etc/sysconfig/apache2 as root:
i. search for APACHE_MODULES, you should find a line like this
APACHE_MODULES="suexec access actions alias auth auth_dbm autoindex cgi dir env expire include log_config mime negotiation setenvif userdir ssl php5"
ii. Add 'rewrite'(without quotes) to the content in the list between the "".
iii. Save the changes and quit
2. run SuSEconfig to update the apache configuration files.(From terminal)
3. run /etc/init.d/apache2 restart to restart the Apache server.(From terminal)
To check either mod_rewrite is enabled or not. phpinfo();, write in editor, save it in the root directory and open it in browser.
Search for word "mode_rewrite"(without quotes). If you find it, it mean rewrite is enabled. if not, then check the steps again and try.
Now you have to do some tweaking of default-server.conf file.
1. Edit the file /etc/apache2/default-server.conf with your prefered editor.
i. Search for AllowOverride - it should be below the line Directory "/srv/www/htdocs"
ii. Change AllowOverride None to AllowOverride All - this will allow custom .htaccess rewrite rules.
iii. Save your changes and exit
2. run SuSEconfig to update the apache configuration files.
3. run /etc/init.d/apache2 restart to restart the Apache server.
Now every thing is fine and running, lets test it. that it is working or not.
Create a directory with any name, i create mod_rewrite, open editor and write the following code there.
if($_GET['link']==1){echo"You are not using mod_rewrite";}
elseif($_GET['link']==2){echo"Congratulations!! Your Apache mod_rewrite test is successful";}
else{echo"Linux Apache mod_rewrite Test";}
//make it url as by href method.
"rewrite.php?link=1"LINK1 = rewrite.php?link=1
"link2.html"LINK2 = link2.html
save it as rewrite.php
Now write:
Options +FollowSymlinks
RewriteEngine On
RewriteRule ^link([^/]*).html$ rewrite.php?link=$1 [L]
and save it as .htaccess in the same directory.
Open rewrite.php in browser and click on link1, and then on link2. If you see the message "Congratulations!! Your Apache mod_rewrite test is successful", means that, its working.
In WINDOWS:
How to enable mod_rewrite module in apache in xampp, wamp?
1) Find the “httpd.conf” file under the “conf” folder inside the Apache’s installation folder.
2) Find the following line “#LoadModule rewrite_module modules/mod_rewrite.so” in the “httpd.conf” file.You can do this easily by searching the keyword “mod_rewrite” from find menu.
3) Remove the “#” at the starting of the line, “#” represents that line is commented.
4) Now restart the apache server.
5) You can see now “mod_rewrite” in the Loaded Module section while doing “phpinfo()”.

The rest of the testing is same as above.
ANL
Today i am sharing with my readers and PHP programmers.
First of all we will check that either mod_rewrite in apache load modules is enabled or NOT.
In Linux openSUSE:
By default, openSUSE doesn't enable the mod_rewrite rewrite module. It's installed, but not enabled.
So lets enable it,
1. Edit the file /etc/sysconfig/apache2 as root:
i. search for APACHE_MODULES, you should find a line like this
APACHE_MODULES="suexec access actions alias auth auth_dbm autoindex cgi dir env expire include log_config mime negotiation setenvif userdir ssl php5"
ii. Add 'rewrite'(without quotes) to the content in the list between the "".
iii. Save the changes and quit
2. run SuSEconfig to update the apache configuration files.(From terminal)
3. run /etc/init.d/apache2 restart to restart the Apache server.(From terminal)
To check either mod_rewrite is enabled or not. phpinfo();, write in editor, save it in the root directory and open it in browser.
Search for word "mode_rewrite"(without quotes). If you find it, it mean rewrite is enabled. if not, then check the steps again and try.
Now you have to do some tweaking of default-server.conf file.
1. Edit the file /etc/apache2/default-server.conf with your prefered editor.
i. Search for AllowOverride - it should be below the line Directory "/srv/www/htdocs"
ii. Change AllowOverride None to AllowOverride All - this will allow custom .htaccess rewrite rules.
iii. Save your changes and exit
2. run SuSEconfig to update the apache configuration files.
3. run /etc/init.d/apache2 restart to restart the Apache server.
Now every thing is fine and running, lets test it. that it is working or not.
Create a directory with any name, i create mod_rewrite, open editor and write the following code there.
if($_GET['link']==1){echo"You are not using mod_rewrite";}
elseif($_GET['link']==2){echo"Congratulations!! Your Apache mod_rewrite test is successful";}
else{echo"Linux Apache mod_rewrite Test";}
//make it url as by href method.
"rewrite.php?link=1"LINK1 = rewrite.php?link=1
"link2.html"LINK2 = link2.html
save it as rewrite.php
Now write:
Options +FollowSymlinks
RewriteEngine On
RewriteRule ^link([^/]*).html$ rewrite.php?link=$1 [L]
and save it as .htaccess in the same directory.
Open rewrite.php in browser and click on link1, and then on link2. If you see the message "Congratulations!! Your Apache mod_rewrite test is successful", means that, its working.
In WINDOWS:
How to enable mod_rewrite module in apache in xampp, wamp?
1) Find the “httpd.conf” file under the “conf” folder inside the Apache’s installation folder.
2) Find the following line “#LoadModule rewrite_module modules/mod_rewrite.so” in the “httpd.conf” file.You can do this easily by searching the keyword “mod_rewrite” from find menu.
3) Remove the “#” at the starting of the line, “#” represents that line is commented.
4) Now restart the apache server.
5) You can see now “mod_rewrite” in the Loaded Module section while doing “phpinfo()”.

The rest of the testing is same as above.
ANL
Thursday, December 4, 2008
Round function
A simple post to show how to use round function in PHP.
Lets take a variable holding a number with decimals:
$number = 21.25116;
Now want to round this number to 3 decimal.
So:
$number = round($number,3);
echo $number;
The result will be something like: 21.251
If $number = 21.2569
then result will be: 21.257
If $number = 21.259652;
Then result will be: 21.26
ANL
Lets take a variable holding a number with decimals:
$number = 21.25116;
Now want to round this number to 3 decimal.
So:
$number = round($number,3);
echo $number;
The result will be something like: 21.251
If $number = 21.2569
then result will be: 21.257
If $number = 21.259652;
Then result will be: 21.26
ANL
Labels:
PHP
Sunday, November 30, 2008
openSUSE RC1 released for final testing
The first and only release candidate for openSUSE 11.1 is out and ready for final testing.
Some changes since 11.1 beta5:
* A new shorter distro license
* Linux kernel 2.6.27.7
* glibc 2.9
* Additional translations
* Amarok 2.0 RC 1
* Zypper 1.0.1
Live CD:
Direct Download Link for KDE
Direct Download Link for Gnome
Some changes since 11.1 beta5:
* A new shorter distro license
* Linux kernel 2.6.27.7
* glibc 2.9
* Additional translations
* Amarok 2.0 RC 1
* Zypper 1.0.1
Live CD:
Direct Download Link for KDE
Direct Download Link for Gnome
Labels:
Linux Distros
Thursday, November 27, 2008
Fedora 10 is OUT
The Fedora project has announced the release of Fedora 10.
Some major features in latest version:
- A new graphical boot system called Plymouth, designed to speed up the boot process by taking advantage of a new kernel mode setting feature.
- Increased hardware support for a vast array of web cams,
- Better handling of printers via both direct physical connections and networks.
- PackageKit, a software management tool that originally debuted in Fedora 9, has been extended in this release to provide on-demand codec software installation.
- Wireless connection sharing enables ad hoc network sharing.
- Virtualization storage provisioning for local and remote connections now simplified.
- SecTool is a new security audit and intrusion detection system.
- RPM 4.6 is a major update to the powerful, flexible software management libraries.
- Glitch free audio and better performance is achieved through a rewrite of the PulseAudio sound server to use timer-based audio scheduling.
- Better support for infrared remote controls makes them easier to connect and work with many applications.
- The paths /usr/local/sbin:/usr/sbin:/sbin have been added to the PATH for normal users, to simplify command-line administration tasks.
1 Live CD versions:
Direct Download link for Gnome desktop
Direct Download link for KDE desktop
Forum:
Fedora forum link
Some major features in latest version:
- A new graphical boot system called Plymouth, designed to speed up the boot process by taking advantage of a new kernel mode setting feature.
- Increased hardware support for a vast array of web cams,
- Better handling of printers via both direct physical connections and networks.
- PackageKit, a software management tool that originally debuted in Fedora 9, has been extended in this release to provide on-demand codec software installation.
- Wireless connection sharing enables ad hoc network sharing.
- Virtualization storage provisioning for local and remote connections now simplified.
- SecTool is a new security audit and intrusion detection system.
- RPM 4.6 is a major update to the powerful, flexible software management libraries.
- Glitch free audio and better performance is achieved through a rewrite of the PulseAudio sound server to use timer-based audio scheduling.
- Better support for infrared remote controls makes them easier to connect and work with many applications.
- The paths /usr/local/sbin:/usr/sbin:/sbin have been added to the PATH for normal users, to simplify command-line administration tasks.
1 Live CD versions:
Direct Download link for Gnome desktop
Direct Download link for KDE desktop
Forum:
Fedora forum link
Labels:
Linux Distros
Friday, November 21, 2008
linux basic commands
Every body know, that when you are using Linux, you have to use commands to do your stuffs.
But now-a-days most of the new distros are very polished and providing more GUI interface to perform the stuffs, but still we need commands for more than GUI for our work. Preferably i like to use bash(terminal) for most of the stuffs.
So if you want to do your stuffs by using commands. there are some websites providing these useful materials:
oreillynet
An A-Z Index of the Bash command line for Linux.
ANL
But now-a-days most of the new distros are very polished and providing more GUI interface to perform the stuffs, but still we need commands for more than GUI for our work. Preferably i like to use bash(terminal) for most of the stuffs.
So if you want to do your stuffs by using commands. there are some websites providing these useful materials:
oreillynet
An A-Z Index of the Bash command line for Linux.
ANL
Labels:
Learning Linux
Saturday, November 15, 2008
openSUSE 11.1 beta 5 is released.
Some good news from Novell, beta 5 of new 11.1 is released for testing purpose.
You can try it and report any bugs to Novell.
Direct links to download:
Kde4.x desktop Live CD
GNOME2.24 desktop Live CD
Best of luck.
Regards
ANL
You can try it and report any bugs to Novell.
Direct links to download:
Kde4.x desktop Live CD
GNOME2.24 desktop Live CD
Best of luck.
Regards
ANL
Labels:
Linux Distros
Thursday, November 13, 2008
Linux/Unix Cheat Sheets part-1
Are you new/intermediate to Linux and want to use the command based shell(terminal) for most of your work. So no worries, below are the best sites i find out.
Hope every body will find it useful.
1- Unix Toolbox
2- UNIX Tutorial for Beginners
3- Learning the shell
4- Learn Unix in 10 minutes
I will carry on my research, and will post more links as i got.
Regards
ANL
Hope every body will find it useful.
1- Unix Toolbox
2- UNIX Tutorial for Beginners
3- Learning the shell
4- Learn Unix in 10 minutes
I will carry on my research, and will post more links as i got.
Regards
ANL
Labels:
Learning Linux
Distribution Releases
November and December are going to be tight months for Linux guys, because a lot of distros are going to release their final versions.
Some of them are still in beta OR in RC versions, and some of them are already released. Ubuntu series is one of them, and Sabayon Linux 3.5.1 is the next one(released on 9th nov).
Some of the famous distros released versions:
1- Debian GNU/Linux 5.0 RC1 (released on 13th nov mean today)
2- SimplyMEPIS 8.0 Beta 5 (released on 2008-11-11)
3- Development Release: Linux Mint 6 RC1 (released on 2008-11-10)
4- OpenSolaris 2008.11 RC1 (released on 2008-11-09)
5- Solaris 10 10/08 (released on 2008-11-07)
I will update this page, whenever new releases came out.
So keep reading this blog for further updates.
Regards
ANL
Some of them are still in beta OR in RC versions, and some of them are already released. Ubuntu series is one of them, and Sabayon Linux 3.5.1 is the next one(released on 9th nov).
Some of the famous distros released versions:
1- Debian GNU/Linux 5.0 RC1 (released on 13th nov mean today)
2- SimplyMEPIS 8.0 Beta 5 (released on 2008-11-11)
3- Development Release: Linux Mint 6 RC1 (released on 2008-11-10)
4- OpenSolaris 2008.11 RC1 (released on 2008-11-09)
5- Solaris 10 10/08 (released on 2008-11-07)
I will update this page, whenever new releases came out.
So keep reading this blog for further updates.
Regards
ANL
Labels:
Linux Distros
Tuesday, November 11, 2008
Explode Function
So here we go for the 1st post in this blog.
Explode function, i think many of us already know of this function.
Explode is very useful function, when it comes to breaking up lines or words.
There are several ways to use this function.
I will give some examples, that how to use it.
lets assume that you stored datetime in database as datetime. the way your date looks is:
But now you want, to breakup the date and time into two parts.
So lets break it:
The above code already break your datetime into 2 parts now lets echo it as it is in array.
The 1st echo will give you just date: 2008-11-11
The 2nd echo will print just time: 12:25:20
You can break this into more parts, if you want, like seconds, minutes, hours and same with date.
For example lets break time.
I will also extend this to the other post later "Calculating Unix time in PHP (part-1)". which is here: Link
Regards
ANL
Explode function, i think many of us already know of this function.
Explode is very useful function, when it comes to breaking up lines or words.
There are several ways to use this function.
I will give some examples, that how to use it.
lets assume that you stored datetime in database as datetime. the way your date looks is:
2008-11-11 12:25:20
But now you want, to breakup the date and time into two parts.
So lets break it:
$date = "2008-11-11 12:25:20";
$datetime = explode(" ",$date);
The above code already break your datetime into 2 parts now lets echo it as it is in array.
echo $datetime[0]; For date
echo $datetime[1]; For time
The 1st echo will give you just date: 2008-11-11
The 2nd echo will print just time: 12:25:20
You can break this into more parts, if you want, like seconds, minutes, hours and same with date.
For example lets break time.
$time = explode(":",$datetime[1]);
echo $time[0]; For hours
echo $time[1]; For minutes
echo $time[2]; For seconds
I will also extend this to the other post later "Calculating Unix time in PHP (part-1)". which is here: Link
Regards
ANL
Labels:
PHP
Monday, November 10, 2008
Welcome to my new blog
Welcome to ANL4U Softworks. After successfully maintaining my personal blog, i fell that to launch a new blog, which will be just for programming and Linux. Firstly i will concentrate on PHP and MySQL and as well Linux, and hopeful that it will be useful for new comers to PHP and experts as well. Linux is my choice OS, so i will also put updates in this blog. But as i am too busy, so its not possible for me to maintain all my blogs. But i hope, i can. So for time being i will concentrate on this blog and as well my personal blog. Sorry, i will be not able to update my personal blog with any programming stuffs from now.
So keep reading this blog for programming and linux stuffs.
Regards
ANL
So keep reading this blog for programming and linux stuffs.
Regards
ANL
Labels:
Blog News
Subscribe to:
Posts (Atom)