Install the Apache server in 64-bit centos6 (SVN and tomcat clusters will be installed later)

Source: Internet
Author: User
Tags apache log password protection

 

Install the Apache server in 64-bit centos6 (SVN and tomcat clusters will be installed later)

1. install Apache

Install Apache, go to the http://httpd.apache.org to download the latest version of 2.2.x tar.gz or bz2 file to/software, go to the directory, unzip the installation with the following parameters (My is 2.2.19)

1> decompress:

# Cd/software

# Tar-zxvf httpd-2.2.x.tar.gz

2> preprocessing:

# Cd httpd-2.2.x

#./Configure -- prefix =/usr/local/apache \

-- With-MPM = worker \

-- Enable-SO \

-- Enable-Rewrite \

-- Enable-mod-shared = most

Write as follows: #./configure Apache is installed in the/usr/local/apache2 directory by default after this preprocessing only.

3> compile and install:

# Make Compilation Program

# Make install Installer

4> start:

#/Usr/local/apache2/bin/apachectl start

You can also start it like this:

# Service httpd start

To enable the HTTP service to start automatically, modify the following file:

Vim/etc/rc. Local

Touch/var/lock/subsys/local

/Etc/init. d/httpd start Apache service

Svnserve-d-r/usr/share/Park/start SVN Service

Service vsftp start FTP service

Service iptables stop disable Firewall

2. Configure Apache

Apache, like IIS, provides powerful static page processing capabilities. As a professional static page processing server, Apache is more capable of processing static pages than tomcat. Of course, this is a common situation. In some cases, Tomcat is better than Apache.

Apache configuration in Linux is complicated. You must understand the directory structure and configuration file structure of Apache.

/Etc/httpd/CONF/httpd. conf: The main configuration file. However, many other distribution files are split into several small files to manage different parameters respectively. However, the main configuration file is based on the file name.

/Etc/httpd/CONF. d /*. conf: One of the characteristics of centos, if you do not want to modify the original configuration file httpd. conf, you can separate your own extra parameters. When apache is started, this file will be read into the main configuration file.

/Usr/lib64/httpd/modules: Apache supports many modules. Therefore, the modules you want to use are stored in this directory by default.

/Var/www/html: the default "Homepage" Directory of centos.

/Var/www/error: if the host is set incorrectly or the data requested by the browser is incorrect, the error message displayed on the browser is the default information of this directory.

/Var/www/icons: provides some small icons of Apache.

/Var/www/cgi-bin: directory for some executable CGI programs by default

/Var/log/httpd: by default, Apache log files are stored here. For websites with high traffic, this directory should be very careful, because this file is easily changed to a large one, you need enough space.

/Usr/sbin/apachectl: This is the main execution file of Apache. The execution file is actually a shell script, which can actively detect some settings on the system, this makes Apache startup easier.

/Usr/sbin/httpd: This is the main Apache binary file.

/Usr/bin/htpasswd: When you want to log on to some web pages, you need to enter your account and password. Apache itself provides the most basic password protection method. This command is used to generate the password.

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.