Customize XAMPP

« Back :: Tagged with Apache :: MySql :: XAMPP ::

Some notes on how to customize XAMPP, mainly for Windows systems but could give a hint on how to do it on other systems as well.

Change www root

The default  web root in XAMPP, where your websites are located, is c:\xampp\htdocs. This can be change to a more suitable location. Note that I actually use XAMPPlite below, but the config is the same in the bigger brother XAMPP.

Browse to C:\xampplite\apache\conf and open httpd.conf in your favorite text editor. Around line 178 it says:

DocumentRoot "C:/xampplite/htdocs"

Change this line to reflect the location of your files. Now scroll down a bit to line 205 where it says:

<Directory "C:/xampplite/htdocs">

Change this to the same as what you set as your document root. If you use the cgi-bin folder you would also like to change those variables to reflect the new path. On line 324, change ScriptAlias /cgi-bin/ "C:/xampplite/cgi-bin/" to the new path, and also change <Directory "C:/xampplite/cgi-bin"> around line 332.

Save the file and restart Apache for the changes to be applied. A tip is also to copy the /xampp directory in your /htdocs to your new web root.

 

Change location of MySql data

The default location of the MySql databases are located in

C:\xampplite\mysql\data

If you want to store this data in another location, locate C:\xampplite\mysql\bin and open up my.ini. On line 31 change

datadir="C:/xampplite/mysql/data"

to wherever you have placed your mysql data files.

Important: In that same directory you have a couple of files called ib_logfile0, ib_logfile1, and ibdata1. These files needs to be renamed or deleted, otherwise it won't work.

Note: There is a possibility that you also have to rename your my.ini file to my.cnf. This file is located in the mysql \bin folder. When you rename it the extension .cnf will probably disappear. This is normal. In order to change the extension back you need to open a command prompt and cd into that directory and do type:

ren my.cnf my.ini

 

Enable sending of email on Windows systems

If the localhost option does not work for you, change the below smtp server to your current ISP's smtp server. Remember to restart Apache after you have made the changes for them to take effect.

In php.ini line 700-703:

[mail function]
; For Win32 only.
SMTP = smtp.ispdomain.com
smtp_port = 25

Comments

Anonymous @ February 27th, 2010 - 19:17

Thanks for the info!

Anonymous @ October 29th, 2010 - 05:43

Consider including some info on this too as sometimes, particularly those with XP Pro, they may have IIS already running under port 80, so in customizing they could change the ServerName and Listen ports for Apache to another number in the httpd.conf file.

Anonymous @ January 13th, 2011 - 17:35

Useful

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <blockquote> <blockcode> <pre> <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

Copyright © 2010 deuxcode.com
Powered by Drupal. Valid XHTML 1.0 Strict and CSS 2.1.