Apache Apache server How to configure?

Source: Internet
Author: User
Tags ini

0. Before you start, you need to set the power-on password for your computer and you want to open the local server.

First, local Apache server

1. First build a Sites folder under your own computer nickname folder

If you are not in the blog to see this article, please click to view the original

There are some false data in the background. Like mine is in the/USERS/DSX directory.

2. Find the configuration file, back to the original file

The next step is to operate under the terminal. Enter the following instruction ($ code can be copied directly)

Switch working directory

$CD/etc/apache2

Backup files, safekeeping, just one execution.

$sudo CP httpd.conf Httpd.conf.bak

Hint: The following line of code do not play, if there is an error in the subsequent operation! You need to restore the httpd.conf files you backed up by using the following command

$sudo CP Httpd.conf.bak httpd.conf

3. Start modifying the configuration file

Edit httpd.conf with Vim

$sudo Vim httpd.conf

Find DocumentRoot

/documentroot

Press I into edit mode

You can see two paths to change them to the path of the Sites folder you just built.

Then find the next PHP

/php

Navigate to this line and move the cursor to the left. Press x Delete "#" Open Directory

(if it's a 10.10 system, there's another step: Find the options input/options can also visually find the position in the diagram, add a word between the options and the follow)

After the first press the ESC key to exit edit mode, and then enter: Wq Save and exit if the wrong do not want to save is: q!

4. Finishing work and confirmation of success

Copy configuration file

$sudo CP Php.ini.default PHP.ini

After you restart the Apache server, it's normal to say the following words

$sudo apachectl-k Restart

It's normal to say this after that, don't worry.

To confirm the success of the No, go to the browser input localhost if you can come to the following interface is right

5. Matters needing attention

Note the previous backup. Do not back up multiple times.

Note that all the English symbols and letters are used in vim editing.

The command for the server switch is

$sudo apachectl-k Start

$sudo apachectl-k Stop

Every time you turn the computer off, you want to use the server again, you need to knock down the command.

Two, WebDAV server

Next is the WebDAV server, which is based on Apache, which means that you have Apache enabled to open the WebDAV server.

Of course, if Apache is fully configured, then WebDAV will be well configured.

WebDAV can be used entirely as a file server for a network share!

1. Continue to revise

$ cd/etc/apache2

$ sudo vim httpd.conf

Find httpd-dav.conf

/httpd-dav.conf

Or just like that. Press I edit, navigate to this line, the cursor moves to the left, press X to delete the # number,

(If your computer is a 10.10 system, you also need to have the following underlined operation:)

Find these lines by searching

LoadModule Dav_module libexec/apache2/mod_dav.so

LoadModule Dav_fs_module libexec/apache2/mod_dav_fs.so

LoadModule Auth_digest_module libexec/apache2/mod_auth_digest.so

And the number of their line at the beginning of the delete (friendship tip, they are the president of the very similar must be clear, don't change the wrong)

Press ESC to complete the edit, enter: Wq exit

and then switch directories

$ cd/etc/apache2/extra

Back up the file (remember to just back up the line once)

$ sudo cp httpd-dav.conf Httpd-dav.conf.bak

Now we're going to edit this file.

$ sudo vim httpd-dav.conf

Find digest edit mode from digest to Basic or those steps, after the change to save exit

/digest

2. Run the script file

The next step is to use a script file to download the address here

Baidu Network disk: Http://pan.baidu.com/s/1jG7ogdS password is: yj9t

To switch directories, you can use the mouse to drag the folder where the put script is located directly behind the CD

$ cd Save directory for put script

Run the put configuration script with administrator privileges

$ sudo./put

Will first let you enter your computer password, and then give the admin account password such as 123456

When Setup is complete, he displays a large string and then restarts the Apache server.

3. Verify Success

Go to your network and look at the IP address of the Web you are now connected to.

Then click on the Finder--> to the--> connection server--> input http://192.168.1.106/uploads (This is for example, you have to enter your own IP address)

Then will pop up a box, select Registered user, Account admin, password such as 123456 can connect

After the configuration is complete, you can write the URL of the file within your server by sending the requested URL in the code. Do not connect the extranet can also perform the download upload operation.

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.