XAMPP server configuration for Mac multi-site LAN Configuration

Source: Internet
Author: User
Tags mysql command line

Most of the software on Mac is charged, and the configuration of open-source Dongdong is quite troublesome. Online Search found that XAMPP software is integrated with multiple server software, similar to phpstudy on windows, it can help developers quickly build local servers. For more information, see.

(1) XAMPP software download: Workshop,
If the latest download may be faulty, the MySQL option cannot be displayed. Therefore, the version 1.7.4 I downloaded is running normally.

(2) modify the hosts file and configure the multi-Site Server:

Use commands such:

Enter the password. For security consideration, the password does not display the number of occupied digits. modify it in the GNU nano Editor, press control + X to exit, and press y to confirm.

Note that if the first line 127.0.0.1 localhost remains unchanged, other machines in the LAN will jump to localhost when accessing your server based on the IP address, instead of the other site directories you configured, if you do not need the default directory, remove the localhost following this sentence.

(3) modify the httpd. conf file. The directory is/applications/XAMPP/xamppfiles/etc/httpd. conf. Enter the following command in the terminal:

Open the httpd. conf file, press Ctrl + W to search for "httpd-vhosts.conf", remove the # annotator, and ensure that the vhosts virtual host configuration file is introduced.

(4) Add the following code at the end of 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>

Note:
"Options exist.
"Options indexes followsymlinks execcgi allowed des" is not allowed for directory browsing and is suitable for official sites.

(5) Modify file httpd-vhosts.conf files.

Directory is/applications/XAMPP/xamppfiles/etc/extra/httpd-vhosts.conf, enter the following command in the terminal:


Enter the password and open the httpd-vhosts.conf file to start editing

After editing, press Ctrl + X to exit, Press Y to save, restart XAMPP, and enter 127.0.0.1 www.server.com www.test.com www.admin.com in the browser to view the content on the page.
You will find that 127.0.0.1 and www.server.com point to the XAMPP boot page, while www.test.com www.admin.com points to different sites.

After the default localhost is entered, the configuration of the first virtualhost is entered. Therefore, if other machines access the server and you want to configure a multi-directory site, the first virtualhost configuration directory points to the root directory that is best followed by multiple sites. For example, if the sites directory contains site 1 and Site 2, the first host directory directs to sites. In this way, multiple sites are displayed when other machines access your IP address.
(6) Add a password to phpMyAdmin. Otherwise, the password cannot be accessed.

Find the config. Inc. php file. The path is/applications/XAMPP/xamppfiles/PHPmyAdmin/config. Inc. php.

Open the file config. inc. after PHP, find $ cfg ['servers'] [$ I] ['Password'] = '', change to $ cfg ['servers'] [$ I] ['Password'] = '000000'. After saving and exiting, restart XAMPP.

 

Enter the MySQL Command Line

 

 

If you want to enable index.html index. php In a directory rather than in a directory, You need to configure the settings to remove the default settings.

Sudo nano/applications/XAMPP/xamppfiles/etc/httpd. conf

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.