Built using apache httpd web server file sharing

1. Install apache dependent apr and apr-util package.
2. 2.4.4 Compile-mounting the httpd
①.cd the httpd-2.4.4
②. # ./Configure --prefix = / usr / local / --sysconfdir = Apache / etc / --enable- the httpd --enable-SO ssl --enable-cgi --enable-rewrite --with -zlib --with-pcre --with-apr = / usr / local / apr --with-apr-util = / usr / local / apr-util - MOST --enable-modules = -enable-Shared = MPMS-MPMS-MOST-Shared --enable = MOST
③.make && the make the install
3. configuration /etc/httpd/httpd.conf
①. Definition IndexOptions Charset = UTF-8 (this option is defined in order to solve displayed on a web page Chinese Chinese directory and file garbage problem; define this option to specify a particular encoding to the Indexes)
② Include /etc/httpd/extra/httpd-vhosts.conf option is enabled, the front of the #. No deleted.

  1. Httpd-vhosts.conf under configuration / etc / httpd / extra directory virtual host file, in which the definition of virtual hosts.
    ① <VirtualHost *: 80>
    ServerName www.a.com (custom website site name)
    DocumentRoot "/var/www/a.com" (defined httpd document directory)
    <Directory "/var/www/a.com"> ( definition document directory permissions)
    Options FollowSymLinks the Indexes (the Indexes: allows the document directory file lists; FollowSymLinks: allows access to the original file the symbolic link points)
    AllowOverride authconfig (define user authentication type)
    Authtype Basic (specify the type of user authentication Basic)
    AuthName " user login required, please enter "(Why require authentication description)
    AuthUserFile" / usr / local / Apache / the passwd / htuser "(authenticated user file path)
    the Require Valid-user (Valid-user allows a user defined in the file all user login)
    </ Directory>
    the ErrorLog "logs /-the error_log Apache" (error log display format)
    the CustomLog "logs / access_log-Apache"

5. How to define user authentication file is not to say, you can search on their own network ~ ~ ~ (this is different from the certified user authentication file system user, to be subject to the establishment)
6. create a folder and place files in the directory httpd document, with an tour Download the file access test.

Guess you like

Origin blog.51cto.com/12018928/2408121