Tags: des blog http io os ar for SP files
Foreword: Recently work with Mac, need to build a debugging before the site of the program, choose XAMPP, Demand is able to run multiple sites at the same time, multiple domain names, directory customization, online to find a lot of information, feel some do not conform to the mind, and copy the text is indeed a lot, even some have not practiced in the confusion, can not meet my , so the success of their own configuration, write a blog post, a record to prevent forgetting, and hope that some students have help.
Note: The end of this blog is zsh, so the interface and bash are slightly different, but the commands are basically the same, you can refer to the MAC on the bash zsh
xampp,:http://www.apachefriends.org/en/xampp-macosx.html#849, version is xampp Mac OS X 1.7.3
1, edit the Hosts file, directory is/etc/hosts, open terminal operation, because the MAC has permission restrictions, so need to get root permissions temporarily.
Enter the password, security considerations, the password does not display occupies the number of bits, in the GNU Nano Editor to modify, press Control+x exit, press Y to confirm
Third, modify the XAMPP configuration file
1, modify the httpd.conf file, directory is/applications/xampp/xamppfiles/etc/httpd.conf, enter the command in the terminal as follows
2. After opening the httpd.conf file, press Ctrl+w to search for "httpd-vhosts.conf", remove the previous # comment, and ensure the vhosts virtual host configuration file is introduced.
3. Add the following code to the last side of the httpd.conf
<directory "/users/heiniuhaha/sites/project" >
#Options Indexes followsymlinks execcgi includes #don ' t permission see list
Allow from all
"Options All" is to allow directory browsing, a security risk, suitable for personal debugging programs, note that when the site root contains index.html pages, the Web page will be opened by default, rather than the directory list, so this mode needs to delete index.html.
"Options Indexes followsymlinks execcgi includes" is not allowed directory browsing, suitable for the official site
4. Open file httpd-vhosts.conf file, directory is/applications/xampp/xamppfiles/etc/extra/httpd-vhosts.conf, enter command in terminal as follows:
Open httpd-vhosts.conf file after entering password to start editing
After editing, press Ctrl+x to exit, press Y to save, restart Xampp, browser input 127.0.0.1 www.server.com www.test.com www.admin.com Look at the contents of the page.
You'll find that 127.0.0.1 and www.server.com point to the original XAMPP's boot page, while www.test.com www.admin.com points to a different site.
5. mysql Configuration
When you enter the MySQL phpmyadmin page, you will find a prompt for a blank password error.
Locate the config.inc.php file and the path is/applications/xampp/xamppfiles/phpmyadmin/config.inc.php
After opening the file config.inc.php, find $cfg[' Servers ' [$i] [' password '] = ', instead $cfg[' Servers ' [$i] [' password '] = ' 123 '; After you save the exit, restart the XAMPP.
Terminal enters MySQL command line operation
Need to be accessed as a directory, and do not default to index.html index.php and so on, you need to configure the original default open to remove.
--------------------Updated on 2011-12-13 Day---------------------
I'm having a problem with MySQL being disabled today.Access forbidden!
New XAMPP Security Concept:
Access to the requested directory was only available from the local network.
This setting can is configured in the file "httpd-xampp.conf".
If you think this is a server error, please contact the webmaster.Error 403www.server.com
The workaround is to disable the Deny from all
Mac under XAMPP Multi-domain multi-site multiple virtual host configuration