Install LAMP + wordpress on the Centos Server

Source: Internet
Author: User
Tags centos server install wordpress mysql login wordpress database

Many posts such as LAMP + forums and blogs are posted on the Internet, but they are not completely written, and users who are new to users often suffer from this problem, because there are some minor differences in the methods used in many versions, it is impossible to complete all the installation. Here, to facilitate installation and debugging, I downloaded the latest httpd, mysql, php, wordpress, and phpmyadmin compilation programs (which can be found on the official website), set up a personal blog, and fully introduced the installation process, the organization is clear and the content is easy to understand. I hope this will help the comrades who have learned this knowledge! Preparation: download the latest version of the compiled source code program
Httpd-2.2.9.tar.gz # apache service source code
Mysql-5.0.22.tar.gz # mysql database source code
Php-5.2.10.tar.gz # php environment source code
Wordpress-2.8.4-zh_CN.zip # wordpress compressed package program
PhpMyAdmin-3.2.1-all-languages.tar.gz # phpmysql Management source code1. Install mysql:
1. Create a user group and user group for mysql
> Groupadd mysql # create a mysql Group
> Useradd-g mysql # create a user mysql and add it to the mysql group. This user is primarily a user running the mysql service. 2. Compile and install mysql
> Tar-zxvf mysql-5.0.22.tar.gz # Extract
> Cd mysql-5.0.22
>./Configure -- prefix =/usr/local/mysql # specify the installation path and Directory
> Make # compile source code
> Make install # install 3. Configure and start mysql
> Cp support-files/my-medium.cnf/etc/my. cnf # copy the profile template
> Cd/usr/local/mysql
> Usr/local/bin/mysql_install_db -- user = mysql # initialize and install the mysql database
> Chown-R root: mysql. # change the owner of the current directory to root and the group to mysql.
> Chown-R mysql var # modify the var directory group of the current directory to mysql
> Bin/mysqld_safe -- user = mysql & # Use user mysql to safely start the mysql program and put it in the background. 4. Change the mysql root Password.
>/Usr/local/mysql/bin/mysqladmin-u root password 123, abc # Add a user and password to enter the mysql database. If the user is "root ", the password is "123, abc" (Note: This and system root are two concepts)
5. Test whether mysql is available
>/Usr/local/mysql/bin/mysql-u root-p # Use User root to connect to mysql
Enter password: 123, abc # Enter the password displayed in the previous step "123, abc"
Mysql> use the "status" or "select version ();" command to view the current mysql version (this ensures that your version is correct. I once got a 5.0 version, install mysql 3.0) 6. Set mysql to start automatically
Add
/Usr/local/mysql/bin/mysqld_safe -- user = mysql &Ii. install Apache> tar-zxvf httpd-2.2.9.tar.gz # decompress
> Cd httpd-2.2.9
>. /Configure -- prefix =/usr/local/apache -- with-mysql =/usr/local/mysql -- enable-module = so -- enable-shared = max -- enable-rewrite #" -- prefix "sets the absolute path of the installation directory of the program. If not set, install it in the default path "/usr/local/bin. The "-- ebable-module = so" option sets the dynamic loading module function for the Apache server. -- Enable-shared = max indicates that all configured modules are compiled into the DSO module (except for so, so cannot be compiled into DSO ). Dynamic Loading will bring about a 5% performance reduction, but it is nothing more important than the benefits: for example, convenient module upgrade, reduced risk of system upgrade, and standardized installation process. The "-- enable-rewrite" option sets the rewrite function for the Apache server. The rewrite function can rewrite the dynamic web page address so that web page visitors can access the pages in the dynamic web page system through a simpler and easier-to-remember web page address.> Make # compile source code
> Make install # install
>/Usr/local/apache/bin/apachectl start # start the httpd service. Do not start/etc/rc. d/init. d/httpd. This is installed by default.
After the installation is complete, enter http: // IP in the IE browser to check whether the hosts page can be accessed. If yes, "It" OK! "is displayed !"3. Install the PHP Environment
> Tar-zxvf php-5.2.10.tar.gz
> Cd php-5.2.10
>. /Configure -- prefix =/usr/local/php -- with-mysql =/usr/local/mysql -- with-apxs2 =/usr/local/apache/bin/apxs -- with-config- file-path =/usr/local/php
> Make
> Make install
> Cp php. ini-dist/usr/local/php/lib/php. ini # copy the configuration file template as the default configuration file
> Vi/usr/local/php/bin/php. ini modify register_globals = On4. Configure httpd. conf
> Vi/usr/local/apache/conf/httpd. conf
1. Check whether LoadModule php5_module libexec/libphp5.so exists.
2. Add "AddType application/x-httpd-php. php" and "AddType application/x-httpd-php-source. phps"
3. Find "DirectoryIndex index.html" and add index. php before index.html.
4. Close and restart the httpd service.
>/Usr/local/apache/bin/apachectl stop
>/Usr/local/apache/bin/apachectl start5. test whether the PHP environment is in good condition!
> Vi/usr/local/apache/htdocs/index. php
Content:
<? Php
Phpinfo ();
?>
>/Usr/local/apache/bin/apachectl restart # restart the httpd service
Enter "httpd: // ip" in IE to access the php information page.6. Create a database
/Usr/local/mysql/bin/mysql-u root-p # connect to the mysql database
Mysql> create database wordpress; # create database wordpress. If OK is displayed, the database is successfully created.
Mysql> show databases; # Check whether the database you just created exists.7. install wordpress
> Cd/usr/local/apache/htdocs/
> Unzip wordpress-2.8.4-zh_CN.zip
> Cp wp-config-sample.php wp-config.php
> Vi wp-config.php # edit the configuration file and enter the database name, user name, and password
// ** MySQL settings-specific information comes from the host you are using **//
/** Replace "putyourdbnamehere" with the WordPress database name "*/
Define ('db _ name', 'wordpress ');/** Replace "username here" with the MySQL database username "*/
Define ('db _ user', 'root');/** Replace "yourpasswordhere" with the MySQL database password "*/
Define ('db _ password', '2014, 123, abc'); 8. Enter "http: // ip/wordpress // wp-admin/install. php "for installation. Enter the blog name and email address on the page. A username and password are automatically generated as admin, And the password is a random number (remember to save ), click "Log on" in the lower-right corner to go To the wordpress background for optimization. Subsequent work .........
9. Install phpmyadmin
> Tar-xzf phpMyAdmin-3.2.1-all-languages.tar.gz # decompress to the/usr/local/apache/htdocs/directory
> Cd/usr/local/apache/htdocs/phpMyAdmin-3.2.1-all-languages/# enter the phpMyAdmin directory
> Cp config. sample. inc. php config. inc. php # copy the configuration file template to the current configuration file.
> Vi config. inc. php
Modify
// $ Cfg ['servers'] [$ I] ['controluser'] = 'pma ';
// $ Cfg ['servers'] [$ I] ['controlpass'] = 'pmapass ';
Is
$ Cfg ['servers'] [$ I] ['controluser'] = 'root'; # mysql login Username
$ Cfg ['servers'] [$ I] ['controlpass'] = '2017, abc'; # mysql logon Password10. Verify phpmyadmin
In IE, enter: http: // 192.168.10.10/phpMyAdmin-3.2.1-all-languages/and enter the username and password for logging on to mysql. Subsequent work .........

This article is from the blog of "the Linux open source technology blog", please be sure to keep this source http://dreamfire.blog.51cto.com/418026/197595


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.