Windows + apache Virtual Host Security Settings

Source: Internet
Author: User


Windows:
1. Enable the security mode. You can disable functions such as exec () and system ().
2. Use php_admin_value open_basedir in httpd. conf to restrict PHP access directories.
3. In php_admin_value open_basedir, do not forget to add the php temporary upload directory and session storage directory specified in PHP. ini. Otherwise, you will not be able to upload files or access sessions.
Configure php. ini as follows:
Upload_tmp_dir = "E:/APMServ5.2.0/PHP/uploadtemp /"
Session. save_path = "E:/APMServ5.2.0/PHP/sessiondata /"

4. For more information, see the configuration http://apmserv.s135.com of my APMServ software.

Httpd. conf configuration (if the PHP read and write permissions are restricted to the E: smis directory)

Apache2.0 configuration example:
<VirtualHost *: 80>
ServerName www.abc.com
DocumentRoot "E:/smis"
Options FollowSymLinks IncludesNOEXEC Indexes
DirectoryIndex index.html index.htm default.htm index. php default. php
AllowOverride None
Order Deny, Allow
Allow from all
Php_admin_value open_basedir "E:/smis/; E:/APMServ5.2.0/PHP/uploadtemp/; E:/APMServ5.2.0/PHP/sessiondata /"
Php_admin_value safe_mode On
</VirtualHost>

 


Apache2.2 configuration example:

<VirtualHost *: 80>
ServerName www.abc.com
DocumentRoot "E:/smis"
</VirtualHost>
<Directory "E:/smis">
Options FollowSymLinks IncludesNOEXEC Indexes
DirectoryIndex index.html index.htm default.htm index. php default. php
AllowOverride None
Order Deny, Allow
Allow from all
Php_admin_value open_basedir "E:/smis/; E:/APMServ5.2.0/PHP/uploadtemp/; E:/APMServ5.2.0/PHP/sessiondata /"
Php_admin_value safe_mode On
</Directory>

Related Article

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.