LAMP build wrodpress Deployment Tutorial stickers.
This is a main will lamp, and through WordPress to verify, demo. How to deploy PHP CMS
Many novice see lamp is very big, feel very difficult to do, compile installs, engage for several days, or simply find someone else write a deployment script.
Today I'm going to introduce a simple way to make you feel another way to install lamp.
I use the tool is Yum, let you feel the power of yum ...
Originally wanted to put 2 posts, but found that the other post nothing to write, divided into 2 parts bar, the top is a simple installation, behind the tutorial paste.
Environment:
Centos 6.6x64 yum requires networking to ensure that your machine can be connected to the Internet and configured with the correct DNS (Yum usage prerequisites)
Disable firewalls and SELinux
Iptables-0
Installation stickers:
Yum Install php mysql-server httpd php-mysql php-gd-y
All right, lamp's loaded. Is it difficult?
Tutorial Stickers:
First of all to explain what is lamp. Listen to the name is very big on, but opened up is Linux APACHE Mysql PHP.
Linux: We all know, the system carries everything.
Apache:web Server, Provider page display
Mysql: Database, this everybody knows.
PHP: Provides parsing for PHP files.
Apart to see whether all understand, know, but just do not know how to get together to use?
Say One more thing:
Except for the lamp and LNMP, the difference is n instead of a.
N is nginx: A lightweight Web server, a rising star, but just as powerful.
But Nginx and Apache in different places between APAHCE and PHP connection is built-in, the mode of module loading;
and nginx need to install FASTCGI, provide interface. This is different, many people think nginx difficult, in fact, it is not rare, you know how to clarify their division of labor you understand,
Nginx is a Web server, can only provide Web services, that is, static page display, then PHP file What to do? You need to modify the Nginx configuration file tells Nginx to send php files to fastcgi to parse.
The difference is that he loaded the PHP module into his own program, the job does not need you to do. He himself resolved.
Okay, crap, not much. The main talk today is lamp:
Yum Install php httpd mysql-server wget unzip -y
Yum needs to be networked to ensure that your machine can surf the internet and configure the correct DNS.
wget Linux Download the amount of things, you need to download wroldpress, you can not install, upload your own package
Unzip for decompression.
So we put Mysql,apache (in Yum Apache service is httpd, after the text is httpd), PHP is installed, basically done.
Let's briefly introduce the following:
httpd
Configuration files in/etc/httpd/(now all modular, profile classification put)
Conf: is the master configuration file for httpd
CONF.D: Extension application configuration file, this directory configuration file, httpd reboot will automatically load, php.conf is httpd load the PHP module configuration file.
Web page File: Default Web Page file in/var/www/html/(we will put WordPress file here later)
MySQL: Nothing to say (lamp does not require all services to be installed on one stage.) MySQL can be installed on other servers.)
PHP: Nothing more to say.
Let's see what happened to our lamp.
Echo " <?php phpinfo ();?>" >/var/www/html/index.php
Phpinfo () function, which provides details of PHP
Now we have all the services set up:
Service httpd Start
Here will be reported a "could not reliably XXXX domain name XXX using the xxxx for Servername" This is a warning behind there [OK] the service started properly, does not affect!)
Service mysqld Start
MySQL first boot will initialize: So slow. A bunch of hints there's nothing wrong with the service starting up properly.
PS grep ' mysql\|httpd ' grep grep
Both MySQL and Apache indicate that the server is up and running.
We are now viewing in the browser;
Computer Browser input: 192.168.1.148/index.php (IP address to change your own)
See this page to show that our lamp success half, you will not find the MySQL extension on this page, so that PHP and MySQL will not be able to contact. If it is compiled, it is estimated that you are starting to recompile again. Yum Well, let's see if there's a php-mysql-related package.
Yum List | grep PHP
We saw a php-mysql.x86_64 bag and we put this on the package. Then restart the httpd.
Yum Install php-mysql-y
Service httpd Restart
Now let's refresh the index.php. Looking down, we'll have an extra mysqli module.
Yum installs the PHP extension pack as simple as this
This says that our lamp is completely installed successfully.
We go to download wordpress test under:
WordPress Installation:
WordPress Official Website: https://cn.wordpress.org/
Download WordPress, unzip, and move the extracted files to the default directory of httpd.
CD/tmpwget https://Cn.wordpress.org/wordpress-4.2.2-zh_cn.zip
Unzip Wordpress-4.2.2-zh_cn.zip
MV wordpress/var/www/html/
We petition in the browser asked: 192.168.1.148/wordpress/same as just now, changed to their own IP
This is the installation interface of WordPress, have to spit slot WordPress How to install the complex. The data needs to be created by itself, and there is no prompt or creation statement.
Perhaps because of the directory permissions problem, the hint of this configuration file can not be generated, I created a.
Create a MySQL Database
Mysql-u Root
Above this command is under the shell, the front prompt is this: [[email protected] ~]#
The following command is the default prompt in the shell of MySQL:mysql> found a lot of people do not pay attention to this, no login successfully still input SQL command
Create Database WordPress;
Grant all privileges the wordpress.* to [e-mail protected] identified by ' WordPress ';
Flush privileges;
Exit
Create a WordPress database, and create a WordPress user to the WordPress database has all permissions, password for WordPress, I have used a word. I hope you can be separated. Database name, user, and password.
Just not to say that the WordPress file can not be generated, then I created a, self-clothed.
cd/var/www/html/WordPresscp wp-config-sample.php wp-config.phpsed' s/database_name_here/wordpress/' wp-sed's/username_ here/wordpress/' wp-config.phpsed's/password_here/ wordpress/' wp-config.php
Let's go ahead and install it. This is done ...
About the GD library:
WordPress unexpectedly did not use the GD library, I changed a discuz, or did not encounter the GD library, and changed a finally met ...
PHP's GD library is not extended, we have just installed the Php-mysql extension library method;
Yum Install Php-gd-y
Service httpd Restart
This passed, Yum is so capricious so simple ....
LAMP build wrodpress Deployment Tutorial stickers.