Posts by :
Run Apache virtual host with its own user and group ID’s
August 23rd, 2011If you want to run apache virtual host with its own user and group privileges. This module will make apache to access web contents with webcontent’s owner privileges. To do that you need mpm-itk module. You can download mpm-itk module from http://repo.webtatic.com/yum/centos/5/x86_64
#wget http://repo.webtatic.com/yum/centos/5/x86_64/httpd-itk-2.2.19-1.w5.x86_64.rpm
Install itk module in the server
#rpm -ivh httpd-itk-2.2.19-1.w5.x86_64.rpm
After installing stop apache service
#/etc/init.d/httpd stop
Then add the following line in /etc/sysconfig/httpd
HTTPD=/usr/sbin/httpd.itk
Then edit httpd.conf file and make changes to the domain’s Virtual host
entry as below
ServerName example.com DocumentRoot /path/to/web/root AssignUserId username groupname
After adding start apache services
#/etc/init.d/httpd start
then change ownership of the web path by following command
#chown username:groupname /path/to/webroot #chmod 710 /path/to/webroot
ls -al /path/to/webroot drwx--x--- /path/to/webroot
That is it. Now apache will access your website contents with your own username and group name.
Reference: http://www.webtatic.com/packages/httpd-itk/
Thank you for viewing helpinlinux.com
Cannot find autoconf. Please check your autoconf installation
August 11th, 2011Hi,
Are you trying to install php modules like pdo and getting the following error.?.
pecl install pdo WARNING: "pecl/PDO" is deprecated in favor of "channel://http://svn.php.net/viewvc/php/php-src/trunk/ext/pdo//ext/PDO" WARNING: channel "pecl.php.net" has updated its protocols, use "channel-update pecl.php.net" to update downloading PDO-1.0.3.tgz ... Starting to download PDO-1.0.3.tgz (52,613 bytes) .............done: 52,613 bytes 12 source files, building running: phpize Configuring for: PHP Api Version: 20041225 Zend Module Api No: 20060613 Zend Extension Api No: 220060519 Cannot find autoconf. Please check your autoconf installation and the $PHP_AUTOCONF environment variable is set correctly and then rerun this script. ERROR: `phpize' failed
then you can fix it by
# cd /usr/src # wget http://ftp.gnu.org/gnu/m4/m4-1.4.9.tar.gz # tar -zvxf m4-1.4.9.tar.gz # cd m4-1.4.9/ # ./configure && make && make install # cd ../ # wget http://ftp.gnu.org/gnu/autoconf/autoconf-2.62.tar.gz # tar -zvxf autoconf-2.62.tar.gz # cd autoconf-2.62/ # ./configure && make && make install
Then you can install pdo and pdo_mysql without any issues.
Source: http://www.spiration.co.uk/post/1385/Cannot-find-autoconf.-Please-check-your-autoconf-installation
Thank you for viewing helpinlinux.com
remove ubuntu from boot menu windows 7
July 17th, 2011Hi,
Is your computer still showing Ubuntu from boot menu even after uninstalling it.?. You can follow the below steps in your windows 7 so that it fix the issue.
– Click start
– Type: cmd
– Right-click cmd when it appears under Programs
– Click Run As Administrator
Once the prompt is up type bcdedit.exe
this will list all of the OS that start up in Windows Boot Manager
Once you have this list you use the command bcdedit.exe/delete file name corresponding to ubuntu boot record. The boot record may have path something like \ubuntu\winboot\wubuildr.mbr.
example: bcdedit.exe/delete {802d5e32-0784-11da-bd33-000476eba25f}
This will remove ubuntu’s menu from windows boot.
Source: http://answers.yahoo.com/question/index?qid=20100108062345AAXcdDi
shell script to backup mysql databases
July 7th, 2011Hi,
The following shell script will backup all the individual databases present in your server in .sql format and store it under /mysqlbackup folder. Make sure you have mysql databases in /var/lib/mysql and a folder with name /mysqlbackup. Set a cron to run this script once a day.
#!/bin/bash #Script for mysql database backup cd /var/lib/mysql for DBs in $(ls -d */ |tr -d /) do cd /mysqlbackup `mysqldump -u root -p'password' $DBs > $DBs.sql` done
Thank you for viewing helpinlinux.com.
delivery temporarily suspended connection timed out postfix
July 5th, 2011Hi,
If your mails are not delivering and you getting the following error then probably your firewall is blocking your relay host. You need to allow it.
before-remote[4463]: check handlers for addr: xxxx@yahoo.com postfix/smtp[4462]: 4099BBE815D: to=, relay=127.0.0.1[127.0.0.1], delay=0, status=sent (250 Ok: queued as 52B31BE815E) postfix/qmgr[32070]: 52B31BE815E: to=, relay=none, delay=0, status=deferred (delivery temporarily suspended: connect to d.mx.mail.yahoo.com[209.191.88.254]: Connection timed out)
Solution:
======
#/sbin/iptables -A INPUT -s 127.0.0.1 -j ACCEPT
This should fix the problem if not provide the following command also
#/sbin/iptables -A INPUT -d 127.0.0.1 -j ACCEPT
#/etc/init.d/iptables restart
Reference: http://forum.parallels.com/showthread.php?t=110411
Thanks for viewing helpinlinux.com
linux user login monitor script
June 29th, 2011
Hi,
Do you want an email alert if someone access your server.?. then you can follow the steps and execute the following script.
Create a file say file.txt and add the following contents to it.
#vi file.txt
echo 'ALERT - User `whoami` Shell Access on:' `date` `who` | mail -s "Alert: `whoami` Access from `who | awk '{print $6}'`" user@yourdomain.com
then execute the following script to make the file.txt contents to be copied to all user’s .bash_profile file.
#!/bin/bash
for file in $(find / -name .bash_profile)
do echo `cat file.txt` >> $file done
then add the line "echo 'ALERT - User `whoami` Shell Access on:' `date` `who` | mail -s "Alert: `whoami` Access from `who | awk '{print $6}'`" user@yourdomain.com" to "/etc/skel/.bash_profile" this will automatically add the above line to all the new user's .bash_profile file.
That’s it you will be noted through mail if someone logins to your server.
Thanks for viewing helpinlinux.com
Failed to retrieve directory listing filezilla
June 27th, 2011
Hi,
If you are receiving the following FTP error while connecting to the server then probably your server is missing the kernel module“ip_conntrack_ftp” and you need to install it.
Status: Connecting to xx.xx.xx.xx:21...
Status: Connection established, waiting for welcome message...
Response: 220 ProFTPD 1.3.3c Server (ProFTPD) [xx.xx.xx.xx]
Command: USER user
Response: 331 Password required for userCommand: PASS ********Response: 230 User user logged in Command: SYSTResponse: 215 UNIX Type: L8 Command: FEATResponse: 211-Features: Response: MDTM Response: MFMT Response: TVFS Response: MFF modify;UNIX.group;UNIX.mode; Response: MLST modify*;perm*;size*;type*;unique*;UNIX.group*;UNIX.mode*;UNIX.owner*; Response: REST STREAM Response: SIZE Response: 211 EndStatus: Connected Status: Retrieving directory listing... Command: PWDResponse: 257 "/" is the current directory Command: TYPE IResponse: 200 Type set to I Command: PASVResponse: 227 Entering Passive Mode (xx,xx,xx,xxx,xxx,xxx). Command: MLSD Error: Connection timed out
Error: Failed to retrieve directory listing
Steps to install “ip_conntrack_ftp”
#modprobe ip_conntrack_ftp
and add this module in
/etc/sysconfig/iptables-config
at
IPTABLES_MODULES="ip_conntrack_ftp"
#/etc/init.d/iptabes restart
Thats it, you can go for a tea.!.. 🙂
file size limit exceeded php
June 14th, 2011Hi.
If you get the following error while executing an php file.
[user@linux]#php index.php
Output
file size limit exceeded
Then probably you will have a php file with size more than 2GB inside that folder, the maximum file size of a php file that can be executed should be 2GB. You need to empty/move that file to a different folder or code that file so that its size comes under 2GB.
Thanks for viewing helpinlinux.com
shell script to delete /tmp files linux leaving eacclarator folder
April 10th, 2011Hi,
You can use this script to delete tmp files if the /tmp partition memory goes beyond 70 percent by leaving eacclarator folder alone,
#/bin/bash
#Script to delete tmp files except eacclarator
s=df -h |grep tmp | cut -d. -f1
if [ $s -gt 70 ];
then
if [ `ls /tmp |grep eacclarator |wc -l` -gt 0 ]; # will delete under eacclarator folder
then
rm -rf /tmp/eacclarator/*
/etc/init.d/httpd restart #to make eacclarator to recreate its default folders.
exit
fi
rm -f /tmp/*
exit
fi
script to notify high server load | linux script for monitoring server
April 10th, 2011
Hi,
The following is the script which will send mail to admin if the server’s load is more than 15, please enable cron to execute it frequently.
#!/bin/bash
SUBJECT="`hostname`server load is high"
TO=admin@yourdomain.com
uptime > /tmp/load
if [ `uptime | awk '{ print$11 }' | cut -d. -f1` -gt 15 ];
then
mail -s "$SUBJECT" $TO < /tmp/load
exit
fi
Thank you for viewing helpinlinux.com