no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
Previous revisionLast revision | |||
— | appwiki:xampp [2024/04/14 15:55] – [configure file] ying | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== XAMPP Quick Setup walkthrough ====== | ||
+ | **Official Method** | ||
+ | * download and install XAMPP | ||
+ | * open xampp-control software, and run Apache server and SQL server | ||
+ | * open http:// | ||
+ | * open http:// | ||
+ | * check password.txt in the install directory for defaut SQL server password and ftp password | ||
+ | * now you can start work on your web project in htdoc directory under install directory | ||
+ | * http:// | ||
+ | |||
+ | **Portable Method** | ||
+ | * download portable version, either 7z, zip, or installer version of portable | ||
+ | * https:// | ||
+ | * run setup_xampp.bat to tell XAMPP the current correct directory for its structure | ||
+ | * run the xampp-control.exe, | ||
+ | |||
+ | **Default Password for MySQL** | ||
+ | * it is under xampp folder, password.txt file | ||
+ | |||
+ | **Create a Database for Wordpress site** | ||
+ | * name as wp_test01, collation as choice, create | ||
+ | ====== xampp setup ====== | ||
+ | Download from http:// | ||
+ | |||
+ | click on the xampp-control application to go. | ||
+ | start web < | ||
+ | start sql < | ||
+ | start web < | ||
+ | start sql < | ||
+ | ===== auto start on startup ===== | ||
+ | * windows: simple, put shortcut in windows startup folder | ||
+ | * mac: (2 methods) | ||
+ | * ref: http:// | ||
+ | * do shell script "sudo / | ||
+ | * linux | ||
+ | |||
+ | ===== Linux LAMPP install guide===== | ||
+ | |||
+ | in Linux, extract the LAMPP with sudo, or "MySQL couldn' | ||
+ | |||
+ | <code bash> | ||
+ | |||
+ | # or if you want to extract here | ||
+ | sudo tar xvfz xampp-linux-1.7.3a.tar.gz | ||
+ | </ | ||
+ | |||
+ | |||
+ | |||
+ | ===== Access from local and LAN network ===== | ||
+ | |||
+ | Enter in Browser like | ||
+ | < | ||
+ | or | ||
+ | < | ||
+ | or | ||
+ | < | ||
+ | ===== configure file ===== | ||
+ | |||
+ | ^Apache configuration |/ | ||
+ | ^Apache logs | / | ||
+ | ^PHP configuration |/ | ||
+ | ^MySQL configuration |/ | ||
+ | |||
+ | * enable PHPZip module for php < | ||
+ | * remove ; from < | ||
+ | ====== xampp customize htdoc location path ====== | ||
+ | |||
+ | - go to directory : xampp/ | ||
+ | - backup httpd.conf; | ||
+ | - edit httpd.conf, search and replace " | ||
+ | # DocumentRoot "/ | ||
+ | DocumentRoot "/ | ||
+ | </ | ||
+ | - and search and replace the < | ||
+ | # < | ||
+ | < | ||
+ | </ | ||
+ | - server root (optional, only if yours apache server not working, just check path to apache server) < | ||
+ | # ServerRoot "/ | ||
+ | ServerRoot "/ | ||
+ | </ | ||
+ | - to add extra directory into server alias list, means, you can ask apache server to use a short name to find other directory on your computer. | ||
+ | * basically, when people use url ServerName/ | ||
+ | * here is example code to add in httpd.conf, and shut down and restart server to make it work < | ||
+ | < | ||
+ | Require all granted | ||
+ | </ | ||
+ | Alias /web2 "/ | ||
+ | </ | ||
+ | * if you want allow htaccess for url rewrite, make sure like this < | ||
+ | < | ||
+ | AllowOverride All | ||
+ | Require all granted | ||
+ | </ | ||
+ | Alias /web2 "/ | ||
+ | </ | ||
+ | * also make your rewrite module for php is loaded in httpd.conf < | ||
+ | |||
+ | |||
+ | ====== xampp customize local domain for a local web path ====== | ||
+ | |||
+ | Steps: | ||
+ | - use hosts file to point the domain to local 127.0.0.1, example " | ||
+ | 127.0.0.1 | ||
+ | 127.0.0.1 | ||
+ | </ | ||
+ | - in xampp/ | ||
+ | < | ||
+ | DocumentRoot "/ | ||
+ | ServerName test.com | ||
+ | < | ||
+ | Order allow,deny | ||
+ | Allow from all | ||
+ | </ | ||
+ | ServerAlias www.test.com | ||
+ | ErrorLog " | ||
+ | CustomLog " | ||
+ | </ | ||
+ | < | ||
+ | DocumentRoot "/ | ||
+ | ServerName localhost | ||
+ | </ | ||
+ | </ | ||
+ | - now, restart apahce server, type " | ||
+ | - extra tips: | ||
+ | - for wordpress install at that path, it will pop up ask database server setting in wordpress initial step, | ||
+ | - since wordpress alone dont create database for itself, you need go http:// | ||
+ | - then, continue wordpress db connection with the db name you created, default db for xampp is root/no pass. rest as default should finish wordpress initialization | ||
+ | ====== xampp customize http broadcast port ====== | ||
+ | - edit xampp/ | ||
+ | - search and replace " | ||
+ | - and search and replace " | ||
+ | |||
+ | ====== Security and Site Protection ====== | ||
+ | |||
+ | ===== Blocking " | ||
+ | |||
+ | ref: http:// | ||
+ | RewriteCond %{HTTP_REFERER} smackingdomain.com | ||
+ | RewriteRule .+ [F] # Return 403 Forbidden | ||
+ | RewriteRule .+ http:// | ||
+ | |||
+ | ===== Set Security for XAMPP ===== | ||
+ | |||
+ | * run command in terminal: < | ||
+ | |||
+ | ref: http:// | ||
+ | |||
+ | ====== MySQL Server Guide ====== | ||
+ | |||
+ | * MySQL database server configuration is stored in the " | ||
+ | * the server user is stored in DB: " | ||
+ | * phpmyadmin control panel system is a front interface for the database server | ||
+ | |||
+ | ^ tables ^ MySQL access control ^^^ | ||
+ | ^ user | host name + user name + password | select, | ||
+ | ^ db | database level access control | | ||
+ | ^ table priv | table level access control | | ||
+ | ^ columns_priv | column level access control | | ||
+ | ^ procs_priv | procs access control | | ||
+ | |||
+ | |||
+ | |||
+ | * <code sql>SHOW GRANTS FOR ' | ||
+ | |||
+ | * limits of MyServer server: | ||
+ | * A password applies globally to an account. You cannot associate a password with a database, table | ||
+ | |||
+ | |||
+ | ====== Error and Solution====== | ||
+ | |||
+ | * error: Apache cant start, | ||
+ | * solution 1: run setup_xampp.bat after copy, to auto set root directory correctly | ||
+ | * solution 2: make sure the website folder that defined in \xampp\apache\conf\httpd.conf portion DocumentRoot directory exists. | ||
+ | * also check httpd.conf and change to 82 if 80 port in use. | ||
+ | * solution 3: just go to \xampp\apache\logs folder, and delete all 4 files, so it can generate itself again. | ||
+ | * solution 4: run with admin rights | ||
+ | * error: MySQL cant start, access right | ||
+ | * solution: delete the file that has no access right | ||
+ | * error: php time out, especially when do install type of script | ||
+ | * go php.ini configure file, and search and update " | ||
+ | * error: upload failed | ||
+ | * make sure php.ini allow the big size upload, search and replace these 2 line in php.ini from configure button menu < | ||
+ | post_max_size = 50M</ |