Apache Security Settings under Win2003 (with folder permissions directory, very good and safe) _linux

Source: Internet
Author: User
So to create a new account to replace this account to start Apache and set the appropriate permissions:
1. Create an account within the local user and group in Computer Management, such as Apache, password set to Apacheuser, join Guests group (if there is a problem, you can give user permission);

2. Open the Start-> management tool-> Local Security policy, select "Login as service" In User Rights Assignment, add Apache user;

3. Computer Management Select Services, find apache2.2, first stop the service, right click the-> attribute, select login, switch the radio box from the local System account to this account, and then find the choice of Apache, enter the password apacheuser, Then click OK (this time Apache can not start normally, the general situation will certainly be the error: Apache2.2 service due to 1 (0x1) Services error and stop. );

4. To give the Apache installation directory (such as: d:/apache2.2) and the Web directory (such as d:/wwwroot) Apache account read and Write permissions, remove the root directory of each disk in addition to Administror and system, all permissions, To give the Apache installation directory the disk root directory of the Apache account read column directory permissions (I began to feel unnecessary, but later found: This is the key to the above error. )

5. Start Apache, all OK.

6.php.ini the specified php temporary upload directory and session save directory, and give the directory Apache Full Control permissions, such as:
Upload_tmp_dir = "d:/wwwroot/tmp/uploadtmp/"
Session.save_path = "d:/wwwroot/tmp/sessiontmp/"

7. To give the d:/php directory read and run permissions;

8. To give the Zend installation directory read and run permissions;

9. Restrict read access to the directory, modify the Apache installation directory under the Conf folder under the httpd.conf, plus:
Php_admin_value Open_basedir "D:/wwwroot"
Php_admin_value Safe_mode on

httpd.conf configuration (if PHP read and Write permissions are limited to the E:\smis directory)
Apache2.0 Configuration Example:
Copy Code code as follows:

<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:
Copy Code code as follows:

<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>


win2003 system Apache, PHP, MySQL installation and virtual host and directory permissions settings

This article introduces the WIN2003 system under the test in Apache, PHP, MySQL installation, as well as virtual host and directory permissions settings, that is, WAPM.
However, unlike packaged WAPM software, this software department recommends deployment on a formal server. Here's the start:
1 installation pache, PHP, MySQL
Install to the directory that you think fit, download and install of three software I no longer narrate, should see this article person to this part content will think is superfluous!

2 Virtual Host Settings
Open it.. \apache\conf\http.conf
At the # Virtual hosts, remove the annotation symbol for loading the virtual host
Include conf/extra/httpd-vhosts.conf

To configure the contents of the virtual host configuration file in conf/extra/httpd-vhosts.conf:
Take my recruitment website jobigg.com as an example:
# 1 Jobigg.com
Copy Code code as follows:

<virtualhost *:80>
ServerAdmin alavin.cui@gmail.com
DocumentRoot "D:/jobigg.com"
ServerName jobigg.com
Serveralias www.jobigg.com
ErrorLog "Logs/jobigg.com-error.log"
Customlog "Logs/jobigg.com-access.log" common
</VirtualHost>

My server is dual IP, so there are a few different configurations in httpd-vhosts.conf and http.conf
#Listen 11.11.11.11:80
Listen 80
The IP address is not specified in order to use dual IP properly.

3 reduce Apache's running privileges
3.1 Create a new account
Create an account within the local user and group in Computer Management, such as Apache, password set to jobigg.com, and join the user group;
3.2 Open Start-> Administration Tool-> Local Security policy, select "Log as service" in User Rights Assignment, add Apache user
3.3 Computer Management Inside Select service, find apache2.2, stop service first, right click-> attribute, select login, switch the radio box from local System account to this account, and then find Apache selection. Enter the password jobigg.com, and then click OK (this time Apache should not start normally, the general situation will certainly error: Apache2.2 service due to 1 (0x1) Services error to stop. )
3.4 Give Apache installation directory (e.g. e:/apache2.2) and web directory (e.g. D:/ jobigg.com) The ability to read and write Apache accounts, to remove all the disk root directories except Administror and system permissions, to give the Apache installation directory the disk root of the Apache account read the directory permissions
3.5 Restart Apache

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.