Escolar Documentos
Profissional Documentos
Cultura Documentos
localhost
I changed it to:
127.0.0.1
localhost
192.168.1.2 my.freedomain.com
To quickly view your own internal IP on the network double click on the
network icon in your system tray (far right, looks like 2 computer
monitors flashing), Support tab, will state 'IP Address: 192.168.2' or
whatever yours is.
XAMPP NOTES:
````````````
1. Apache configuration file is here: D:\xampp\apache\conf\httpd.conf
2. When ever you edit a server configuration file you must restart the
server; stop then start Apache not refresh the
Control Panel to have the edits recognized.
3. Error log is here: D:\xampp\apache\logs\error.logs
4. If you get this error: "Warning: include(lang/jp=.php)
[function.include]: failed to open stream: No such file or directory in
D:\xampp\htdocs\xampp\index.php on line 12"
Fix it like this:
Open 'lang.tmp' here: \xampp\htdocs\xampp\lang.tmp in your text editor and
type en on the first line (if your language is English) then
save.
If you don't have this file create a blank file and name it lang.tmp as
XAMPP will ask you for your language again.
5. For convenience I have:
a. mysql_start.bat & xampp-control.exe start at computer startup.
b. Have made a shortcut on my tool bar for D:\xampp\mysql_stop.bat &
D:\xampp\xampp-control.exe. You need to use mysql_stop.bat to properly
shut down mysql, for example every reboot. You'll need xampp-control.exe
often when making changes to config files.
NAVIGATING:
```````````
The root of website is 'htdocs'. Below are example treepaths:
FILE IS HERE
URL IS
D:\xampp\htdocs\
D:\xampp\htdocs\mewbies\
http://localhost/
http://localhost/mewbies/
D:\xampp\htdocs\xampp\mewbies\
http://localhost/xampp/mewbies/
D:\xampp\htdocs\xampp\index.php
http://localhost/xampp/index.php
etc.
SETTING HOMEPAGE:
`````````````````
If you want your homepage to be: http://yoursite.com
1. Copy over to somewhere safe first, and then remove everything in
'htdocs' except the 'xampp' directory.
2. Place your index.html in there; D:\xampp\htdocs\index.html
3. To access your Admin page you will now need to use the default URL:
http://localhost/xampp/index.php. The 'button' on the xampp-control.exe
for the Admin page will no longer be able to access that. Instead the
Admin button will now open your homepage.
If you leave the index.php file in the htdocs dir the control panel
application button will still open the Admin page, but the direct URL will
not open your site, it will open the Admin page. I'm sure you can set that
in apache correctly if you want to leave index.php there so your control
panel button still works on it. I didn't bother, see below for a method.
Change it to:
DocumentRoot "D:/xampp/htdocs/mewbies"
Changed it to:
<Directory "D:/xampp/htdocs/mewbies">
*But your default bookmark for Admin page will not work any longer. You'll
have to either find that path for it and make new bookmark as it will try
to open: D:/xampp/htdocs/mewbies/xampp as that has been set as home.
Or you could edit that file to point correctly. in xampp/htdocs/index.php
Has:
<?php
if (!empty($_SERVER['HTTPS']) && ('on' == $_SERVER['HTTPS'])) {
$uri = 'https://';
} else {
$uri = 'http://';
}
$uri .= $_SERVER['HTTP_HOST'];
header('Location: '.$uri.'/xampp/');
exit;
?>
</Directory>
Change to:
<Directory "D:/xampp/htdocs">
Options -Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
deny from 207.226.175.210
deny from 207.226.176.*
</Directory>
That will now deny anyone with that 1st IP and anyone in the 2nd IP's
range. They will receive a 403 error. To send them off to another location
use a 'Rewrite'.
This is what I did. I have on my D drive (same drive I have xampp on)
another directory that I want my users to have access to and I don't want
to copy the contents over to my D:\xampp folders.
If it's on another Drive, just add the drive in the path, like this:
Alias /gfx F:/MyStuff/graphics/large/wallpaper
<Directory F:/MyStuff/graphics/large/wallpaper>
Options Indexes
Order allow,deny
Allow from all
</Directory>
*Note alias '/gfx' is what the user will enter in the URL to access that
path. It can be anything you like.
Change to:
ServerAdmin admin@localhost
ServerName mydomain.com:80
RewriteEngine on
Or to only have https on a certain area of your site for example directory
named 'mewbies' enter settings like this for the above:
RewriteRule ^/(mewbies.*) https://your.site.com/$1
SECURITY TIPS:
``````````````
For 'Ten Tips Securing Apache' read HERE. This is what I did for what
applied to my installation and some others:
1 .(3) DON'T GIVE AWAY PROGRAM INFORMATION:
Why give away information that could potentially help a newbie hacker.
Make them work a little more for it :p. If I were to go to a non existing
URL on my site (not this site) I would see something like this:
Not Found
The requested URL /testing was not found on this server.
Change to:
ServerTokens Prod
ServerSignature Off
You of course could make a custom error page to redirect users to as well.
Change to:
Listen my.domain.com:80
To:
ServerName yourdomain.com:80
*Note doing this I have noticed that on the Admin Page I'm now not able to
open: security page, cd collection, phonebook, or mercury mail. I get this
error: FORBIDDEN FOR CLIENT 192.168.1.2 or Access forbidden! Error 403.
Has this:
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
</Directory>
Change to:
<Directory />
Options None
AllowOverride None
Order deny,allow
Deny from all
</Directory>
exit, save, restart apache, make sure all is in order and check your
error.log.
Has: KeepAliveTimeout 5
Change to: KeepAliveTimeout 2
150
MaxClients
50
50
5
PHP - you'll need to change the settings for upload max size as well to
match your above settings:
When editing .ini files I open them with WordPad, edit, then save not by
file/save (which will corrupt the file) but close it via the red X and
select Yes.
Edit this file: D:\xampp\php\php.ini
Has this:
; Maximum allowed size for uploaded files.
upload_max_filesize = 64M
post_max_size = 64M
But I do have some directories that I want to allow users to browse. For
example if I want users to be able to browse a directory named 'files':
Add this below the first one:
<Directory "D:/xampp/htdocs/files">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
Test this by making a directory in your website, copy over a file into
that new directory, then go to that URL. You will now be denied.
TROUBLE SHOOTING:
`````````````````
1. XAMPP Directory Mismatch Warning
If you get this warning after starting xampp-control.exe - the XAMPP
Control Panel:
Current Directory: D:\xampp
Install Directory:
*** WARNING: Directory mismatch ***
Status Check OK
//----------------------------------------------------------------------
- mewbies.com -