Detailed steps for configuring the Apache server in iOS

Source: Internet
Author: User
Tags fully qualified domain name

To configure the Apache server for:
    • Able to have a test server, Apache server is FREE!
Why is Apache
    1. The most widely used WEB server
    2. Mac comes with, only need to modify a few configuration can be, simple, fast
    3. Some special server functions, Apache can be very good support for example: HTTP PUT / DELETE operation, knowledge supplement involved in the HTTPS service
Preparatory work
    • Set User password
Configuration
    1. Configuring the server's work

      • FinderCreate a folder in Sites , directly /Users/apple under the (current user name) directory
      • Modify the configuration file 两个路径 , point to the folder you just created
      • Copy a file
    2. Configuring Server Considerations

      • Close Chinese Input Method
      • There is a need between the command and the parameter空格
      • Modify system files Be sure sudo to remember otherwise there will be no permissions
      • Directory to be in /Users/apple (current user name)
    3. Configure the server

Tip: $ start, can be copied, but do not copy $

# 切换工作目录$ cd /etc/apache2

Common commands

    • cdSwitch directories
    • pwdConfirm current Directory
    • lsList shows the contents of the current directory
# *** 备份文件,以防不测,只需要执行一次就可以了# 格式 cp (copy 的缩写) httpd.conf (源文件) httpd.conf.bak (目标文件)$sudo cp httpd.conf httpd.conf.bak# 提示:如果后续操作出现错误!可以使用以下命令,恢复备份过的 httpd.conf 文件$ sudo cp httpd.conf.bak httpd.conf
    • Edithttpd.conf
 # vim can only use the keyboard, can not use the mouse # Use Vim to edit httpd.conf$ sudo vim httpd.conf# find ' DocumentRoot ' */ Documentroot# into edit mode * I# Modify the path in ' two ' quotes DocumentRoot  "/users/your username/sites" <directory  "/users/your user name/sites" ># continues to find options followsymlinks multiviews# plus a word ' Indexes ', The modified results are as follows: Options Indexes followsymlinks multiviews# return to command mode * ESC # find php*/php# move cursor to First line * 0# Delete beginning comment #* x# Save and Exit *: Wq# do not save exit!!!!!!!!! *: q!                 
    • Copy php.ini file
# 切换工作目录$ cd /etc# etc 目录有点类似于 windows/system32,存放配置文件的目录$ sudo cp php.ini.default php.ini# 重新启动apache服务器$ sudo apachectl -k restart

The following error is normal if prompted:

httpd: Could not reliably determine the server‘s fully qualified domain name, using teacher.local for ServerNamehttpd not running, trying to start
Problems:
    • If you click on info.php a file, the download appears, or you just display a short paragraph of text

Workaround:

Enter the following two commands in the terminal:

# 关闭 apache 服务器$ sudo apachectl -k stop# 启动 apache 服务器$ sudo apachectl -k start
    • Each time you start your computer, Apache the server will not start automatically by default!

After you can start the computer, open the terminal and enter the following command:

# 启动 apache$ sudo apachectl -k start# 查询历史输入的命令$ history
    • The most common problem

The swap file already exists, directly by the letter "D", you can delete the swap file!

    • When executing the script, show no access Denied! We use NTFS the format of the U disk copy network material! You may be able to filter out the permissions of the file itself!

Here are the instructions to modify the file permissions in the terminal!

644 info.php(没有权限的文件名)$ chmod 644 *.*

Detailed steps for configuring the Apache server in iOS

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.