Archive

Archive for the ‘Apache , htaccess and Front Page’ Category

Where can i find SSL certificate files on server ?

October 6th, 2009

If domain is having SSL certificate you can find following files in folders.

CRT : /etc/ssl/certs/www.domain.com.crt
RSA KEY : /etc/ssl/private/www.domain.com.key
CSR : /etcssl/certs/www.domain.com.csr
CA File : /usr/local/apache/conf/ca.txt ( optional )

Apache , htaccess and Front Page

How to check Apache log files ?

October 6th, 2009

font=Arial]APACHE LOG FILES[/font]

In order to effectively manage a web server, it is necessary to get feedback about the activity and performance of the server as well as any problems that may be occuring. The Apache HTTP Server provides very comprehensive and flexible logging capabilities.

Apache maintains two log files namely Error_log and access_logs

Error_log >>>> /usr/local/apache/logs/error_log
Access_log >>>> /usr/local/apache/logs/access_log

You can see more recent errors or entries from log files by entering following command at root prompt.

tail -20 /usr/local/apache/logs/error_log << displays last 20 entries
tail -200 /usr/local/apache/logs/access_log <<< Last 200 entries.

A very wide variety of different messages can appear in the error log. Most look similar. The error log will also contain debugging output from CGI scripts. Any information written to stderr by a CGI script will be copied directly to the error log.

Note: Always check apache logs to resolve apache issues and save time

Apache , htaccess and Front Page

Front Page not working and getting 500 error

October 6th, 2009

To fix Front Page problem completely. I mean service.pwd file issue.
Login to WHM >> Update config >> Select cpanel update MANUAL RELEASE TREE
Then login to Shell and do

/scripts/upcp

The above fucntions will upgrade cpanel to
WHM 9.9.3 cPanel 9.9.6-R10

Cpanel 9.9.6-R10 fixes Front Page service.pwd wrong permissions problem.

If you are still getting problem, Then try following commands one by one.

/scripts/updatenow
/scripts/initfpsuexec
/scripts/fp-auth

Apache , htaccess and Front Page

Dealing with 509 Bandwidth Limit Exceeded errors

October 6th, 2009

“509 Bandwidth Limit exceeded error” occurs when the bandwidth allocated to an account exceeds.

At that time the cPanel creates an empty file by that domain name in the /var/cpanel/bwlimited directory.

To view such sites please do the following

1) Go to the /var/cpanel/bwlimited directory

2) And remove the file which has name of his domain or subdomain .

But see to it that you touch those files again and ask the client to purchase additional bandwidth.

Apache , htaccess and Front Page

SSL checking

October 6th, 2009

To view the contents of a certificate:

cd /etc/ssl/certs


openssl x509 -noout -text -in filename.crt

To view the contents of a private key:


cd /etc/ssl/private

openssl rsa -noout -text -in filename.key

If the modulus number and exponent of the cert and key match,
they are paired correctly. If not, they are mismatched and apache
will not start with ssl enabled.

To view the contents of a csr file:

openssl req -noout -text -in filename.csr

Apache , htaccess and Front Page

Adding FrontPage users and determining their access

October 6th, 2009

If you have your web site set up in Microsoft’s FrontPage, it is not difficult to add more users, and arrange their individual access, to your web site using FrontPage itself. Depending on your user’s requirements YOU can specify their access ‘permissions’.

There are 3 types of access open to FrontPage users, permissions to:

Browse — the user can browse the files in the web (read access only).

Author — the user can browse and change the files in a web (read and write access only).

Administer — the user can browse and change the files in the web; but, can also administer the web by adding and removing users (full access).

Instructions are as follows:

1. Open FrontPage and open your web site.

2. Log in as one of your ‘administrative’ FrontPage users.

3. Go to the Tools in the menu, select Security and click on Permissions.

4. Click on the Users tab.

5. Click on the Add button.

6. Select the User from the Names box and click on the Add button. The user should now be listed in the Add names box.

7. Specify the type of access to give the user (Browse, Author or Administer).

