Original LAMP+PHPMYADMIN+FTP Environment Construction

Source: Internet
Author: User
Tags phpmyadmin

*** Simple FTP Server Setup:

Rpm–qa|grep VSFTPD//Check whether the service is installed

Yum–y Install vsftpd-*//Installation Services

Mkdir/var/ftp/upload//Create a service home directory

Useradd vsftpd–d/var/ftp/upload–s/sbin/nologin//Create service user login and specify home directory, disable login

Ll–d/var/ftp/upload//View directory Owner

Chown vsftpd:vsftpd/var/ftp/upload//Change directory Owner

passwd vsftpd (VSFTPD)//Set password for user

TAIL/ETC/PASSWD//View user password file

vi/etc/vsftpd/vsftpd.conf//config Service Master file

/ETC/INIT.D/VSFTPD Start//Startup service

NETSTAT–ANTP | GREP:21//View service process

Native FTP test (if no FTP installed, need to install, or do not support FTP command), XP system FTP test (need to shut down the firewall).

*** Simple Apache+php+mysql Build:

1. Install Apache:

#yum Install httpd Httpd-devel

To start Apache:

#/etc/init.d/httpd start

Enter the server's IP address at this time, you should see the Apache service page, the port does not lose, Apache default is to use 80 port

2. Install MySQL:

#yum install MySQL Mysql-server

Start MySQL:

#/etc/init.d/mysqld start

3. Install PHP

#yum Install PHP Php-devel

Restart Apache to make PHP effective

#/etc/init.d/httpd restart

In this case, you can create a php file under directory:/var/www/html/

Code:

<?php phpinfo ();?>

Then access this file, you can see some PHP information, the path of the php.ini configuration file can be seen on this page

4. Installation of PHP extensions

#yum Install php-mysql php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc

You need to restart Apache again after installing the extension

#/etc/init.d/httpd restart

5. Test whether MySQL links the successful PHP code

<?php

$con = mysql_connect ("localhost", "root", "Login Database Password");

if (! $con)

{

Die (' Could not connect: '. Mysql_error ());

}

mysql_select_db ("Database name", $con);

$result = mysql_query ("SELECT * from Sys_user");

while ($row = Mysql_fetch_array ($result))

{

echo $row [' UserName ']. " " . $row [' PassWord ']. " " . $row [' id '];

echo "<br/>";

}

Mysql_close ($con);

?>

You can pass the above code to the directory/var/www/html/

A return of information indicates the success of the building!!!

Note: If the Chinese character set of the page that appears is garbled, this needs to modify the value of the Default_charset field of the/etc/php.ini configuration file, set to: gb2312.

***phpmyadmin Yum installation

Configuration is slightly different because it is installed with Yum

If you do not have a package installed with #yum–y install phpMyAdmin, you need to configure the installation source as follows:

[[email protected] ~]# vi/etc/yum.repos.d/dag.repo← establish Dag.repo, define unofficial library

[Dag]

Name=dag RPM Repository for Red Hat Enterprise Linux

baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag

Gpgcheck=1

Enabled=1

[Email protected] ~]# Rpm–import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt

← Import of the non-official library GPG

After that, the installation is in progress.

phpMyAdmin is installed by default, Usr/share/phpmyadmin copy phpMyAdmin to the Web directory:

[Email protected] www]# cp-r/usr/share/phpmyadmin//var/www/html/

Visit http://IP/phpmyadmin

When entering the phpMyAdmin page: Existing configuration file (./config.inc.php) is not

Readable.

At this time, the config.inc.php authority was amended to

[Email protected] phpmyadmin]# chmod 777 config.inc.php

When entering the phpMyAdmin page: Wrong permissions on configuration file, should is not being world

Writable

Cause: This is the phpMyAdmin directory permission setting problem, if the phpMyAdmin all files chmod 777 will appear this hint.

Workaround: As long as you modify the file properties, phpMyAdmin to run under 755 permissions,

[Email protected] html]# chmod-r 755 phpmyadmin/

Re-entry to phpMyAdmin page: Profile now requires top secret phrase password (blowfish_secret)

' Blowfish_secret ' uses an arbitrary string as the encrypted string of the cookie, and if there is no encryption key, the system displays "

The configuration file now requires a top secret phrase password (blowfish_secret), configured as follows:

VI phpmyadmin/config.inc.php

$cfg [' Servers '] [$i] [' auth_type '] = ' cookie ';

$cfg [' blowfish_secret '] = ' yoozhu '; (where "Yoozhu" is customized)?>

After the modification, later login phpMyAdmin is more convenient, but must not use the blank password, remember!

[Email protected] ~]# chown-r root:apache/var/www/phpmyadmin/

[[email protected] ~]# vi/etc/httpd/conf.d/phpmyadmin.conf establish phpmyadmin configuration file for Apache calls

Alias/phpmyadmin/var/www/phpmyadmin

Order Deny,allow

Deny from all

Allow from 127.0.0.1

Allow from 192.168.0

This allows only host access to the local and 192.168.0.0/network segments, and if the extranet user is allowed, please do not fill in the contents of the tag

[[email protected] ~]#/etc/rc.d/init.d/httpd Restart Restart HTTP service for the above settings to take effect

stopping httpd: [OK]

Starting httpd: [OK]

And then we'll test if it's successful, start typing https://192.168.232.128/phpmyadmin

Note: For security purposes, use the #mv command to rename the phpMyAdmin under the/var/www/html directory to the name "arbitrarily complex string length" To change the access URL path.

Original LAMP+PHPMYADMIN+FTP Environment Construction

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.