debian7.5 installation apache2 to build a PHP development environment tutorial

Source: Internet
Author: User

Use the following command to require SSH to log on to the server, and then execute the following command in turn.
First step: Update system components

Apt-get Update
Apt-get upgrade–show-upgraded

Step Two: Install Apache2

Apt-get Install Apache2
Start rewrite support for apache2
A2enmod rewrite

Step three: Create a new site, configure the virtual host

The configuration file path for the new site is:/etc/apache2/sites-available/
Create a new profile using the Vim www_jicker_cn.conf command, and then use the Shift+insert key to insert the following configuration file
<virtualhost *:80>
ServerAdmin admin@111cn.net
ServerName 111cn.net
Serveralias www.111cn.net
documentroot/www/www_jicker_cn/public_html/
Errorlog/www/www_jicker_cn/logs/error.log
Customlog/www/www_jicker_cn/logs/access.log combined
</VirtualHost>

Step Fourth: Create a Web site directory and log directory

Mkdir-p/www/www_jicker_cn/public_html
Mkdir/www/www_jicker_cn/logs

Step Fifth: Execute the command to start the site

A2ensite www_jicker_cn.conf

Step Sixth: Restart Apache2

Service Apache2 Restart

Seventh step: Optimize the configuration of apache2

To edit a apache2 configuration file using the vim/etc/apache2/apache2.conf command
<ifmodule mpm_prefork_module>
Startservers 2
Minspareservers 6
Maxspareservers 12
MaxClients 80
Maxrequestsperchild 3000
</IfModule>

Summarize

As a back-end service, the ability to resist pressure is much worse than Nginx. More optimized configuration is not available, recommended in the formal production environment or on the Nginx bar.

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.