RSSAll Entries Tagged With: "apache"

How to enable SuPHP ?

Issue : How to enable SuPHP ? Solution : Login to WHM. Go to “Service Configuration >> Apache Configuration >> Configure PHP and Suexec” and check if SuPHP is available in the drop down menu. If it is available then select it and save the configuration after a dry run. SuExec should also be available [...]

  • Share/Bookmark

Changing /cpanel to something else

Issue : How can you access cPanel like, say, http://domainname.com/xyz ? This is for security purposes. Solution : This can be done but not recommended as it would not be of much effect security-wise. Even if you change it, cPanel/WHM would still run on the standard ports (2082/2083 & 2086/2087) which is known to everyone. [...]

  • Share/Bookmark

htaccess redirect for SSL non-www to www

Issue : Need to redirect https://domain.com to https://www.domain.com for SSL purposes. Solution : Use the following code in the htaccess file under the public_html folder for the concerned domain : RewriteEngine On RewriteCond %{HTTP_HOST} ^domain.com [NC] RewriteRule ^(.*)$ https://www.domain.com/$1 [L,R=301]

  • Share/Bookmark

Setting Apache Time out for a single domain

Issue : How to change Apache Time Out for a single website ? Solution : Even though Apache Timeout is a global environment directive, you can still change that for a single domain by modifying the corresponding VirtualHost entry for the domain. It should look something like this : ServerName domainname.com ServerAlias www.domainname.com DocumentRoot /home/user/public_html [...]

  • Share/Bookmark

Security concerns in executing binary files

Issue : An application requires execution of a binary file. A separate account has been created but do not want to turn on the exec() function citing security concerns. What is the best way to go about this ? Solution : If it is a php suexec server then you can place a custom php.ini [...]

  • Share/Bookmark

Apache not starting after a fresh cPanel install

Issue : On a brand new server with a clean cPanel install, apache does not want to start. root@server [~]# service httpd start Syntax error on line 416 of /usr/local/apache/conf/httpd.conf: UserDir “enable” keyword requires a list of usernames root@server [~]# Fix : This usually happens when Apache mod_userdir Tweak is enabled in WHM before adding [...]

  • Share/Bookmark

cPanel default page after IP migration

Issue : After the migration of IPs between two servers, sites are coming up with the default cPanel page. Solution : This can be due to an IP mismatch. Make sure that the DNS records and the Apache VirtualHost for the domains are configured on the same IP. Check the IP in “WHM >> Show [...]

  • Share/Bookmark

Changing the holding page for apache

Issue : When accessing the IP, it brings up the apache/cPanel success page instead of the website. Solution : If it is a shared IP then apache serves that generic page which is the default. You can manually change that by editing /usr/local/apache/htdocs OR In newer versions of cPanel, you can do that via WHM [...]

  • Share/Bookmark

Domain not accessible by IP/~username

Issue : The DNS has not yet propagated. Meanwhile, need to access the account via serverIP/~username but it does not work. Fix : 1. Log in to the server WHM as ‘root’. 2. Go to Main >> Security Center >> Apache mod_userdir Tweak. 3. Make sure that it is allowed for the particular domain and/or [...]

  • Share/Bookmark

Pointing a sub-domain to folder outside public_html

Issue : When you create a sub-domain, cPanel points it to the corresponding folder under public_html by default. How to point it to a folder outside the public_html? Solution : This cannot be done via cPanel/WHM but can be achieved if you have ‘root’ SSH access to the server. 1. Open the apache configuration file [...]

  • Share/Bookmark

Enabling the PHP extension–FreeType

Issue : How to enable the PHP extension–FreeType on a server running cPanel/WHM and apache? Solution : You need to re-compile apache and php with freetype . This can be done via the command line or through WHM. Command line : Run /scripts/easyapache and select “ttf” for freetype. WHM: You can enable freetype via WHM [...]

  • Share/Bookmark

Redirecting every page on the website to index.html

Issue : While some construction is going on the site, all pages on the website should go to the index page. Solution : This can be easily achieved by using the following code in your .htaccess file : < IfModule mod_rewrite.c > RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.html [...]

  • Share/Bookmark

Disabling /whm and /cpanel for all domains except the hostname

Issue : How to disable access to /whm and /cpanel for all domains except the server hostname? Solution : This would need customization of the httpd.conf file. First, edit the httpd.conf and remove any lines pertaining to forwarding of domains to /cpanel and /whm. Secondly, run the following command to distill the file : /usr/local/cpanel/bin/apache_conf_distiller [...]

  • Share/Bookmark

htaccess code for redirecting www to non-www

Issue : Regardless of somebody accessing the site with or without the ‘www’ , it should always go to http://domain.com Solution : Use the following htaccess code : RewriteEngine on RewriteCond %{HTTP_HOST} ^www.domain.com RewriteRule ^(.*) http://domain.com/$1 [R]

  • Share/Bookmark

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]

  • Share/Bookmark
Get Adobe Flash playerPlugin by wpburn.com wordpress themes