Use RPM to implement lamp configuration (Wordpress, phpMyAdmin)

Source: Internet
Author: User
Tags mcrypt phpmyadmin wordpress blog myadmin

Lamp is a very good combination of web industry, known as the gold combination, next we configure lamp in RPM and install phpMyAdmin and wordpress,phpmyadmin is a page way of MySQL management software, WordPress is a blogging system. (Note: In the RPM mode of lamp, PHP is working with Apache modules.) )

1. Install lamp software:

[[Email protected] ~] #yum install-y httpd mysql mysql-server php php-mysql

2. Configure the httpd and make it based on the virtual host:

Servertokens Prod
Hide sensitive information about the HTTPD server, version number, etc.
Serversignature OFF
Display OS information as little as possible
KeepAlive onmaxkeepaliverequests 100KeepAliveTimeout 5

Configure HTTP to enable long connections and set the number of requests and timeout periods
Include conf.d/*.conf
Make sure this entry is enabled, PHP configuration file in the CONF.D directory
#DocumentRoot "/var/www/html"
Comment out the documentroot to implement the configuration of the virtual host
<directory "/var/www/cgi-bin" > AllowOverride none Options none Order Allow,deny deny from All</direct Ory>

Adjusts the CGI directory to deny access to all users.
Namevirtualhost *:80 Claims are domain-based virtual hosts and listen for 80 ports of native available IP

Configure two domain-based hosts:

<VirtualHost *:80>    ServerName     documentroot /var/www/html/wordpress    <directory  "/var/www/html/wordpress" >        Options None         AllowOverride None        Order Allow,deny         Allow from all    </Directory>     errorlog logs/    customlog logs/ common</virtualhost><virtualhost *:80>     servername    documentroot /var/www/html/phpmyadmin     <Directory  "/var/www/html/phpmyadmin" >         options none        allowoverride none         order allow,deny        allow from all     </directory>    errorlog logs/     CustomLog logs/ common</VirtualHost>

3. Configure the/etc/httpd/conf.d/php.conf file:

<ifmodule prefork.c> LoadModule php5_module modules/</ifmodule><ifmodule worker.c> LoadModule Php5_module modules/</ifmodule>

Configure different modes to load different modules, by default you can

DirectoryIndex index.php
Home page for index.php
AddHandler php5-script. Phpaddtype text/html. php

Use Php5-script to execute. PHP End of script

Defines the. php file at the end of the text/html format

4. Start MySQL (MySQL configuration file is/etc/my.cnf, Data directory is/var/lib/m)

[[email protected] ~]#  service mysqld startStarting mysqld:                                             [   OK  ][[email protected] ~]# ss -tnl|grep  ": 3306" listen      0      50                         *:3306                       *:*      [[email protected] ~]# 

5. Download website installation files: Just download WordPress and phpMyAdmin

###### #phpMyadmin - Downloads: ########[[email protected] ~]# wget #WordPress -3.1.3 Downloads: ########[[email protected] ~]# wget HTTPS ://

6. Unzip the installation file and move to/var/www/html/to name the corresponding page root directory:

[Email protected] ~]# unzip [[email protected] ~]# MV Wordpress/var/www/html/[[email protecte D] ~]# Ls/var/www/html/wordpress[[email protected] ~]# unzip[[email protected] ~]# MV Phpmyadmin-[[email protected] ~]#

The entire environment is configured as above, and each Web site is configured separately:

First, configure WordPress:

1. Configuration files

[[email protected] ~]# cd/var/www/html/wordpress/[[email protected] wordpress]# ls wp-config* wp-config-sample.php[[ Email protected] wordpress]# CP wp-config-sample.php wp-config.php[[email protected] wordpress]# vim wp-config.php  Define (' db_name ', ' wordpress_db '); #这里是指定数据库为wordpress_db, if the library does not need to be manually created define (' Db_user ', ' WordPress '); #这里是指定连接数据库的用户名是wordpress, if no user is required to manually create the user and authorize define (' Db_password ', ' redhat ');  #指定用户密码为redhatdefine (' db_host ', ' localhost '); #指定连接的主机为localhost

2. Create databases and users, etc.:

[email protected] ~]# MySQL <word_press.sql #执行创建
######## #word_press. sql file contents ############# #USE MySQL;  #使用mysql库, for the following optimization drop USER ' @ ' localhost ';   #删除多余的用户, belongs to the optimized drop DATABASE test; #删除test库, belongs to optimize create DATABASE wordpress_db; GRANT all privileges the wordpress_db.* to ' WordPress ' @ ' localhost ' identified by ' Redhat '; FLUSH privileges; SHOW DATABASE;

3. The local Hosts file configuration domain name resolution (directly 3 domain names are configured together, so as not to be configured in a moment) and test WordPress blog is installed:

Configure the Windows hosts (C:\Windows\System32\drivers\etc) file to add: www.wordpress.com10.10.10.11 www.discuz.com10.10.10.11

Open the website test:

650) this.width=650; "src=" Http:// "title=" 1.png " alt= "Wkiom1zpstqiuczqaadib5jdada028.png"/>650) this.width=650; src= Wkiol1zpsy6ixqdlaabsjxcgghm763.png "title=" 1.png "alt=" Wkiol1zpsy6ixqdlaabsjxcgghm763.png "/>

Second, the configuration phpMyAdmin

1. Set the configuration file:

[[email protected] phpmyadmin]# cd/var/www/html/phpmyadmin/[[email protected] phpmyadmin]# ls config.*[[email protected] phpmyadmin]# CP[[email protected]   phpmyadmin]# vim$cfg[' blowfish_secret '] = ' 8955103650425443b68fc83f8c1ccd2a '; #配置一个加密密码的随机字符, you can use OpenSSL Rand-hex 16 to generate

2. Visit the website test:

650) this.width=650; "src=" Http:// "title=" 1.png " alt= "Wkiom1zpt8-szto_aaarw3u5b-a188.png"/> here that the lack of mbstring extension, mbstring is the PHP character encoding extension library, PHP is only supported by default iso-8859-*, EUC-JP, UTF-8, because we download phpmyadmin that support all languages (character encodings), you need to install Mbstring:

[email protected] phpmyadmin]# Yum install-y php-mbstring

Add PHP extensions and need to restart httpd for PHP modules to load these extensions:

[[email protected] phpmyadmin]# service httpd restartstopping httpd:                                               [  ok  ]starting httpd: httpd: could  not reliably determine the server ' S fully qualified domain name,  using ::1 for ServerName                                                              [  ok  ][[ Email protected] phpmyadmin]# 

Refresh Retry:

650) this.width=650; "src=" Http:// "title=" 1.png " alt= "Wkiol1zpuh3ytb9xaab_hrcvham391.png"/> To create a user and authorize login:

[email protected] ~]# MySQL <myadmin.sql # # # # #myadmin. sql file contents ######[[email protected] ~]# cat myadmin.sql GRANT all PR Ivileges on * * to ' Meng ' @ "identified by ' Redhat '; FLUSH privileges; [Email protected] ~]#

650) this.width=650; "src=" Http:// "title=" 1.png " alt= "Wkiom1zpu3dzcjpvaabgnarvr1e677.png"/>650) this.width=650; src= Wkiom1zpu5_xeeflaaxvbtqbpac361.png "title=" 1.png "alt=" wkiom1zpu5_xeeflaaxvbtqbpac361.png "/> OK, no problem, The following also prompts us to mcrypt the extension,PHP Programmers in the code program, in addition to ensure the high performance of the code, there is one thing is very important, that is the security of the program. In addition to several cryptographic functions, PHP also features a more comprehensive PHP encryption extension library Mcrypt and mhash. Among them, the MCrypt extension Library can implement the encryption and decryption function, that is, the plaintext can be encrypted or ciphertext restored . installation command:

[[email protected] ~]# Yum install-y php-mcrypt #这个包由epel源提供 # # # #epel包, download and install the installation and install Php-mcrypt can # # # #http://

Restart Service:

[[email protected] ~]# service httpd restartstopping httpd:                                               [  ok  ]starting httpd: httpd: could not  reliably determine the server ' s fully qualified domain name,  using ::1 for servername                                                              [  ok  ][[email  protected] ~]#

Refresh page re-login view:

650) this.width=650; "src=" Http:// "title=" 1.png " alt= "Wkiol1zpvyki0gjhaaw7wiwa8l8299.png"/>

OK, that high-level feature opens, you can see here.

This article is from the "Systemcall Community" blog, so be sure to keep this source

Use RPM to implement lamp configuration (Wordpress, phpMyAdmin)

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: 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.