PHP access to out-of-project directory configuration

Source: Internet
Author: User

PHP deployment to a Linux server, quite simple, the project code upload, and then configure the HTTPD service listening port and code in the directory, access to use the Linux server domain name + port number, will enter the PHP project. Such as:

<virtualhost *: >    /usr/code/www/project/    ServerName www.myproject.com</VirtualHost><Directory/usr/code/www/project/>    Options Indexes FollowSymLinks multiviews    allowoverride all    Order allow,deny    to </Directory>

This way, the use of www.myproject.com:80 is entered into the/usr/code/www/project directory.

However, if there are some other resources, such as tablets, is not placed in the code project, but a separate directory, this is better understood, because the general such resources, are independent placement, conducive to backup and multi-project sharing. The slice is placed in the/pic directory, how to use Www.myproject.com/pic to access the/pic directory. Also very simple, add a line configuration can.

<virtualhost *: >    /usr/code/www/project/    ServerName    www.myproject.com/pic/"/pic/"</virtualhost><directory/usr/code/www/ project/>    Options Indexes followsymlinks multiviews    allowoverride all    Order allow,deny    allow from all </Directory>

This configuration can be generalized to CDN acceleration, where resources can be used without the same directory as the code.

PHP access to out-of-project directory 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.