Linux site Configuration (Autumn Agriculture edition) __linux

Source: Internet
Author: User

Introduction to Linux Web Site configuration features

Many people can use different ports and different web directories.

Visit the website such as: HTTP://HOST:PORT/A/B/C/D/C will redirect to index.php.

Use: $_server["Redirect_url"], you can get "/a/b/c/d/c".

Help to build a convenient web site framework.

Steps

First Step

/etc/apache2/mods-avaiable/has a module: rewrite.load, copy it to the directory/etc/apache2/mods-enabled/, or make a soft connection.

Second Step

If you need to add a new port and site directory (such as port: 10000, Directory:/home/www/heqiunong), open/etc/apache2/sites-available/default

Add the following code:

<virtualhost *:10000>

ServerAdmin Webmaster@localhost

Documentroot/home/www/heqiunong

<directory/>

Options FollowSymLinks

AllowOverride None

</Directory>

<Directory/home/www/heqiunong>

Options Indexes followsymlinks MultiViews

AllowOverride All

<ifmodule mod_rewrite.c>

Rewriteengine on

Rewritebase/

Rewritecond%{request_filename}!-d

Rewritecond%{request_filename}!-f

Rewriterule ^ (. *) $/index.php?$1 [qsa,pt,l]

</IfModule>

Order Allow,deny

Allow from all

</Directory>

scriptalias/cgi-bin//usr/lib/cgi-bin/

<directory "/usr/lib/cgi-bin" >

AllowOverride None

Options +execcgi-multiviews +symlinksifownermatch

Order Allow,deny

Allow from all

</Directory>

ErrorLog ${apache_log_dir}/error.log

# Possible values Include:debug, info, notice, warn, error, crit,

# Alert, Emerg.

LogLevel warn

Customlog ${apache_log_dir}/access.log combined

</VirtualHost>

Third Step

(Listening port)

Open/etc/apache2/ports.conf

Add the following code

Namevirtualhost *:10000

Listen 10000

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.