Apache configuration in linux

Source: Internet
Author: User
For more information, see apache configuration in linux-Linux Enterprise Application-Linux server application. Today, I made a day. I finally made this small configuration and succeeded after work. Haha... not bad.

1.httpd-2.2.4.tar.gz the package I used

2. Even the directory is under/usr/local, but I have created an apache directory.

3.extract the httpd-2.2.4.tar.gz package to the apache directory.

Tar-zxvf httpd-2.2.4.tar.gz

4. After unzipping, A httpd-2.2.4 directory will appear. Enter and set the code tree, which is also known as the configuration.

./Configure -- prefix =/usr/local/apache -- enable-modules = so -- enable-rewrite

(Here I will talk about it first. for this configuration command. I never figured out what was going on. there are so many parameters that I have found on other websites. I tried it. yes. if anyone knows this well. I hope you can give me a reply or leave me some documents. I want to learn. thank you !)

5. The configuration is complete. No error occurs. OK. You can proceed to the next step.

Make

6. After successful

Make install

7. A lot of people have said they can use it, but I found that it cannot be used at all. I asked my friends and checked some information. There is something else to do.

Vi/usr/local/apache/conf/httpd. conf

Edit this file. Modify the following items:

AddType application/x-compress. Z

AddType application/x-gzip. gz. tgz

Find these two sentences. Add the following two sentences. (I don't understand the meaning. It seems that PHP is supported)

AddType application/x-httpd-php. php. htm. html

AddType application/x-httpd-php-source. phps

Find the DirectoryIndex index.html

Change to DirectoryIndex index. php.

Find # ServerName www.example.com: 80 and add it below:

ServerName localhost: 80

OK, so far. The contents in this file have been changed.

(But I also saw that they still had something to change. I didn't understand it. I didn't write it here. If you have a friend who needs it, check the information again)

8. cd/usr/local/apache/htdocs

Then change index.html under this folder to index. php.

Mv index.html index. php

9./usr/local/www/bin/apachectl start is all done. Try it.
Related Article

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.