RSSAll Entries Tagged With: "apache"

htaccess code for forwarding a domain

Issue : The old domain ( with and without ‘www’ ) needs to be forwarded to a sub-folder of the new domain. Solution : Use the following htaccess code : RewriteEngine on RewriteCond %{HTTP_HOST} ^olddomain\.com$ [OR] RewriteCond %{HTTP_HOST} ^www\.olddomain\.com$ RewriteRule ^(.*)$ http://newdomain.com/folder/$1 [R=permanent,R]

Cannot upload unless permissions are set to 777

Issue : WordPress installed on a cPanel server. Cannot upload images using WP unless the “uploads” directory is set to “777″ which poses serious security threats. Solution : The reason is that WordPress is running PHP as a DSO (Apache Module) which insecurely runs all scripts commonly under the global username “nobody”. Since your WordPress [...]

500 error when using php_value/php_flag

Issue : When trying to turn ‘register_globals’ ON by adding a statement “php_flag register_globals on ” in the .htaccess, following error appears on the website: “A 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request” Apache error log says: .htaccess: Invalid command ‘php_flag’, perhaps mis-spelled or defined [...]

Preserving httpd.conf during EasyApache

Issue : The apache configuration file (httpd.conf) has several custom entries which should not be over-written when an EasyApache is done for recompiling/adding a PHP/Apache extension. Solution : Starting with cPanel 11.x, all the apache settings are also stored in a database and the configuration files are recreated each time an account is added or [...]

How to de-activate lighthttpd and activate apache?

Issue : How to de-activate lighthttpd and activate apache? Solution : SSH into the server as ‘root’ and run the following commands : /etc/init.d/lighttpd stop chkconfig lighttpd off chkconfig httpd on /etc/init.d/httpd start

Apache2 proxy to local port

Make few changes to your VitualHost entries for the domain (cpanel.domain.com and webmail.domain.com) so that you needn’t install cpanel proxy on the server to access the cPanel and webmail via the ports 2082 and 2095. This will let you access cPanel and webmail at port 80. For cPanel: Add the following entries in the VirtualHost [...]

Redirecting to secure connection

Issue : When someone tries to access the site through the insecure URL (http) , it should redirect ( to https ) automatically. Fix : This can be easily achieved by putting the following code in the .htaccess file under ‘public_html’ folder : RewriteEngine On RewriteCond %{SERVER_PORT} !^443$ RewriteRule ^(.*)$ https://www.yourdomainname.tld/$1 [L,R] (Assuming that you [...]

mod_security: Access denied error code 403

Error : You might come across the following error in the apache error logs : mod_security: Access denied with code 403. Error reading request body, error code 70007: The timeout specified has expired Fix : 1. Open the Apache configuration file. root@server1 [~]#vi /usr/local/apache/conf/httpd.conf 2. Change the Timeout value to 300 # Defined in /var/cpanel/cpanel.config: [...]

Can not publish large articles (more than 500 words) in Media Wiki

Issue : Unable to publish large articles , say more than 500 words, in Media Wiki. Changing the upload limit doesn’t resolve the issue. Nothing appears in apache error logs either. Fix : Try to publish the article and check the /var/log/messages. [root@localhost ~]#tail -f /var/log/messages | grep domain Mar 5 15:11:57 server12 suhosin[4451]: ALERT [...]

Security Issue : Apache info being displayed on non-existent pages

Issue : When an user tries to access a non-existent page or when a new account is created and no index page is uploaded then the following information can be viewed : Apache/2.0.63 (Unix) mod_ssl/2.0.63 OpenSSL/0.9.8e-fips-rhel5 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 PHP/5.2.8 Server at domain.com Port 80 Fix : Disable the Server Signature via WHM >> Main [...]

Disabling open_basedir and mod_security for a specific domain

Issue : Mod_security and open_basedir needs to be disabled for a specific domain but they are enabled in the server configuration. Solution : To disable mod_security , just get into the .htaccess file for the domain and put the following code in it : SecFilterEngine Off SecFilterScanPOST Off To disable open_basedir , add the following [...]

Tutorial on clearing Disk Space on a Server

Running out of disk space is a very common issue.  Be it a web-hosting service provider or the end-user.  I wanted to share a few tips that the technical support staff  at InstaCarma use to resolve disk-space issues on a cPanel server. As we all know, there are various partitions on a server which are [...]

Apache error : “Too many open files (errno: 24)”

Issue : When attempting to start Apache,if you get the following errors :- [error] mod_ssl: Child could not open SSLMutex lockfile /usr/local/apache/logs/ssl_mutex.16479 (System error follows) [error] System: Too many open files (errno: 24) Fix : This is caused by Apache and RedHat setting their open file limits too low. To correct this you will need [...]

Common Apache and related errors

400 – Bad request What does it mean? There’s something wrong with the URL you typed. Maybe the server you’re contacting doesn’t recognize the document you’re asking for, maybe it doesn’t exist, or maybe you’re not authorized to access it. What can you do about it? Check the URL. Pay special attention to uppercase and [...]

Log cleaner script

This script will clear the apache logs, cpanel logs and the logs in /var. It will take a zipped backup before clearing logs. #!/bin/bash # Script to Clear Logs echo “Clearing Logs in /var…..” cd /var/log for i in `ls -lSh /var/log|grep -v gz|grep “\-rw”|head -15|awk {‘print $9′}` do cp -p “$i” “$i”.bak echo “”>$i [...]

Get Adobe Flash playerPlugin by wpburn.com wordpress themes
InstaCarma provides outsourced web hosting technical support, helpdesk management, datacenter automation, cloud service management. Sales - 1800 810 6547 - visit www.instacarma.com