RedHat9linuxapache installation configuration (with each user's web site)

Source: Internet
Author: User
RedHat9linuxapache installation configuration (with each user's web site, etc.)-Linux Enterprise Application-Linux server application information. The following is a detailed description. Red Hat 9 default important configuration information:

Configuration File:/etc/httpd/conf/httpd. conf, server root directory:/etc/httpd, access log file:/var/log/httpd/access_log, run Apache user: apache.

Start the apache Command service httpd start and restart

I. Install Apache 2

Rpm-qa | grep Apache

Mount/mnt/cdrom

Cd/mnt/cdrom/Red Hat/RPMS

Rpm-ivh httpd-2.0.40-21.i386.rpm

Rpm pivl http-manual-2.0.40-21.i386.rpm

Cd; eject

Ii. Start Apache

Service httpd start, restart start | status, with the system starting ntsysv,

3. Configure Apache

1. Basic Configuration

You may need to modify ServerAdmin, ServerName (IP Address used when no domain name is available), DirectoryIndex default homepage file, IndexOptions

2. Use the. htaccess File

. Htaccess can change the configuration in the main configuration file, but it can only set access control for the directory where the. htaccess file is stored.

Make sure that the main configuration file has

AccessFileName. htaccess



Order allow, deny

Deny from all



Example:

Cd/var/www/html

Mkdir private

Touch test

Vi/etc/httpd/conf/httpd. conf



AllowOverride Options



Service httpd restart

Vi/var/www/html/private/. htaccess generate the. htaccess File

Options-Indexes add statement

3. Configure the Web site of each user

. Vi/etc/httpd/conf/httpd. conf



UserDir disable root // prohibit root users from using their own sites

UserDir public_html // configure the user's web directory



Set the access permission for each user's web site directory,



......



Service httpd restart

Cd back to your directory

Mkdir public_html

Cd ..

Chmod 711 user_home

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.