Linux configuration Web+ftp Server full tutorial (i)

Source: Internet
Author: User
Keywords Linux apache

Intermediary transaction http://www.aliyun.com/zixun/aggregation/6858.html ">seo diagnose Taobao guest cloud host technology Hall

Recently, the company on a server, by the way sorting out the website of various departments, make an unusually busy, today finally idle down to tidy up a few days encountered problems and some ideas, today is the first to write a full version of the Tutorial: Linux (Fedora, Redhat) under the configuration Web+ftp server. Believe that a lot of webmaster to you in the replacement of VPS or stand-alone server will be used, the collection of standby bar.

I. Environmental requirements

According to the different Web site load (traffic intensity) to choose their own server or VPS, especially when you apply to a server, the first thing is to find a reliable server hosting the computer room, the server is hosted inside, so that the server can maintain a better access to the public network speed, Everything is in the future we will start to install the system, Feng Zhiqiang recommended to do the Web server preferred Linux system, stable, easy to manage, and will not produce system garbage slow speed, and has a higher security than Windows.

System installation Process I do not explain, will not install the hurry to learn, there are many tutorials on the web, very simple, of course, you can refer to my previous article "FreeBSD Installation Tutorial Full solution" Here the statement I use the FreeBSD is the original body of Linux, Linux system is based on FreeBSD development, so the two operations are basically the same, individual brands of Linux operation commands slightly different, such as: Ubuntu, SUSE, etc., here no longer describe, we are mainly speaking today in Red Hat (RedHat, Fedora) Several products are applicable.

Installation Configuration Web server Apache+php+mysql

The installation is no longer using the stale compile or RPM commands, and we are using the Yum command to implement the online installation.

1, install Apahce,php,mysql, and PHP connection Mysql library components, using the root user entered the following command:

yum-y install httpd php mysql mysql-server php-mysql

Installing the main program

Yum-y Install MYSQL-CONNECTOR-ODBC mysql-devel libdbi-dbd-mysql

Installing MySQL Extensions

Yum-y Install PHP-GD php-xml php-mbstring php-ldap php-pear php-xmlrpc

Installing PHP Extensions

Yum-y Install httpd-manual mod_ssl mod_perl mod_auth_mysql

Install Apache Extensions

2, configure the Web service boot:

Chkconfig httpd on "Set up boot HTTP service"

Chkconfig-add mysqld "Add MySQL service to system Services list"

Chkconfig mysqld on "set MySQL boot up"

Service httpd Start "Start HTTP Service"

Service mysqld Start "Start the MySQL service"

Note: The above command line a passing, pay attention to return reminders, and also remind rookie: HTTP Service name is Httpd,mysql service name is mysqld.

3, set the MySQL database root password:

Mysqladmin-uroot password ' new password '

4, increase the security of MySQL database:

Mysql-uroot-p Enter the password when prompted, enter the password you just set

After you log in to MySQL, the command line prefix becomes mysql> and then continues to enter the following command:

DROP DATABASE test; "Delete Test Database Tests"

DELETE from mysql.user WHERE user = "; "Delete anonymous accounts"

FLUSH privileges; "Overload Permissions"

Note: The English half-angle semicolon of the above command must be taken.

The required environment for this Web server is installed, the default Web root is under/var/www/html, I do not test here, continue to the next configuration, if you are novice, or afraid of the problem of your own PHP footstep test server.

5, configure the virtual host (VirtualHost)

VirtualHost is Apache provides a virtual host service, divided into domain based and port based on two ways, we usually use a domain-based approach to configure the virtual host, that is, to implement under the same server to place a number of different Web sites, and access through different domain names, This step is also relatively simple, we only need to edit the Apache configuration file httpd.conf (the default location of this file/etc/httpd/conf/httpd.conf), enter the following command:

Mkdir/var/www/html/demo "Create a new virtual host directory"

Chown-r Apache:apache/var/www/html/demo "Modify the group of the demo directory and the owner is Apache" *

Vi/etc/httpd/conf/httpd.conf "VI is an editor tool under Linux"

At the end of the httpd.conf file, add:

<virtualhost *:80>
ServerAdmin feng@pku120.com
Documentroot/var/www/html/demo
ServerName www.crazyer.com
Serveralias crazyer.com
Errorlog Logs/crazyer.com-error_log
Customlog Logs/crazyer.com-access_log Common
</VirtualHost>

Service httpd Restart "Restart the HTTP service, if the error is prompted to return to modify httpd.conf file"

Note: The above servername is followed by your domain name, documentroot followed by your domain name point to the root directory.

The final step, the domain name resolution to this server IP, to the first virtual host on the configuration succeeded, now we need to upload the Web site program to verify the normal operation of the server, so also need FTP support, the next article we configure the Linux Web server under the FTP. The configuration of a single FTP server is somewhat different from the configuration of the WEB+FTP service we use, and there are some permissions issues that will be covered in the next article.

This article author: Feng Zhiqiang, the original address: http://www.crazyer.org reprinted annotated.

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.