Apache Server installation and configuration

Source: Internet
Author: User
Tags server installation and configuration
ArticleDirectory
    • 1. Install the apache service on Windows
    • 2. Uninstall the apache service on Windows
    • 3. Compile the Apache module on Linux
    • 4. Configure and use the mod_xsendfile Module
1. Install the apache service on Windows

You can install Multiple Apache servers on the same Windows server, as long as the ports are not repeated.

Httpd.exe-K install

Httpd.exe-K install N "your service name"

Httpd.exe-K install N "your service name"-F "D:/httpd. conf"

2. Uninstall the apache service on Windows

Httpd.exe-K uninstall

Httpd.exe-K uninstall-n "Name of the service to be uninstalled"

3. Compile the Apache module on Linux

For example, to compile the mod_xsendfile module, run the following command:

/Usr/local/Apache/bin/apxs-CIAMod_xsendfile.c

After compilation, restart the apache service.

4. Configure and use the mod_xsendfile Module

1). configuration in Apache:

Loadmodule xsendfile_module modules/mod_xsendfile.so

<Ifmodule xsendfile_module>
<Directory "/var/www/html/myweb/">
Xsendfile on
Xsendfilepath/var/data/files/
</Directory>
</Ifmodule>

2). phpProgram:

$ File = '/var/data/files/1.zip ';
If (! File_exists ($ file )){
Die ("File '$ file 'doesn' t exist .");
}

Header ("Content-Type: Application/octet-stream ");
Header ("X-sendfile: $ file ");
Header ('content-Disposition: attachment=filename=1.zip ');

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.