Mac under XAMPP Multi-domain multi-site multiple virtual host configuration

Source: Internet
Author: User
Tags mysql command line phpmyadmin

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
Options All
AllowOverride All
Order Allow,deny
Allow from all
</Directory>

Description
"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.

sudo nano/applications/xampp/xamppfiles/etc/httpd.conf

--------------------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
Tue Dec 13 11:00:00 2011
Apache/2.2.14 (Unix) dav/2 mod_ssl/2.2.14 openssl/0.9.8l php/5.3.1 mod_perl/2.0.4 perl/v5.10.1

The workaround is to disable the Deny from all

sudo nano/applications/xampp/xamppfiles/etc/extra/httpd-xampp.conf

Mac under XAMPP Multi-domain multi-site multiple virtual host configuration

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.