Apache-1: Installation Configuration

Source: Internet
Author: User

Concurrent?
Maximum number of connections that can be processed by the server at the same time (some requests end in 1 seconds, and some requests can be completed in 10 seconds)

Mainstream Internet Web server
Static:
Apache, Nginx, lighttpd
Dynamic:
IIS (ASP, aspx), Tomcat (JSP), resin (JSP)
PHP (fcgi) [with apache,php is a module mod_php5.so, not service]



Installation method
1. Source code Compilation
Cd/usr/local/share/
wget http://mirrors.hust.edu.cn/apache/httpd/httpd-2.2.34.tar.gz
TAR-ZXVF httpd-2.2.34.tar.gz
CD httpd-2.2.34
./configure--prefix=/application/httpd-2.2.34--enable-deflate--enable-expires--enable-headers--enable-modules= Most--enable-so--with-mpm=worker--enable-rewite
Make && make install

2. Yum Installation
Yum Install Httpd-y

Apachectl command

Check syntax
/application/httpd-2.2.34/bin/apachectl-t

View Modules
/application/httpd-2.2.34/bin/apachectl-l

Start
/application/httpd-2.2.34/bin/apachectl start

Shut down
/application/httpd-2.2.34/bin/apachectl stop

Restart
/application/httpd-2.2.34/bin/apachectl restart

Graceful restart
/application/httpd-2.2.34/bin/apachectl Graceful







Configuration file
/application/httpd-2.2.34/conf/httpd.conf

<directory "/application/httpd-2.2.34/htdocs" >
Options Indexes followsymlinks #去掉Indexes以后没有首页的时候就不会展示目录结构
AllowOverride None
Order Allow,deny
Allow from all

Add a virtual host that can be based on domain name, port, IP
vim/application/httpd-2.2.34/conf/httpd.conf Remove Annotations
Include conf/extra/httpd-vhosts.conf

Vi/application/httpd-2.2.34/conf/extra/httpd-vhosts.conf
Directory authorization
Directory "/application/httpd-2.2.34/docs" >
Options Indexes FollowSymLinks
AllowOverride None
Order Allow,deny
Allow from all
</Directory>



Add a virtual Host
<virtualhost *:80>
ServerAdmin [email protected]
DocumentRoot "/application/httpd-2.2.34/docs/dummy-host2.example.com"
ServerName dummy-host2.example.com
Errorlog "Logs/dummy-host2.example.com-error_log"
Customlog "Logs/dummy-host2.example.com-access_log" common
</VirtualHost>

Change the working mode
Vim httpd-mpm.conf

Default is Prefork
When compiling, you can specify worker mode

Curl to view the site program version, so you need to hide the version number in default.conf
Curl-i 192.168.56.100

Virtual Hosting: Deploy multiple sites, each requiring a different domain name, site directory, or different port, and different IP. A virtual host is required for an HTTP service to configure multiple sites.



Make IP addresses inaccessible to Web sites
Set the first virtuahost and then give a rewrite

Apache-1: Installation configuration

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.