How to plan a high-capacity Apache server _ Server

Source: Internet
Author: User
Tags chmod domain name server rsync
A is a Web server inside the LAN, install Redhat Linux 6.X, compile Apache+php4+mysql
B is the corporate firewall, the external address is a.b.c.d, is the only path to the Internet. Also run Apache on B
Do reverse proxy to internal machine B. Suppose the company's domain name is @company.com,b is the domain's domain name server.
Second: The organization structure of the web directory
We plan to place the Web server data file under a separate directory/www, and then create a corresponding
Subdirectories, if we plan to set up the Web server web.company.com, then create the directory
/www/web.company.com, the structure is as follows:
/www/web.company.com/public/htdocs
/cgi-bin
/www/web.company.com/staging/htdocs
/cgi-bin
/www/web.company.com/developer/htdocs
/cgi-bin
Three: Access Methods and
The staging and developer directories are accessed based on ports, respectively corresponding to the port 81,82.
The following is a section of the Apache configuration file/usr/local/apache/conf/httpd.conf
Configuration:
Listen 80
Listen 192.168.11.8:81
Listen 192.168.11.8:82
〈virtualhost 192.168.11.8:81>
documentroot/www/web.company.com/staging/htdocs/
scriptalias/cgi-bin/www/web.company.com/staging/cgi-bin/
Transferlog "|/usr/local/apache/bin/cronolog/usr/local/apache/logs/web/staging/%y/%m/%d/access_log"
Errorlog "|/usr/local/apache/bin/cronolog/usr/local/apache/logs/web/staging/%y/%m/%d/error_log"
〈/virtualhost>
〈virtualhost 192.168.11.8:82>
documentroot/www/web.company.com/developer/htdocs/
scriptalias/cgi-bin/www/web.company.com/developer/cgi-bin/
Transferlog "|/usr/local/apache/bin/cronolog/usr/local/apache/logs/web/developer/%y/%m/%d/access_log"
Errorlog "|/usr/local/apache/bin/cronolog/usr/local/apache/logs/web/developer/%y/%m/%d/error_log"
〈/virtualhost>
Note: The above port based settings, to access the test server, with
Development Server with
The Transferlog and errorlog above are not in the default format, but are recommended on the Apache site for this daily
The year/month/day format of a file, which can be compiled from download
After installation in/usr/local/apache/bin/cronolog, you can view the Apache website for more information.


If there are other home pages that need to be serviced on this server, such as/www under the Hr.company.com (Personnel Department)
, you can create IP aliases for host A, such as 192.168.11.9, and then do the same port-based settings
Third: The situation of the personal homepage
Assuming that Apache is running as a user group nobody and the user's home directory is/home/jephe, create a directory under this directory
public_html
A. Setting the user's home directory/home/jephe permissions to be read and executed by the nobody group
chmod 750-r/home/jephe
B. Setting permissions for the public_html directory under the user's home directory/home/jephe
Chmod-r 2770/home/jephe/public_html
C. Setting the owner of the user's home directory
Chown-r jephe.nobody/home/jephe/public_html
Users can FTP upload home page files to their own directory, to set the FTP upload in the/etc/inetd.conf umask default value
For u002,
FTP stream TCP nowait ROOT/USR/SBIN/TCPD in.ftpd-l-a-u002
And then use killall-hup inetd to take effect.
End with access to the personal homepage.
Four: Apache reverse proxy on firewall machine b
The settings are as follows:
Namevirtualhost a.b.c.d
〈virtualhost a.b.c.d>
ServerName web.company.com
Errorlog "|/usr/local/apache/bin/cronolog/var/log/httpd/web/%y/%m/%d/error_log"
Transferlog "|/usr/local/apache/bin/cronolog/var/log/httpd/web/%y/%m/%d/access_log"
Rewriteengine on
Rewriterule ^ (/.*) $ [p,l]
Proxyrequests off
〈/virtualhost>
V: Backup
Back up the home directory/www/web.company.com/public/htdocs the entire directory with rsync, about how to apply rsync, see
A list of other articles in the article, home page in rsync.samba.org

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.