8. Click on the OK button.

9. The FrontPage user will now be created

Apache , htaccess and Front Page

Checking http connections.

October 6th, 2009

To check http connections on a server that is having high number of httpd processes running you can check that from the shell itself there is no need to login into WHM.

Just give the command :

service httpd fullstatus

This will provide the similar output as of the WHM.

If you get error as :

Not Found

The requested URL /server-status was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to
use an ErrorDocument to handle the request.

Then do the following :

1) open the httpd.conf file

2) Find the following lines

#<Location /server-status>
# SetHandler server-status
# Order deny,allow
# Deny from all
# Allow from .example.com
#</Location>

Uncomment them and also change the Allow line to “Allow from localhost”.

3) Save and restart the httpd

Now you can check connections from shell itself.

Note You need to have mod_status enabled on the server for the above command to work.

And similarly to check the mysql connections you can use the following commands:

mysqladmin processlist

OR

mysqladmin proc

Always try to get rid of WHM/cPanel and try to do the same thing in shell and become more productive by using it.

Apache , htaccess and Front Page

HTTP Error 302 - Moved temporarily

October 6th, 2009

General cause of this following error.
“HTTP Error 302 - Moved temporarily”.

The 302 response from your Web server should always include an alternative URL to which redirection should occur. If it does, a Web browser will immediately retry the alternative URL. So you never actually see a 302 error in a Web browser, unless perhaps you have a corrupt redirection chain e.g. URL A redirects to URL B which in turn redirects back to URL A. If your client is not a Web browser, it should behave in the same way as a Web browser i.e. immediately retry the alternative URL.

If the Web server does not return an alternative URL with the 302 response, then either the Web server sofware itself is defective or your Webmaster has not set up the URL redirection correctly.
==============================

Resolving 302 errors - CheckUpDown
==============================

Redirection of URLs may occur for low-level URLs (specific URLs within your Web site such as www.isp.com/products/index.html) when you reorganise your web site, but is relatively uncommon for the top-level URLs (such as www.isp.com) which most CheckUpDown users ask us to check. So this error should be fairly infrequent.

The 302 response from your Web server should always include an alternative URL to which redirection should occur. If it does, CheckUpDown automatically tries the alternative URL. This in turn may possibly lead to another redirection which CheckUpDown then tries. This continues for a maximum of 5 redirections. As soon as 5 redirections have occurred, CheckUpDown gives up and reports the 302 error for your account. So you should only ever see the 302 error if 1) your Web server gives no alternative URL on the 302 response or 2) the number of redirections exceeds 5. This second condition should be fairly unlikely - and may indicate a recursive pattern e.g. URL A redirects to URL B which in turn redirects back to URL A.

You first need to check that the IP name we use to check for your account is accurate. If you or your ISP have configured something so that any access using this name should now be redirected to another name, then you need to update your CheckUpDown account to start using the new name.

If you believe that the IP name we use is exact (should not be redirected), please try accessing the current URL using a Web browser. Note carefully which URL actually gets displayed, because your browser may silently switch to a substitute URL if it receives an 302 message from your Web server. If you see any evidence of a new URL, try accessing that directly from your browser. If this works (you see your Web site as expected), then this new URL is what you may need to update on your CheckUpDwon account. If this is a temporary redirection, then you may also need to reinstate the original IP name at a later date when the redirection is no longer effective.

If none of the above help, we can analyse the underlying HTTP data streams we receive from your Web server. These can provide additional information about the new URL(s) which your Web server thinks we should be accessing. Before doing this, we prefer you to identify any deliberate changes on your side, liaising with your ISP if needs be.

302 errors should occur infrequently, because top-level URLs do not change often. If they do change, then this is typically because a redirection URL is being suggested. This pervasive change is unlikely to occur by accident, so most often we can resolve this error by updating our system records for your account following a deliberate change of URL on your part, whether this change is temporary or permanent.
=====================================

Apache , htaccess and Front Page

Problems with mod_security and mod_security2

