SuSE Linux system to set Apache method

Source: Internet
Author: User
Tags in domain linux

Apache needs to be set up as a virtual Web site space mode.

The new SuSE Apache has been changed to modular.

So as long as you modify a few files can be established in the account, the site corresponds to the location.

Instead of modifying the http.conf to build a corresponding/home position, the completion of the build also to restart Apache.

1. Modify/etc/sysconfig/apache2

] #vi/etc/sysconfig/apache2

Find Apache_modules.

Plus Vhost_alias at the back.

Archive recompile apach2 to apache2 load vhost module

] #SuSEconfig--module apache2

2. Create a new file in/etc/apache2/vhosts.d/called vhost.conf content as follows

] #vi/etc/apache2/vhosts.d/vhost.conf

Usecanonicalname off

Errorlog/var/log/apache2/error_log

Customlog/var/log/apache2/access_log Common

Virtualdocumentroot/home/vhost/%0/public_html

Virtualscriptalias/home/vhost/%0/public_html/cgi-bin

AddHandler Cgi-script. CGI

Options execcgi

SetHandler Cgi-script

Red places vary according to personal preferences

Preset because it's/home/%0/public_html.

There's no "vhost" behind/home. For the convenience of management, build a more directory

So that home looks a lot cleaner and more chatter.

3. Modify Default-server.conf

VI default-server.conf

Find Scriptalias XXXXXX.

Note out this paragraph

#ScriptAlias/cgi-bin/"/srv/www/cgi-bin/"

# "/srv/www/cgi-bin" should be changed to whatever your scriptaliased

# CGI Directory exists, if you are have that configured.

#

#

# allowoverride None

# Options +execcgi-includes

# Order Allow,deny

# Allow from all

#

No more catalogs.

This side apache2 restart on OK chatter directly skip the action below 4

4. If there is more than one layer to continue to modify mod_userdir.conf

] #vi mod_userdir.conf

Find

Change into

Archive leave

5. Reboot Apache2

] #rcapache2 Restart

To build a Web site later

Whenever a new user is created

Home directory directly built in domain mode is OK

For example

ABC user his home directory is built/home/vhost/www.xyz.com

Apache will automatically go to/home/vhost/www.xyz.com/public_html/.

Directory to read the site information.

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.