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 www.wordpress.com documentroot /var/www/html/wordpress <directory "/var/www/html/wordpress" > Options None AllowOverride None Order Allow,deny Allow from all </Directory> errorlog logs/wordpress.com-error_log customlog logs/ wordpress.com-access_log common</virtualhost><virtualhost *:80> servername www.phpmyadmin.com documentroot /var/www/html/phpmyadmin <Directory "/var/www/html/phpmyadmin" > options none allowoverride none order allow,deny allow from all </directory> errorlog logs/phpmyadmin.com-error_log CustomLog logs/phpmyadmin.com-access_log common</VirtualHost> |
3. Configure the/etc/httpd/conf.d/php.conf file:
<ifmodule prefork.c> LoadModule php5_module modules/libphp5.so</ifmodule><ifmodule worker.c> LoadModule Php5_module modules/libphp5-zts.so</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 -4.0.10.11 Downloads: ########[[email protected] ~]# wget https://files.phpmyadmin.net/phpMyAdmin/ 4.0.10.11/phpmyadmin-4.0.10.11-all-languages.zip###### #WordPress -3.1.3 Downloads: ########[[email protected] ~]# wget HTTPS ://cn.wordpress.org/wordpress-3.1.3-zh_cn.zip
6. Unzip the installation file and move to/var/www/html/to name the corresponding page root directory:
[Email protected] ~]# unzip wordpress-3.1.3-zh_cn.zip [[email protected] ~]# MV Wordpress/var/www/html/[[email protecte D] ~]# Ls/var/www/html/wordpress[[email protected] ~]# unzip Phpmyadmin-4.0.10.11-all-languages.zip[[email protected] ~]# MV Phpmyadmin-4.0.10.11-all-languages/var/www/html/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:
10.10.10.11 www.wordpress.com10.10.10.11 www.discuz.com10.10.10.11 www.phpmyadmin.com
Open the Www.wordpress.com website test:
650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M00/77/88/wKiom1ZpSTqiUCZqAADiB5jDADA028.png "title=" 1.png " alt= "Wkiom1zpstqiuczqaadib5jdada028.png"/>650) this.width=650; src= http://s1.51cto.com/wyfs02/M00/77/87/ 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.* Config.sample.inc.php[[email protected] phpmyadmin]# CP config.sample.inc.php Config.inc.php[[email protected] phpmyadmin]# vim config.inc.php$cfg[' blowfish_secret '] = ' 8955103650425443b68fc83f8c1ccd2a '; #配置一个加密密码的随机字符, you can use OpenSSL Rand-hex 16 to generate
2. Visit the www.phpmyadmin.com website test:
650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M02/77/89/wKiom1ZpT8-SzTo_AAArW3u5B-A188.png "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://s3.51cto.com/wyfs02/M00/77/87/wKioL1ZpUh3ytb9XAAB_hRcVHaM391.png "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://s5.51cto.com/wyfs02/M01/77/89/wKiom1ZpU3DzcJpvAABgnARVr1E677.png "title=" 1.png " alt= "Wkiom1zpu3dzcjpvaabgnarvr1e677.png"/>650) this.width=650; src= http://s5.51cto.com/wyfs02/M02/77/89/ 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:// mirrors.aliyun.com/epel/epel-release-latest-6.noarch.rpm
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://s5.51cto.com/wyfs02/M00/77/88/wKioL1ZpVyKi0GjHAAW7wIWA8L8299.png "title=" 1.png " alt= "Wkiol1zpvyki0gjhaaw7wiwa8l8299.png"/>
OK, that high-level feature opens, you can see here.
http://www.baike369.com/content/?id=5415
This article is from the "Systemcall Community" blog, so be sure to keep this source http://minux.blog.51cto.com/8994862/1721709
Use RPM to implement lamp configuration (Wordpress, phpMyAdmin)