October 6th, 2009

If any client site having problems with mod_security rules we can add following directives to disable mod_security for his site.

Just add following lines to his virtual host entry :

<IfModule mod_security.c>
SecFilterEngine Off
</IfModule>

For mod_security2

<IfModule mod_security2.c>
SecRuleEngine Off
</IfModule>

Note: Mod_security implemented for good reason like preventing spamming through forms and to protect dos attacks. Don’t disable by if client request to disable it. we need to check what client is doing and what errors he is getting.

Apache , htaccess and Front Page

Apache modules

October 6th, 2009

Below is a list of all of the modules that come as part of the Apache distribution. For Apache modules that are not part of the Apache distribution, please see http://modules.apache.org

Core
Core Apache features
mod_access
Access control based on client hostname or IP address
mod_actions Apache 1.1 and up
Executing CGI scripts based on media type or request method
mod_alias
Mapping different parts of the host filesystem in the document tree, and URL redirection
mod_asis
Sending files which contain their own HTTP headers
mod_auth
User authentication using text files
mod_auth_anon Apache 1.1 and up
Anonymous user access to authenticated areas
mod_auth_db Apache 1.1 and up
User authentication using Berkeley DB files
mod_auth_dbm
User authentication using DBM files
mod_auth_digest Apache 1.3.8 and up
MD5 authentication
mod_autoindex
Automatic directory listings
mod_browser Apache 1.2.* only
Set environment variables based on User-Agent strings. Replaced by mod_setenvif in Apache 1.3 and up
mod_cern_meta Apache 1.1 and up
Support for HTTP header metafiles
mod_cgi
Invoking CGI scripts
mod_cookies up to Apache 1.1.1
Support for Netscape-like cookies. Replaced in Apache 1.2 by mod_usertrack
mod_digest Apache 1.1 and up
MD5 authentication (deprecated by mod_auth_digest)
mod_dir
Basic directory handling
mod_dld Apache 1.2.* and earlier
Start-time linking with the GNU libdld. Replaced in Apache 1.3 by mod_so
mod_env Apache 1.1 and up
Passing of environments to CGI scripts
mod_example Apache 1.2 and up
Demonstrates Apache API
mod_expires Apache 1.2 and up
Apply Expires: headers to resources
mod_headers Apache 1.2 and up
Add arbitrary HTTP headers to resources
mod_imap Apache 1.1 and up
The imagemap file handler
mod_include
Server-parsed documents
mod_info Apache 1.1 and up
Server configuration information
mod_isapi WIN32 only
Windows ISAPI Extension support
mod_log_agent
Logging of User Agents
mod_log_common up to Apache 1.1.1
Standard logging in the Common Logfile Format. Replaced by the mod_log_config module in Apache 1.2 and up
mod_log_config
User-configurable logging replacement for mod_log_common
mod_log_forensic
Forensic logging of requests made to the server
mod_log_referer
Logging of document references
mod_mime
Determining document types using file extensions
mod_mime_magic
Determining document types using “magic numbers”
mod_mmap_static Apache 1.3 and up
Experimental file caching, mapping files into memory to improve performance
mod_negotiation
Content negotiation
mod_proxy Apache 1.1 and up
Caching proxy abilities
mod_rewrite Apache 1.2 and up
Powerful URI-to-filename mapping using regular expressions
mod_setenvif Apache 1.3 and up
Set environment variables based on client information
mod_so Apache 1.3 and up
Support for loading modules (.so’s on Unix, .dll’s on Win32) at runtime
mod_speling Apache 1.3 and up
Automatically correct minor typos in URLs
mod_status Apache 1.1 and up
Server status display
mod_unique_id Apache 1.3 and up
Generate unique request identifier for every request
mod_userdir
User home directories
mod_usertrack Apache 1.2 and up
User tracking using Cookies (replacement for mod_cookies.c)
mod_vhost_alias Apache 1.3.7 and up
Support for dynamically configured mass virtual hosting

Apache , htaccess and Front Page