Web server configuration in LINUX-Linux Enterprise Application-Linux server application information. For details, refer to the following section. COLLECTOR: tt_teng
Today, in order to install the qmail system, a LINUX system (red flag) is installed under the virtual machine, and I re-configured the WEB server as I learned in my homework, I did not write down my process and mind after I did it before. I recorded them this time and used them later. Three provinces a day. Study hard and be full of yourself. Make a little progress in one day! As we all know, LAMP, which provides WEB services on the Internet today, occupies a large share because it is efficient, secure, and free. Now, I have recorded this very well-known service configuration process. just like other people have published this article, I am not sure how much help I can bring to you. I just want to remember it myself, gradually strengthen yourself.
Throughout the configuration process, the software we use is completely free of charge open source software, which can be downloaded from the Internet for free. We will use MySQL to build a free database server and use Apache (the most popular web server in the world, 60% of websites run Apache) and PHP to build dynamic websites, use the Samba server to quickly develop website programs. Before compilation and installation, make sure that at least one C language compiler is installed in the current Linux operating system. For example, cc or gcc. If the installation is not performed, follow these steps:
The following is a simple configuration process: Suppose we put all the software in the/home/web directory.
The following 1. MYSQL configuration process...
[Root @ mail web] # tar zxvf mysql-5.0.18.tar.gz
[Root @ mail web] # mysql-5.0.18 cd
[Root @ mail mysql-5.0.18] # groupadd mysql
[Root @ mail mysql-5.0.18] # useradd-g mysql
[Root @ mail mysql-5.0.18] #./configure -- prefix =/usr/local/mysql # Install MYSQL to the specified directory
[Root @ mail mysql-5.0.18] # make
[Root @ mail mysql-5.0.18] # make install
[Root @ mail mysql-5.0.18] # scripts/mysql_install_db
[Root @ mail mysql-5.0.18] # chown-R root/usr/local/mysql
[Root @ mail mysql-5.0.18] # chown-R mysql/usr/local/mysql/var
[Root @ mail mysql-5.0.18] # chgrp-R mysql/usr/local/mysql
[Root @ mail mysql-5.0.18] # cp support-files/my-medium.cnf/etc/my. run the following command to start the MySQL database ):
[Root @ mail mysql-5.0.18] #/usr/local/mysql/bin/safe_mysqld -- user = mysql &
Append the preceding startup command to the end of the file "/etc/rc. d/rc. local" to enable the MySQL database server automatically when the operating system starts. The following initialization settings for MYSQL: [root @ mail mysql-5.0.18] #/usr/local/mysql/bin/mysql to enter the MYSQL client tool, related settings
Mysql> drop database test;
Mysql> use mysql;
Mysql> delete from mysql where user = "";
Mysql> delete from mysql where host = "% ";
Mysql> delete from db. Now, the mysql database only allows the root user of the local mysql Administrator (different from the root user of the operating system) to connect. Use the following command to specify the password for the root user:
[Root @ mail mysql-5.0.18] # cd/usr/local/mysql/bin
[Root @ mail bin] #./mysqladmin-u root @ localhost password "123456" in which "123456" is the ROOT user password. Create a new database as needed
[Root @ mail bin] #./mysql-u root-p
Mysql> create database linux;
Mysql> grant all privileges on linux. * to linux @ localhost identfied by 'linux ';
Mysql> exit;
[Root @ mail bin] #./mysqladmin-u root @ localhost-p flush-privileges;
The above command creates a mydb database and grants all its permissions to linux users. The password is "linux" and can only log on to the database from the local machine.
2. configuration process of Apache And PHP
[Root @ mail web] # tar zxvf httpd-2.0.50.tar.gz
[Root @ mail web] # httpd-2.0.50 cd
[Root @ mail web] # httpd-2.0.50 cd
[Root @ mail httpd-2.0.50] #./configure -- prefix =/usr/local/apache2 -- enable-module = so
[Root @ mail httpd-2.0.50] # make
[Root @ mail httpd-2.0.50] # make install
[Root @ mail httpd-2.0.50] # cd ..
[Root @ mail web] # tar zxvf php-5.0.0.tar.gz # install and configure PHP
[Root @ mail web] # tar zxvf php-5.0.0.tar.gz
[Root @ mail web] # php-5.0.0 cd
[Root @ mail php-5.0.0] #. /configure -- enable-track-vars -- with-mysql =/usr/local/mysql-with-apxs2 =/usr/local/apache2/bin/apxs -- disable-libxml -- disable-dom -- disable-simplelxml -- enable-soap -- enable-xml
# Because installed Apache is a relatively high version, so -- with-Retrial this should be changed to -- with-apxs2, and PHP5 added a lot of extension features, so be sure to add, otherwise it will report an error.
[Root @ mail php-5.0.0] # make
[Root @ mail php-5.0.0] # make install
[Root @ mail php-5.0.0] # cp php. ini-dist/usr/local/lib/php. ini # copy this file to the/usr/loca/lib/directory and change it to php. ini
The following is how to modify the Apache configuration file.
[Root @ mail php-5.0.0] # vi/usr/local/apache2/conf/httpd. conf
AddType application/x-httpd-php. php
Modify DirectotyIndex index.html. var
DirectoryIndex index. php index.html index.htm
Edit the "/usr/local/lib/php. ini" file. Change OFF to ON
Register_globals = on
Run the following command to start the WEB server and add it to the "/etc/rc. d/init. d/rc. local" file so that it can be automatically started upon startup.
[Root @ mail php-5.0.0] #/usr/local/apache2/bin/apachectl start
You can create the test. php file in the directory "/usr/local/apache/htdocs/" to test the system.
Phpinfo ();
?>
Enter http: // your_ip/test in the browser. php (your_ip is the IP address of the server), you can see the basic configuration information of php, And there is information about the MySQL database support, if not, the configuration is wrong, you need to check the above steps.
To fully utilize the rich application software on the windows platform, we will use the Samba server in Linux to communicate with the windows host, web pages and related php program files are directly stored on the linux server after being developed in windows. You do not need to use ftp or other tools to upload them.
First, confirm that the Samba package is installed in the current Linux operating system. If not, install the package and continue the following steps.
Edit the samba configuration file "/etc/samba/smb. conf" and add the following content at the end:
[Linux]
Path =/home/linux
Valid = user php
Public = no
Writable = yes
Printable = no
Creat mask = 0755
Run the following command to add system users and samba users:
[Root @ mail web] # adduser php
[Root @ mail web] # smbadduser php: php
(Enter the samba password and use it when logging on to the samba server in windows)
On the windows client (NT/2000 is recommended), use the Server IP Address "Search for computer". Find the computer and double-click the computer icon. In the displayed dialog box, enter "php ", enter the samba password set using the "smbadduser" command in the password box. Then, the samba server's shared directory "homepage" is displayed. Right-click the icon and select "ing network drive ", it can be mapped to a local logical drive letter. All the following web pages and programs can be directly stored on the Linux server through the disk operator.
This article fully introduces the entire process of building a dynamic website development platform under Linux. Practice has proved that this solution not only saves software investment, but also has good operability and reliability.
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