[Windows Server 2012] apache+php Security Settings

Source: Internet
Author: User

★ Welcome to The Guardian God · V Classroom, website address: http://v.huweishen.com

★ Guardian God · V Classroom is a Web site dedicated to providing server instructional video for the Guardian God, updated weekly video.

★ This section we will lead you: Win2012 R2 apache+php security Settings

· Apache defaults to running as a system service, and running the account on the systems is very dangerous. Need to fall right and give proper reading
Write permissions.


1, this section is connected to the previous section "Apache+php installation Method" course, so Apache has been installed configuration.


2. Establish a system account to run Apache

1) Add a user, named Apache_hws;

2) Set user Apache_hws only belong to Guests Group;


3, set the Apache program directory permissions

1) In this case, the Apache program is located in the directory: "D:\Apache24"; give administrators, SYSTEM "Full Control"
permissions; give Apache_hws "Read and execute" permission;

2) "Logs" directory to Apache_hws "read/write/delete", or the Apache service will not start;

3) "Htdocs" directory (the directory where the website is stored in this course) gives Apache_hws "read/write/delete", otherwise the website
Cannot be updated (if the site does not need to be updated, then just give "read" permission);


4. Set PHP directory Permissions

1) Set PHP installation directory permissions (in this case: "C:\PHP"): Administrators, SYSTEM "Full Control";
Users "Read and execute";

2) Set the PHP temp directory permission; temp directory location by php.ini
"Session.save_path", "Upload_tmp_dir" two items specified.

• As you can see, the values for these two items are not set in this example, so the temporary files are stored by default to "C:\Windows\Temp".
This is the system directory, no need to change, keep the system default permissions can;

• If your php.ini specifies the values for these two items, be careful to adjust the corresponding directory permissions to: Administrators,
SYSTEM "Full Control"; Everyone "read/write/delete".


5. Set up Apache service

1) Set Apache service startup account to Apache_hws;

2) Restart Apache service;


6. Test results

1) Apache running account is APACHE_HWS, success down right;

2) Create a new code for <?php phpinfo ();?> 's tz.php Probe Web page.

3) PHP is running normally.


Now that this section is over, please visit the Guardian God website (www.huweishen.com) for more instructional videos.

Reprint please indicate the source (http://v.huweishen.com/video/34.html) Thank you!

[Windows Server 2012] apache+php Security Settings

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.