Cainiao University Hall: Step-by-Step WEB Server Configuration

Source: Internet
Author: User
Article Title: cainiao University Hall: Configure WEB servers step by step. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
   Install and configure apache2
1. download the latest source code package from the official apache website (www.apache.org ).
2. Decompress tar-zxvf apache_1_version).tar.gz to obtain a directory.
3. Go to the directory and run./configure -- prefix = [path] -- enable-module = so to start the configuration.
For example, to install apache under/www/, you can./configure -- prefix =/www -- enable-moudle = so
  
  
4. Execute make after configuration, and then make install. apache installation is complete.
If the directory name is uncomfortable, you can use the music video source file (directory) name to change the name of the new file (directory.
However, modify the configuration file/conf/httpd. conf in the apahce directory to change the corresponding path.
  
   Configure mysql
The reason for the configuration is that mysql from the official website (www.mysql.com) is a binary package that has been compiled, and you do not need to compile it yourself. download it to a suitable location, for example, download it to/www.
  
1. Add a user group and user group for mysqld
Shell> groupadd mysql
Shell> useradd-g mysql
  
2. unpackage with tar-zvxf mysql-Version-Os.tar.gz, and then renamed mysql with mv, that is, the directory/www/mysql
3. follow the user manual (/www/mysql/docs/man/manual.html) to enter/www/mysql/bin and edit mysqlaccess, find $ MYSQL = '/usr/local/bin/mysql'. Change the path to'/www/mysql/bin/mysql'
  
4. Run/www/mysql/scripts/mysql_install_db (provided that you have not installed mysql before)
  
5. Perform corresponding user authorization:
Shell> chown-R root/usr/local/mysql
Shell> chown-R mysql/usr/local/mysql/data
Shell> chgrp-R mysql/usr/local/mysql
  
6. edit/www/mysql/support-files/mysql. server, find basedir =, change to basedir =/www/mysql, find datadir = ..., change to datadir =/www/mysql/data
  
7. Run bin/mysqld_safe -- user = mysql &. mysql will be started if no error occurs ~
  
8. Edit/www/mysql/support-files/my-medium.cnf in the [mysqld] bar with basedir =/www/mysql, save the cp my-medium.cnf/etc/my. cnf
  
9. Go to/www/mysql/support-files and execute mysql. server stop/start to see if any response is returned.
  
   Install php4
1. download the latest source code package to the official website (php-4.3.3.tar.gz currently)
2. decompress the package with tar (I will not talk about it again)
3. configure PHP4 to execute./configure -- prefix =/www/php4 -- with-mysql =/[path to mysql]
-- With-apxs2 =/[path to apxs] Two of the paths should be changed to -- with-mysql =/www/mysql
-- With-apxs2 =/www/apapche/bin/apxs, after successful configuration, execute make, then make install, PHP installation is complete
  
4. Edit/www/apache/conf/httpd. conf to add
AddType application/x-httpd-php. php. phtml
AddType application/x-httpd-php-source. phps
These two rows.
  
5. Run/www/apache/bin/apachectl start
If no problem occurs during startup, you can test the installation of Apache, PHP, and mysql by creating a file named phpinfo. php, which contains the following code lines: Save the file and place it in the Apache document root directory (htdocs). Then, start your Web browser and type http: // localhost/phpinfo in the address bar of the browser. the php browser will display various variables and variable values of the PHP and Apache systems in a large space. If the details of apache and mysql. php are displayed, the three are successfully installed and configured.
  
6. because PHP is installed under apache in the form of a dynamic module, if you want to reset PHP, you only need to execute a new configuration option. /configure command, and then execute make and make install. In this way, a new module will appear in the Apache Module Directory. You only need to restart Apache to load the new module.

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.