Tag Archives: Server

XAMP Change Localhost To Domain

Follow the below steps to Change localhost to custom domain name in XAMP server

1) Open the file C:\Windows\System32\drivers\etc and edit “as Administrator” => hosts file.

Add the below line and save the file.

127.0.0.1 phpcodez.com

2) Edit httpd-vhosts.conf file (In my system E:\xampp\apache\conf\extra and edit httpd-vhosts.conf )

Add the below lines and save the file

<VirtualHost *:80>
 ServerName www.phpcodez.com
 ServerAlias phpcodez.com
 DocumentRoot e:/xampp/htdocs/phpcodez
</VirtualHost>

3) Restart XAMPP and url www.phpcodez.com will load content form e:/xampp/htdocs/phpcodez

Change XAMPP Server Port

Follow the below steps to update the defalt port 80 apache XAMP Apache server

1) Stop the XAMPP server, if it is running already.

2) Open the file httpd.conf(In my case its E:\xampp\apache\conf\httpd.conf)

Locate

Listen 80
ServerName localhost:80

And replace with the other port number(8012)

Listen 8012
ServerName localhost:8012

3) Open the file httpd-ssl(In my system its E:\xampp\apache\conf\extra\httpd-ssl.conf)

Locate the following lines

Listen 443
<VirtualHost _default_:443>
ServerName localhost:433

Replace them by with a other port number(8013)

Listen 8013
<VirtualHost _default_:8013>
ServerName localhost:8013

4) Restart the Apache server and http://localhost:8012/ should work.

Apache mod_rewrite

This module uses a rule-based rewriting engine (based on a regular-expression parser) to rewrite requested URLs on the fly. It supports an unlimited number of rules and an unlimited number of attached rule conditions for each rule, to provide a really flexible and powerful URL manipulation mechanism. The URL manipulations can depend on various tests, of server variables, environment variables, HTTP headers, or time stamps. Even external database lookups in various formats can be used to achieve highly granular URL matching.

This module operates on the full URLs (including the path-info part) both in per-server context (httpd.conf) and per-directory context (.htaccess) and can generate query-string parts on result. The rewritten result can lead to internal sub-processing, external request redirection or even to an internal proxy throughput.

Apache CheckSpelling

This directive enables or disables the spelling module. When enabled, keep in mind that

  • the directory scan which is necessary for the spelling correction will have an impact on the server’s performance when many spelling corrections have to be performed at the same time.
  • the document trees should not contain sensitive files which could be matched inadvertently by a spelling “correction”.
  • the module is unable to correct misspelled user names (as in http://my.host/~apahce/), just file names or directory names.
  • spelling corrections apply strictly to existing files, so a request for the <Location /status> may get incorrectly treated as the negotiated file “/stats.html”.

mod_speling should not be enabled in DAV enabled directories, because it will try to “spell fix” newly created resource names against existing filenames, e.g., when trying to upload a new document doc43.html it might redirect to an existing document doc34.html, which is not what was intended.

Apache AliasMatch

This directive is equivalent to Alias, but makes use of regular expressions, instead of simple prefix matching. The supplied regular expression is matched against the URL-path, and if it matches, the server will substitute any parenthesized matches into the given string and use it as a filename. For example, to activate the /icons directory, one might use:

AliasMatch ^/icons(.*) /usr/local/apache/icons$1

Apache Alias

The Alias directive allows documents to be stored in the local filesystem other than under the DocumentRoot. URLs with a (%-decoded) path beginning with URL-path will be mapped to local files beginning with directory-path. The URL-path is case-sensitive, even on case-insensitive file systems.

Example:

Alias /image /ftp/pub/image